EdgeCrafter
Vision transformer ringkas untuk prediksi dense di perangkat edge, dipublikasikan upstream sebagai tiga model bersaudara: ECDet, ECPose dan ECSeg. LibreYOLO memuat ketiganya sebagai satu family, dengan task ditentukan oleh checkpoint.
- Task
- detection, pose, instance segmentation
- Ukuran
- s, m, l, x at 640 px
- Instalasi
pip install libreyolo- Tier dukungan
- Inti, sejak v1.2.0. Detektor inti yang dapat dilatih: fitur menyusul tier unggulan dalam gelombang rilis yang sama.
- Proyek upstream
- EdgeCrafter oleh Intellindust AI Lab, Apache-2.0 original COCO weights; restricted obj2coco weights. Makalah, sumber
- Lisensi
- Kode Apache-2.0, bobot Apache-2.0 original COCO weights; restricted obj2coco weights. Penggunaan komersial
Instalasi
EdgeCrafter tidak memerlukan extra opsional. Semua yang diimpornya sudah tersedia di instalasi dasar.
pip install libreyoloFine-tuning adapter dengan lora=True adalah pengecualian, dan memerlukan extra
lora.
pip install "libreyolo[lora]"Prediksi
Bobot diunduh dari Hugging Face saat pertama kali dipakai lalu disimpan di cache lokal.
from libreyolo import LibreYOLO, SAMPLE_IMAGE model = LibreYOLO("LibreECs.pt")result = model(SAMPLE_IMAGE, save=True) for box in result.boxes: print(box.cls, box.conf, box.xyxy)libreyolo predict model=LibreECs.pt source=https://raw.githubusercontent.com/LibreYOLO/libreyolo/release/libreyolo/assets/parkour.jpg save=Truefrom libreyolo import LibreYOLO, SAMPLE_IMAGE # Sufiks -pose pada nama berkas memilih head keypoint, jadi argumen# task tidak diperlukan di sini.model = LibreYOLO("LibreECs-pose.pt")result = model(SAMPLE_IMAGE, save=True) print(result.keypoints.xy)print(result.boxes.conf)from libreyolo import LibreYOLO, SAMPLE_IMAGE model = LibreYOLO("LibreECs-seg.pt")result = model(SAMPLE_IMAGE, save=True) print(result.masks.data.shape)Task berasal dari nama berkas, jadi checkpoint -pose atau -seg memilih
head-nya sendiri dan tidak menerima argumen task. Ketiganya mengembalikan objek
Results yang dikembalikan setiap family, dengan tambahan result.keypoints
untuk pose dan result.masks untuk segmentasi. Pose mencakup satu kelas, yaitu
person, dengan 17 keypoint COCO, dan jumlahnya ditetapkan saat model dibangun.
Pose tidak punya head box, jadi setiap box pose adalah rentang batas dari
keypoint-nya sendiri, dan kanal keypoint ketiga berupa konstanta, bukan skor per
titik.
conf dan max_det menyaring pemilihan query; iou tetap diterima demi
keseragaman API tetapi tidak berpengaruh, karena ketiga head melakukan decode
atas sekumpulan query tanpa langkah NMS. Lihat prediksi untuk
source, streaming dan penanganan hasil.
Prediksi deteksi menerima imgsz=(height, width) persegi panjang; pelatihan dan ekspor tetap memiliki batasan bentuk masing-masing.
Varian
Empat ukuran. Semuanya berjalan pada resolusi input yang sama, jadi tabel membedakannya lewat jumlah parameter dan akurasi.
| Checkpoint | Input (piksel) | mAP 50-95 | Parameter (juta) |
|---|---|---|---|
| LibreECl | 640 | 60.1 | 32.97 |
| LibreECm | 640 | 58.4 | 19.43 |
| LibreECs | 640 | 54.3 | 9.88 |
| LibreECx | 640 | 61.1 | 49.94 |
COCO val2017, 500 images. Diukur oleh perangkat benchmark LibreYOLO dan dipublikasikan di Vision Analysis, tempat latensi pada berbagai hardware dan runtime dibandingkan serta rekaman lengkap setiap pengujian tersedia.
Upstream memublikasikan ECDet, ECPose dan ECSeg sebagai tiga model terpisah, bukan satu model dengan tiga head. Ketiganya berbagi backbone ECViT dan encoder hybrid, dan hanya berbeda pada head, jadi LibreYOLO menyatukannya menjadi satu family dan membiarkan nama berkas checkpoint yang menentukan task. Karena itu huruf ukuran berarti backbone dan encoder yang sama di ketiganya, dan prediksi, validasi serta ekspor memakai argumen yang sama, mana pun yang dimuat.
Pelatihan
Ketiga task dilatih lewat train(), yang membaca task dari checkpoint yang
dimuat lalu memilih trainer yang cocok.
from libreyolo import LibreYOLO model = LibreYOLO("LibreECs.pt")model.train( data="my-dataset.yaml", epochs=50, imgsz=640, batch=8, lr0=5e-4,)libreyolo train model=LibreECs.pt data=my-dataset.yaml epochs=50 imgsz=640 batch=8 lr0=5e-4from libreyolo import LibreYOLO # Butuh dataset keypoint satu kelas yang data.yaml-nya mendeklarasikan# kpt_shape, dan imgsz pada ukuran native checkpoint.model = LibreYOLO("LibreECs-pose.pt")model.train( data="my-pose-dataset.yaml", epochs=50, imgsz=640,)from libreyolo import LibreYOLO # Butuh label poligon, dan imgsz pada ukuran native checkpoint.model = LibreYOLO("LibreECs-seg.pt")model.train( data="my-dataset.yaml", epochs=50, imgsz=640,)from libreyolo import LibreYOLO model = LibreYOLO("LibreECs.pt")model.train( data="my-dataset.yaml", epochs=50, lora=True,)Yang sudah diperiksa untuk deteksi dan segmentasi: kesetaraan inferensi terhadap
upstream pada 1e-5, lapisan demi lapisan dan per ukuran, serta bahwa loss dan
satu langkah pelatihan berjalan pada input sintetis. Yang belum, menurut
docstring train() sendiri: konvergensi fine-tune penuh, pelatihan multi-GPU,
langkah stop-augmentation best-reload, dan remap kelas Objects365 ke COCO. Jalur
pose mengikuti resep yang dipublikasikan DETRPose, yaitu matcher Hungarian atas
biaya kelas, L1 keypoint dan OKS dengan denoising keypoint kontrastif, dan
konvergensinya juga belum diperiksa dari ujung ke ujung.
Jika dibiarkan apa adanya, trainer menjalankan 74 epoch pada lr0=5e-4 dengan
mixed precision aktif, mengikuti resep upstream: AdamW, jadwal cosine datar, EMA
pada 0.9999 dan input yang dinormalisasi ala ImageNet. Pose dan segmentasi
sama-sama mengharuskan imgsz pada ukuran native checkpoint, karena grid anchor
untuk evaluasinya dibangun saat model dikonstruksi; nilai yang berbeda akan
memunculkan error sebelum run dimulai. Pose juga mengharuskan dataset satu kelas
yang data.yaml-nya mendeklarasikan kpt_shape, dengan jumlah keypoint yang
cocok dengan head.
lora=True hanya berlaku untuk deteksi; pose dan segmentasi memunculkan
ValueError jika memakainya. Di Apple silicon, trainer mempertahankan run di GPU
dan mengirim satu operasi ke CPU, yaitu backward grid-sample di dalam deformable
attention, yang tidak diimplementasikan PyTorch di Metal.
Lihat pelatihan untuk dataset, augmentasi, multi-GPU dan logger.
Validasi
val() mengembalikan dictionary dengan key berupa nama metrik, dan mencetak
hasil per kelas jika verbose dibiarkan aktif.
from libreyolo import LibreYOLO model = LibreYOLO("LibreECs.pt")metrics = model.val(data="my-dataset.yaml") print(metrics["metrics/mAP50-95"])print(metrics["metrics/mAP50"])libreyolo val model=LibreECs.pt data=my-dataset.yamlfrom libreyolo import LibreYOLO model = LibreYOLO("LibreECs-pose.pt")metrics = model.val(data="my-pose-dataset.yaml") print(metrics["metrics/keypoints_mAP50-95"])print(metrics["metrics/keypoints_mAP50"])from libreyolo import LibreYOLO model = LibreYOLO("LibreECs-seg.pt")metrics = model.val(data="my-dataset.yaml") print(metrics["metrics/mAP50-95(M)"]) # maskprint(metrics["metrics/mAP50-95(B)"]) # boxPose melaporkan metrik OKS keypoint di bawah metrics/keypoints_*. Segmentasi
melaporkan mask di bawah key metrics/mAP50-95 biasa dan mengulang kedua sudut
pandang dalam satu pass, box di bawah (B) dan mask di bawah (M).
Ekspor
| Task | ONNX | TorchScript | ExecuTorch | TensorRT | OpenVINO | Paddle | MNN | RKNN | ncnn | TFLite | CoreML | Core AI |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Detection | Detection to ONNX: didukung | Detection to TorchScript: didukung | Detection to ExecuTorch: didukung | Detection to TensorRT: didukung | Detection to OpenVINO: didukung | Detection to Paddle: didukung | Detection to MNN: didukung | Detection to RKNN: tidak didukung | Detection to ncnn: tidak didukung | Detection to TFLite: tidak didukung | Detection to CoreML: tidak didukung | Detection to Core AI: didukung |
| Pose | Pose to ONNX: didukung | Pose to TorchScript: didukung | Pose to ExecuTorch: didukung | Pose to TensorRT: didukung | Pose to OpenVINO: didukung | Pose to Paddle: didukung | Pose to MNN: tidak didukung | Pose to RKNN: tidak didukung | Pose to ncnn: tidak didukung | Pose to TFLite: tidak didukung | Pose to CoreML: tidak didukung | Pose to Core AI: tidak didukung |
| Instance segmentation | Instance segmentation to ONNX: didukung | Instance segmentation to TorchScript: didukung | Instance segmentation to ExecuTorch: didukung | Instance segmentation to TensorRT: didukung | Instance segmentation to OpenVINO: didukung | Instance segmentation to Paddle: didukung | Instance segmentation to MNN: tidak didukung | Instance segmentation to RKNN: tidak didukung | Instance segmentation to ncnn: tidak didukung | Instance segmentation to TFLite: tidak didukung | Instance segmentation to CoreML: tidak didukung | Instance segmentation to Core AI: tidak didukung |
Artefak hasil ekspor dimuat kembali lewat LibreYOLO() berdasarkan sufiks
berkasnya, jadi berkas .onnx atau .engine berperilaku seperti checkpoint dan
mengembalikan Results yang sama. Pose dan segmentasi diekspor pada input tetap
640 kali 640, bukan shape dinamis, dan beberapa target deteksi juga memakai
kanvas tetap, termasuk OpenVINO, Paddle, MNN, ExecuTorch dan Core AI.
Ekspor memuat daftar argumen yang diterima setiap format dan
tambahan yang disediakan sebagian di antaranya.
from libreyolo import LibreYOLO model = LibreYOLO("LibreECs.pt")model.export(format="onnx", imgsz=640)model.export(format="tensorrt", imgsz=640, half=True)libreyolo export model=LibreECs.pt format=onnx imgsz=640libreyolo export model=LibreECs-pose.pt format=onnx imgsz=640libreyolo export model=LibreECs-seg.pt format=onnx imgsz=640from libreyolo import LibreYOLO, SAMPLE_IMAGE # Factory memilih jalur berdasarkan sufiks berkas, jadi artefak hasil# ekspor dimuat seperti checkpoint biasa dan mengembalikan objek# Results yang sama.model = LibreYOLO("LibreECs.onnx")result = model(SAMPLE_IMAGE) print(result.boxes.xyxy)Input dan output ONNX
| Tensor | images float32 [batch, 3, height, width] |
|---|---|
| Warna | RGB |
| Penskalaan | piksel / 255 |
| Normalisasi | rata-rata [0.485,0.456,0.406], simpangan baku [0.229,0.224,0.225] |
| Ubah ukuran | regangkan ke lebar x tinggi (tanpa padding, rasio aspek tidak dipertahankan), Pillow bilinear |
Cara mereproduksi resize bilinear Pillow
LibreYOLO mengubah ukuran dengan filter BILINEAR milik Pillow (Image.resize). Ini bukan OpenCV INTER_LINEAR maupun INTER_AREA: saat memperkecil, Pillow memperlebar filter sebesar faktor pengecilan, dan resize OpenCV mengubah deteksi serta menggeser kotak beberapa piksel. Untuk mereproduksinya tanpa Pillow, ubah ukuran satu sumbu, bulatkan ke 8 bit, lalu ubah ukuran sumbu lainnya dan bulatkan lagi. Per sumbu, misalkan s = in_size / out_size dan f = max(s, 1). Piksel keluaran i berpusat di c = (i + 0.5) * s dan membaca piksel sumber j dari int(c - f + 0.5) sampai int(c + f + 0.5) - 1, dibatasi pada gambar, masing-masing dengan bobot max(0, 1 - |j + 0.5 - c| / f), dibagi jumlah bobot. Pillow bekerja dengan fixed point dan memilih urutan sumbu dari bentuk gambar, sehingga bobot float dapat berbeda satu level pada beberapa piksel. Hal itu tidak mengubah hasil pada pemeriksaan kami.
Square input only. Export rejects a non-square imgsz, and height and width are 640 by default.
Detect and segment: batch size 1 only. The graph declares a dynamic batch axis, but batches of 2 or more fail in 1.7.0. Pose runs with any batch size.
For a bit-exact match, use Pillow's integer math: multiply each weight by 2^22 and round half away from zero, sum weight x pixel in integers, add 2^21, shift right by 22 and clip to 0 to 255.
Divide by 255 after the resize, then subtract the ImageNet mean and divide by the ImageNet std per channel.
Detection, ekspor default
| Output | Bentuk | Arti |
|---|---|---|
pred_logits | [batch, queries, nc] | Raw class logits per query, sigmoid not applied. 300 queries and 80 classes for the COCO checkpoints. |
pred_boxes | [batch, queries, 4] | Boxes as cx, cy, w, h, normalized 0 to 1 of the input. |
Pascapemrosesan
- Apply sigmoid to pred_logits.
- Flatten the scores to queries x nc and take the top max_det (300 by default) over all queries x classes. For flat index k, the query is k // nc and the class is k % nc. One query can yield several classes.
- Keep the entries whose score is strictly above the confidence threshold (0.25 by default). There is no NMS.
- Convert the query's box to x1, y1, x2, y2 with x1 = cx - w / 2, y1 = cy - h / 2, x2 = cx + w / 2, y2 = cy + h / 2.
- Map boxes back to the original image: multiply x by the original width and y by the original height. The input was stretched, so no pad offset applies. LibreYOLO does not clip these boxes to the image.
- nms=True is not available for this family: export raises NotImplementedError.
Instance segmentation, ekspor default
| Output | Bentuk | Arti |
|---|---|---|
pred_logits | [batch, queries, nc] | Raw class logits per query, sigmoid not applied. 300 queries and 80 classes for the COCO checkpoints. |
pred_boxes | [batch, queries, 4] | Boxes as cx, cy, w, h, normalized 0 to 1 of the input. |
pred_masks | [batch, queries, mask_h, mask_w] | Raw mask logits per query over the whole input canvas, sigmoid not applied. mask_h and mask_w are a quarter of the input, 160 x 160 at 640 x 640. |
Pascapemrosesan
- Select detections exactly as for detect: sigmoid on pred_logits, top max_det (300 by default) over all queries x classes, keep scores strictly above the confidence threshold (0.25 by default). There is no NMS.
- Convert and map the boxes as for detect: cx, cy, w, h to x1, y1, x2, y2, then multiply x by the original width and y by the original height. LibreYOLO does not clip these boxes to the image.
- For each kept detection, take the mask logits of its query and resize them straight to the original image size with bilinear interpolation, half-pixel centers (align_corners=False) and no antialiasing. cv2.resize with INTER_LINEAR on float32 does this.
- The mask is the pixels whose resized logit is above 0. Masks are not cropped to the box.
- nms=True is not available for this family: export raises NotImplementedError.
Pose, ekspor default
| Output | Bentuk | Arti |
|---|---|---|
pred_logits | [batch, queries, 2] | Raw logits per query, sigmoid not applied. 60 queries. Index 1, the last one, is the person class. Index 0 is an unused slot. |
pred_keypoints | [batch, queries, num_keypoints * 2] | Keypoints as x0, y0, x1, y1 and so on, normalized 0 to 1 of the input. num_keypoints is 17 (COCO order) and is recorded in the num_keypoints metadata key. There is no box output and no keypoint visibility or confidence. |
Pascapemrosesan
- Apply sigmoid to the last logit of each query. That is the person score.
- Sort the queries by score, highest first, and keep at most max_det (300 by default, so all 60 queries). Keep the queries whose score is at or above the confidence threshold (0.25 by default). Note at or above here, strictly above for detect and segment. There is no NMS.
- Reshape each kept query's keypoints to [num_keypoints, 2]. Map them back to the original image: multiply x by the original width and y by the original height.
- The box is the extent of the mapped keypoints: x1, y1 are the minimum x and y, x2, y2 the maximum. The class is always 0 (person).
- LibreYOLO reports visibility 1 for every keypoint, since the graph predicts xy only.
- nms=True is not available for this family: export raises NotImplementedError.
Untuk memeriksa implementasi Anda sendiri, jalankan file yang sama lewat LibreYOLO: LibreYOLO("model.onnx").predict("image.jpg") mengembalikan hasil acuan. Diverifikasi dengan LibreYOLO 1.7.0.
Checkpoint
Semua berkas bobot yang dipublikasikan untuk family ini.
| Berkas | Input (piksel) | Lisensi bobot |
|---|---|---|
| Detection | ||
| LibreECs.pt | 640 | apache-2.0 |
| LibreECm.pt | 640 | apache-2.0 |
| LibreECl.pt | 640 | apache-2.0 |
| LibreECx.pt | 640 | apache-2.0 |
| LibreECl-obj2coco.pt | other | |
| LibreECm-obj2coco.pt | other | |
| LibreECs-obj2coco.pt | other | |
| LibreECx-obj2coco.pt | other | |
| Pose | ||
| LibreECs-pose.pt | 640 | apache-2.0 |
| LibreECm-pose.pt | 640 | apache-2.0 |
| LibreECl-pose.pt | 640 | apache-2.0 |
| LibreECx-pose.pt | 640 | apache-2.0 |
| LibreECl-pose-obj2coco.pt | other | |
| LibreECm-pose-obj2coco.pt | other | |
| LibreECs-pose-obj2coco.pt | other | |
| LibreECx-pose-obj2coco.pt | other | |
| Instance segmentation | ||
| LibreECs-seg.pt | 640 | apache-2.0 |
| LibreECm-seg.pt | 640 | apache-2.0 |
| LibreECl-seg.pt | 640 | apache-2.0 |
| LibreECx-seg.pt | 640 | apache-2.0 |
| LibreECm-seg-obj2coco.pt | other | |
| LibreECs-seg-obj2coco.pt | other | |
| LibreECl-seg-obj2coco.pt | other | |
| LibreECx-seg-obj2coco.pt | other | |
Setiap berkas di atas saat ini tersedia di organisasi LibreYOLO dan diunduh saat pertama kali digunakan.
Varian obj2coco mencakup deteksi, segmentasi, dan pose. Pengunduhannya memerlukan persetujuan eksplisit dan ketentuan upstream membatasi penggunaan komersial. Checkpoint COCO asli mempertahankan izin Apache-2.0 yang tercatat.
Lisensi
Periksa lisensi di repositori Hugging Face untuk bobot tertentu yang diunduh. Setiap checkpoint di organisasi LibreYOLO memiliki lisensi, dan lisensinya tidak selalu sama dalam satu family. Repositori tersebut adalah sumber resmi. Ringkasan di bawah menjelaskan ketentuan yang berlaku saat halaman ini terakhir diverifikasi.
Ini adalah deskripsi lisensi yang terlibat, bukan nasihat hukum. Jika jawabannya penting secara komersial, baca sendiri lisensinya dan mintalah nasihat dari penasihat hukum Anda.
- Karya asli
- EdgeCrafter, Intellindust AI Lab
- Lisensi upstream
- Apache-2.0 original COCO weights; restricted obj2coco weights
- Sumber upstream
- github.com/Intellindust-AI-Lab/EdgeCrafter
- Kode LibreYOLO
- MIT
- Bobot
- Apache-2.0 original COCO weights; restricted obj2coco weights, dipublikasikan ulang di huggingface.co/LibreYOLO
- Interpretasi
- Original COCO checkpoints retain their recorded Apache-2.0 grant. The obj2coco detection, segmentation and pose variants require explicit opt-in and retain non-commercial upstream terms. The library code license does not replace those weight terms.
Sitasi
@article{liu2026edgecrafter,
title={EdgeCrafter: Compact ViTs for Edge Dense Prediction via Task-Specialized Distillation},
author={Liu, Longfei and Hou, Yongjie and Li, Yang and Wang, Qirui and Sha, Youyang and Yu, Yongjun and Wang, Yinzhi and Ru, Peizhe and Yu, Xuanlong and Shen, Xi},
journal={arXiv},
year={2026}
}Disalin dari blok sitasi penulis di github.com/Intellindust-AI-Lab/EdgeCrafter#-citation.