AnnotateIt/edgecrafter-ecseg-m-onnx
<!-- annotateit-brand:start --> <p><a href="https://huggingface.co/AnnotateIt"><img src="https://huggingface.co/spaces/AnnotateIt/README/resolve/d399a89b9d5dcf41afbe7cf29bf99c9028bc51e2/assets/annotateit-logo.png" width="48" height="48" alt="AnnotateIt"></a></p>
[AnnotateIt](https://annotateit.ai/) · [Open the app](https://app.annotateit.ai/) · [Models & datasets](https://huggingface.co/AnnotateIt) · [Documentation](https://annotateit.ai/docs/) <!-- annotateit-brand:end -->
EdgeCrafter ECSeg-M — FP32 ONNX (independent, unofficial)
STATUS: READY FOR REVIEW
- all gates passed
Independent, unofficial conversion. NOT endorsed by the EdgeCrafter authors. Apache-2.0.
Higher-capacity sibling of ECSeg-S: identical ONNX contract and edgecrafter-seg runtime, larger backbone (higher COCO AP, larger file, slower inference). In AnnotateIt this is the Advanced instance-segmentation variant; ECSeg-S remains the Recommended default.
Provenance
- Upstream: https://github.com/Intellindust-AI-Lab/EdgeCrafter @
b17f0f340af687e7adf2dff42a49e2eb8250ee20 - Checkpoint: https://github.com/capsule2077/edgecrafter/releases/download/edgecrafterv1/ecseg_m.pth
- size=81904698 bytes, sha256=
f1abcbd6ed747ed7364466a9fc4d3dc9ceb8d48cc123b353f717235c9c52069d - Task: instance segmentation. Precision: FP32. Opset: 17 (ai.onnx only, no external data, no custom ops).
Artifacts (raw export vs finalized release — two distinct files)
- Raw export artifact (intermediate, no metadata):
work/onnx/ecseg_m.onnx— sha256=aef52ea64b52c41aeca4e300cc7555254a14558025b031006cdfbba1458334d5. Produced byexport/export_raw_onnx.pyfrom the pinned checkpoint + upstream. - Finalized release artifact (this repo's
model.onnx): size=80820640 bytes, sha256=ded8147572ecec27fe2b384cfac5e5cc38738c9b3be773d5ccbee3c261820474. Produced byexport/build_release.py= raw export + deterministic metadata embed. This is the file to download / hash. - Byte-reproducible:
python export/build_release.py --raw work/onnx/ecseg_m.onnx --doubleyields the final sha twice (seemanifest.json:deterministic_rebuild). - Strict load: missing=0, unexpected=0.
validation-report.jsonand../validation/ecseg_m_verify.jsonverify the finalizedmodel.onnx(not the intermediate raw export).
Input / preprocessing
images[1,3,640,640] float32, RGB, stretch-resize to 640×640, /255, ImageNet mean/std, NCHW.- Browser preprocessing must match this (see validation-report for canvas-vs-PIL parity).
Output contract
- labels[1,300] i64 (0..79), boxes[1,300,4] xyxy NORMALIZED, scores[1,300], masks[1,300,160,160] logits
- External postprocessing: filter scores>thr (no NMS); boxespx = boxes*[W,H,W,H]; mask = resize(masks,(H,W),bilinear,aligncorners=false) > 0 (logit)
- batch_size = 1 only (static). batch>1 not exported (decoder topk GatherElements bakes batch at trace).
Validation
- Semantic parity (PyTorch↔ONNX, Hungarian-matched real COCO images): {"images": 12, "minboxiou": 0.9999960660934448, "minmaskiou": 0.9999999999808753, "classagreemin": 1.0, "maxscoredelta": 2.9012560389674036e-06}
- COCO val2017: ONNX AP=45.05 (AP50=68.0 AP75=48.1); local PyTorch AP=45.05; upstream=45.2
- Browser (onnxruntime-web 1.24.3, CPU/WASM): see validation-report.json
- WebGPU: informational; see report
ONNX Runtime example (Python, CPU)
import numpy as np, onnxruntime as ort
s = ort.InferenceSession('model.onnx', providers=['CPUExecutionProvider'])
# x: preprocess your image -> float32 [1,3,640,640], RGB, stretch 640, ImageNet norm
out = s.run(None, {'images': x})Class mapping
- See
config.json(80 contiguous COCO classes). Identical class list to ECSeg-S (0=person, 1=bicycle, 2=car).
AnnotateIt integration
- Uses the dedicated
edgecrafter-segparser preset (NOTyolov8-seg, whose tensor contract differs) — the same preset/runtime as ECSeg-S. Confidence 0.4, mask logit cutoff 0.0, CPU/WASM EP, no NMS. Seeannotateit-compatibility.md. - Integration is wired and release-gated: the catalog card and curated Match → Test → Save wizard only activate once this package is uploaded to Hugging Face and its immutable 40-hex commit is pinned (see
HF_UPLOAD_HANDOFF.md).
Known limitations
- Static batch=1 only. batch>1 not exported (decoder topk
GatherElementsbakes batch at trace time). - CPU/WASM is the production path. WebGPU on onnxruntime-web 1.24.3 fails this graph:
[MatMul] /model/decoder/decoder/integral/MatMul→ "shared dimension does not match" (seevalidation-report.json:browser_runtime.webgpu). Do not run this model on the WebGPU EP. - Low-confidence boxes can fall outside `[0,1]`. Raw
boxesare normalized xyxy but the DETR head does not clamp. The consumer MUST score-filter first, then clamp box coordinates (and polygon points) to `[0,1]` / image bounds. - Masks tensor is large: `masks[1,300,160,160]` float32 ≈ 30.72 MB per inference. Do NOT resize all 300 masks to full image resolution. First filter by score, then process only the surviving instances' `[160,160]` maps.
- Masks are per-instance logits (not proto·coeff): binary mask =
logit > 0(⇔ sigmoid > 0.5). No NMS — DETR set prediction with top-k already applied. - Independent / unofficial conversion. NOT endorsed by the EdgeCrafter authors. Apache-2.0 — attribution and license retained (see
NOTICE,LICENSE).
