CoolFace
Modelpublic

AnnotateIt/dfine-nano-coco-onnx

sourceHugging Faceapache-2.0updated 6d agoView on Hugging Face
0likes186downloads
Model Card

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

D-FINE Nano COCO — verified ONNX export for AnnotateIt

This repository contains a fixed-shape FP32 ONNX export of the official `ustc-community/dfine-nano-coco` checkpoint for local, in-browser object detection in AnnotateIt.

This is an AnnotateIt-maintained conversion, not an official D-FINE release. The ONNX graph was exported from the exact upstream revision `066438d3d8f0da137a37b38fdf3368fd4afceced`, which contains the upstream weight fix published on 20 August 2025.

Artifact

FileValue
ONNX graphmodel.onnx
PrecisionFP32
Opset18
Inputpixel_values: float32 [1, 3, 640, 640]
Outputslogits: float32 [1, 300, 80]; pred_boxes: float32 [1, 300, 4]
Size15,434,935 bytes
SHA-256b0ec2e5793f3a3cbd07440d098645a0e102cd450fb92f4f35e713f36e35d152e

The shape is intentionally fixed to batch 1 at 640×640. A dynamic-shape export was rejected during validation because it did not preserve the reference model's outputs.

Preprocessing and outputs

  1. 1.Convert the image to RGB.
  2. 2.Resize to 640×640 with bilinear interpolation (stretch, without letterboxing).
  3. 3.Rescale each channel to [0, 1] by dividing by 255.
  4. 4.Convert HWC to NCHW and add a batch dimension.
  5. 5.Apply sigmoid to logits, then take the best class score per query.
  6. 6.Interpret pred_boxes as normalized cx, cy, width, height and map them back to the original image dimensions.

The model uses the 80 COCO classes. No NMS is required by the reference postprocessor.

Validation

The graph passed all of the following checks:

  • ONNX graph validation and ONNX Runtime CPU inference;
  • numerical comparison with the pinned official PyTorch checkpoint;
  • inference with AnnotateIt's installed onnxruntime-web 1.24.3 WASM runtime;
  • a real COCO reference image, where PyTorch and ONNX returned the same five detections at a 0.3 score threshold, with matching classes, scores, and boxes.

See `validation-report.json` for measured tolerances and `PROVENANCE.md` for the reproducible source/export record. Runtime timings in the report are smoke-test observations, not benchmarks.

Why this is a fresh export

The pre-existing ONNX Community conversion was created before the official checkpoint's August 2025 weight fix. It accurately represents the older checkpoint but does not match the current official weights. This repository therefore exports the current pinned checkpoint locally instead of copying that older graph.

License

D-FINE and the source checkpoint are licensed under Apache License 2.0. The full license text is included in `LICENSE`. Please retain the license and attribution when redistributing this model.

Upstream project: `Peterande/D-FINE`