EdgeCrafter
A compact vision transformer for dense prediction on edge hardware, published upstream as three sibling models: ECDet, ECPose and ECSeg. LibreYOLO loads all three as one family, with the task carried by the checkpoint.
- Tasks
- detection, pose, instance segmentation
- Sizes
- s, m, l, x at 640 px
- Install
pip install libreyolo- Support tier
- Core, since v1.2.0. Core trainable detectors: features follow the flagships in the same release wave.
- Upstream
- EdgeCrafter by Intellindust AI Lab, Apache-2.0 original COCO weights; restricted obj2coco weights. Paper, source
- Licenses
- Code Apache-2.0, weights Apache-2.0 original COCO weights; restricted obj2coco weights. Commercial use
Install
EdgeCrafter needs no optional extra. Everything it imports is in the base install.
pip install libreyoloAdapter fine-tuning with lora=True is the exception, and needs the lora
extra.
pip install "libreyolo[lora]"Predict
Weights download from Hugging Face on first use and are cached locally.
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 # The -pose suffix in the filename selects the keypoint head, so no# task argument is needed here.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)The task comes from the filename, so a -pose or -seg checkpoint selects its
own head and takes no task argument. All three return the Results object every
family returns, with result.keypoints added for pose and
result.masks for segmentation. Pose covers one class, person, with the 17
COCO keypoints, and the count is fixed when the model is built. It has no box
head, so each pose box is the bounding extent of its own keypoints, and the
third keypoint channel is a constant rather than a per-point score.
conf and max_det filter the query selection; iou is accepted for API
parity but has no effect, because all three heads decode a set of queries with no
NMS step. See prediction for sources, streaming and result
handling.
Detection prediction accepts rectangular imgsz=(height, width); training and export retain their own shape constraints.
Variants
Four sizes. They all run at the same input resolution, so the table separates them by parameter count and accuracy.
| Checkpoint | Input (px) | mAP 50-95 | Params (M) |
|---|---|---|---|
| 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. Measured by the LibreYOLO benchmark harness and published on Vision Analysis, where latency across hardware and runtimes is compared and the full run records live.
Upstream publishes ECDet, ECPose and ECSeg as three separate models rather than one model with three heads. They share the ECViT backbone and the hybrid encoder and differ only in the head, so LibreYOLO folds them into a single family and lets the checkpoint filename carry the task. A size letter therefore means the same backbone and encoder across all three, and predict, validate and export take the same arguments whichever one you load.
Train
All three tasks train through train(), which reads the task from the loaded
checkpoint and picks the matching trainer.
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 # Needs a single-class keypoint dataset whose data.yaml declares# kpt_shape, and imgsz at the checkpoint's native size.model = LibreYOLO("LibreECs-pose.pt")model.train( data="my-pose-dataset.yaml", epochs=50, imgsz=640,)from libreyolo import LibreYOLO # Needs polygon labels, and imgsz at the checkpoint's native size.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,)What has been checked for detection and segmentation: inference parity against
upstream at 1e-5, layer by layer and per size, and that the loss and a single
training step run on synthetic input. What has not, per train()'s own
docstring: convergence of a full fine-tune, multi-GPU training, the
stop-augmentation best-reload step, and the Objects365 to COCO class remap. The
pose path follows DETRPose's published recipe, a Hungarian matcher over class,
keypoint L1 and OKS costs with contrastive keypoint denoising, and its
convergence has not been checked end to end either.
Left alone, the trainer runs 74 epochs at lr0=5e-4 with mixed precision on,
following upstream's recipe: AdamW, a flat cosine schedule, EMA at 0.9999 and
ImageNet-normalized inputs. Pose and segmentation both require imgsz at the
checkpoint's native size, because their evaluation anchor grid is built when the
model is constructed; a different value raises before the run starts. Pose also
requires a single-class dataset whose data.yaml declares kpt_shape, with a
keypoint count matching the head.
lora=True applies to detection only; pose and segmentation raise a
ValueError on it. On Apple silicon the trainer keeps the run on the GPU and
sends one operation to CPU, the grid-sample backward inside deformable
attention, which PyTorch does not implement in Metal.
See training for datasets, augmentation, multi-GPU and loggers.
Validate
val() returns a dictionary keyed by metric name, and prints per-class results
when verbose is left on.
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)"]) # masksprint(metrics["metrics/mAP50-95(B)"]) # boxesPose reports keypoint OKS metrics under metrics/keypoints_*. Segmentation
reports masks under the plain metrics/mAP50-95 key and repeats both views in
one pass, boxes under (B) and masks under (M).
Export
| Task | ONNX | TorchScript | ExecuTorch | TensorRT | OpenVINO | Paddle | MNN | RKNN | ncnn | TFLite | CoreML | Core AI |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Detection | Detection to ONNX: supported | Detection to TorchScript: supported | Detection to ExecuTorch: supported | Detection to TensorRT: supported | Detection to OpenVINO: supported | Detection to Paddle: supported | Detection to MNN: supported | Detection to RKNN: not supported | Detection to ncnn: not supported | Detection to TFLite: not supported | Detection to CoreML: not supported | Detection to Core AI: supported |
| Pose | Pose to ONNX: supported | Pose to TorchScript: supported | Pose to ExecuTorch: supported | Pose to TensorRT: supported | Pose to OpenVINO: supported | Pose to Paddle: supported | Pose to MNN: not supported | Pose to RKNN: not supported | Pose to ncnn: not supported | Pose to TFLite: not supported | Pose to CoreML: not supported | Pose to Core AI: not supported |
| Instance segmentation | Instance segmentation to ONNX: supported | Instance segmentation to TorchScript: supported | Instance segmentation to ExecuTorch: supported | Instance segmentation to TensorRT: supported | Instance segmentation to OpenVINO: supported | Instance segmentation to Paddle: supported | Instance segmentation to MNN: not supported | Instance segmentation to RKNN: not supported | Instance segmentation to ncnn: not supported | Instance segmentation to TFLite: not supported | Instance segmentation to CoreML: not supported | Instance segmentation to Core AI: not supported |
An exported artifact loads back through LibreYOLO() on its file suffix, so a
.onnx or .engine file behaves like a checkpoint and returns the same
Results. Pose and segmentation export at a fixed 640 by 640 input rather than
dynamic shapes, and several detection targets are fixed-canvas too, including
OpenVINO, Paddle, MNN, ExecuTorch and Core AI. Export lists the
arguments every format accepts and the extras a few of them add.
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 # The factory routes on the file suffix, so an exported artifact loads# like any checkpoint and returns the same Results object.model = LibreYOLO("LibreECs.onnx")result = model(SAMPLE_IMAGE) print(result.boxes.xyxy)ONNX inputs and outputs
| Tensor | images float32 [batch, 3, height, width] |
|---|---|
| Color | RGB |
| Scaling | pixel / 255 |
| Normalization | mean [0.485,0.456,0.406], std [0.229,0.224,0.225] |
| Resize | stretch to width x height (no padding, aspect ratio not kept), Pillow bilinear |
How to reproduce Pillow's bilinear resize
LibreYOLO resizes with Pillow's BILINEAR filter (Image.resize). It is not OpenCV INTER_LINEAR or INTER_AREA: when shrinking, Pillow widens the filter by the shrink factor, and OpenCV's resizes change detections and move boxes by several pixels. To reproduce it without Pillow, resize one axis, round to 8 bits, then resize the other axis and round again. Per axis, let s = in_size / out_size and f = max(s, 1). Output pixel i has center c = (i + 0.5) * s and reads source pixels j from int(c - f + 0.5) to int(c + f + 0.5) - 1, clipped to the image, each with weight max(0, 1 - |j + 0.5 - c| / f), divided by the sum of the weights. Pillow works in fixed point and picks the axis order from the image shape, so float weights can differ from it by one level on a few pixels. That does not change the results in our checks.
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, default export
| Output | Shape | Meaning |
|---|---|---|
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. |
Postprocessing
- 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, default export
| Output | Shape | Meaning |
|---|---|---|
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. |
Postprocessing
- 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, default export
| Output | Shape | Meaning |
|---|---|---|
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. |
Postprocessing
- 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.
To check your own implementation, run the same file through LibreYOLO: LibreYOLO("model.onnx").predict("image.jpg") returns the reference results. Verified with LibreYOLO 1.7.0.
Checkpoints
Every published weight file for this family.
| File | Input (px) | Weights license |
|---|---|---|
| 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 | |
Every file above exists in the LibreYOLO org today and downloads on first use.
The obj2coco variants cover detection, segmentation and pose. Their download is opt-in and their upstream terms restrict commercial use. Original COCO checkpoints keep their recorded Apache-2.0 grant.
Licensing
Check the license on the Hugging Face repository of the specific weights you download. Every checkpoint in the LibreYOLO org carries one, and they are not always the same across a family. That repository is the authoritative source; the summary below describes what applied when this page was last verified.
This is a description of the licenses involved, not legal advice. If the answer matters commercially, read the licenses yourself and take your own counsel.
- Original work
- EdgeCrafter, Intellindust AI Lab
- Upstream license
- Apache-2.0 original COCO weights; restricted obj2coco weights
- Upstream source
- github.com/Intellindust-AI-Lab/EdgeCrafter
- LibreYOLO code
- MIT
- Weights
- Apache-2.0 original COCO weights; restricted obj2coco weights, republished at huggingface.co/LibreYOLO
- Interpretation
- 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.
Citation
@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}
}Copied from the authors' citation block at github.com/Intellindust-AI-Lab/EdgeCrafter#-citation.