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.

bash
pip install libreyolo

Adapter fine-tuning with lora=True is the exception, and needs the lora extra.

bash
pip install "libreyolo[lora]"

Predict

Weights download from Hugging Face on first use and are cached locally.

Python
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)
CLI
libreyolo predict model=LibreECs.pt source=https://raw.githubusercontent.com/LibreYOLO/libreyolo/release/libreyolo/assets/parkour.jpg save=True
Pose
from 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)
Instance segmentation
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.

CheckpointInput (px)mAP 50-95Params (M)
LibreECl64060.132.97
LibreECm64058.419.43
LibreECs64054.39.88
LibreECx64061.149.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.

Python
from libreyolo import LibreYOLO model = LibreYOLO("LibreECs.pt")model.train(    data="my-dataset.yaml",    epochs=50,    imgsz=640,    batch=8,    lr0=5e-4,)
CLI
libreyolo train model=LibreECs.pt data=my-dataset.yaml epochs=50 imgsz=640 batch=8 lr0=5e-4
Pose
from 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,)
Instance segmentation
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,)
LoRA
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.

Python
from libreyolo import LibreYOLO model = LibreYOLO("LibreECs.pt")metrics = model.val(data="my-dataset.yaml") print(metrics["metrics/mAP50-95"])print(metrics["metrics/mAP50"])
CLI
libreyolo val model=LibreECs.pt data=my-dataset.yaml
Pose
from 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"])
Instance segmentation
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)"])   # boxes

Pose 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

TaskONNXTorchScriptExecuTorchTensorRTOpenVINOPaddleMNNRKNNncnnTFLiteCoreMLCore AI
DetectionDetection to ONNX: supportedDetection to TorchScript: supportedDetection to ExecuTorch: supportedDetection to TensorRT: supportedDetection to OpenVINO: supportedDetection to Paddle: supportedDetection to MNN: supportedDetection to RKNN: not supportedDetection to ncnn: not supportedDetection to TFLite: not supportedDetection to CoreML: not supportedDetection to Core AI: supported
PosePose to ONNX: supportedPose to TorchScript: supportedPose to ExecuTorch: supportedPose to TensorRT: supportedPose to OpenVINO: supportedPose to Paddle: supportedPose to MNN: not supportedPose to RKNN: not supportedPose to ncnn: not supportedPose to TFLite: not supportedPose to CoreML: not supportedPose to Core AI: not supported
Instance segmentationInstance segmentation to ONNX: supportedInstance segmentation to TorchScript: supportedInstance segmentation to ExecuTorch: supportedInstance segmentation to TensorRT: supportedInstance segmentation to OpenVINO: supportedInstance segmentation to Paddle: supportedInstance segmentation to MNN: not supportedInstance segmentation to RKNN: not supportedInstance segmentation to ncnn: not supportedInstance segmentation to TFLite: not supportedInstance segmentation to CoreML: not supportedInstance 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.

Python
from libreyolo import LibreYOLO model = LibreYOLO("LibreECs.pt")model.export(format="onnx", imgsz=640)model.export(format="tensorrt", imgsz=640, half=True)
CLI
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=640
Use the exported file
from 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

Tensorimages float32 [batch, 3, height, width]
ColorRGB
Scalingpixel / 255
Normalizationmean [0.485,0.456,0.406], std [0.229,0.224,0.225]
Resizestretch 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
OutputShapeMeaning
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

  1. Apply sigmoid to pred_logits.
  2. 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.
  3. Keep the entries whose score is strictly above the confidence threshold (0.25 by default). There is no NMS.
  4. 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.
  5. 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.
  6. nms=True is not available for this family: export raises NotImplementedError.
Instance segmentation, default export
OutputShapeMeaning
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

  1. 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.
  2. 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.
  3. 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.
  4. The mask is the pixels whose resized logit is above 0. Masks are not cropped to the box.
  5. nms=True is not available for this family: export raises NotImplementedError.
Pose, default export
OutputShapeMeaning
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

  1. Apply sigmoid to the last logit of each query. That is the person score.
  2. 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.
  3. 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.
  4. 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).
  5. LibreYOLO reports visibility 1 for every keypoint, since the graph predicts xy only.
  6. 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.

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
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.

Verified against LibreYOLO v1.6.0. Support tables, checkpoints and benchmark numbers on this page are generated from the released library and the published weights, not written by hand.