Object Detection
ONNX
d-fine
onnxruntime-web
webgpu

D-FINE-N (COCO), ONNX for the browser

D-FINE nano, trained on COCO, exported to ONNX so it runs in ONNX Runtime Web on WebGPU and WASM. It's the default object detector in @64tensor/retouch-ml.

The weights are the D-FINE authors', from ustc-community/dfine-nano-coco at 066438d. export.py rebuilds model.onnx byte for byte and checks it against PyTorch.

Why this export: onnx-community/dfine_n_coco-ONNX scored every detection under 0.5 in our tests, and a plain export fails on WebGPU. This file has two graph changes for WebGPU, and neither changes the outputs:

  • ceil_mode is dropped from a stride-1 MaxPool, where it has no effect.
  • The 1-D second input of three MatMuls in decoder/integral becomes a column.

Input and output

Name Shape
pixel_values [1, 3, 640, 640] float32 RGB, 0–1, the image resized to 640Γ—640 (no letterbox)
logits [1, 300, 80] per-class logits; sigmoid gives the score
pred_boxes [1, 300, 4] center x, center y, width, height, 0–1 of the image

Keep each query's best class above your threshold. No NMS is needed.

Accuracy and speed

On 500 COCO val2017 images: AP 45.9, AP50 63.4 (YOLOX-nano: 27.4, 43.1). In Chrome on an M1 Max, a 640Γ—640 run takes about 22 ms on WebGPU and 230 ms on single-threaded WASM.

License

Apache-2.0, as are the D-FINE code and weights: see LICENSE. Copyright (c) 2024 The D-FINE Authors. The export script is 64Tensor's, under the same license.

Citation

@misc{peng2024dfine,
  title={D-FINE: Redefine Regression Task in DETRs as Fine-grained Distribution Refinement},
  author={Yansong Peng and Hebei Li and Peixi Wu and Yueyi Zhang and Xiaoyan Sun and Feng Wu},
  year={2024},
  eprint={2410.13842},
  archivePrefix={arXiv},
}
Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for 64Tensor/dfine-n-coco-onnx

Quantized
(9)
this model

Paper for 64Tensor/dfine-n-coco-onnx