D-FINE-seg – detection, instance and semantic segmentation in one model D-FINE-seg, a framework for real-time object detection, instance segmentation, and semantic segmentation, achieves higher F1 scores than YOLO26 and RF-DETR on Cityscapes detection and instance segmentation, and leads mIoU on semantic segmentation, with 2-3x fewer parameters, according to its developers. The model supports five sizes (N to X), multi-backend export (ONNX, TensorRT, OpenVINO, CoreML, LiteRT), and multi-channel inputs including RGB+thermal. The codebase is available on GitHub and pretrained weights are auto-downloaded from Hugging Face. Real-Time Object Detection, Instance and Semantic Segmentation Quick Start quick-start • Usage usage • Export export • Inference inference • Benchmarks benchmarks • Video Tutorial https://youtu.be/ uEyRRw4miY • Colab https://colab.research.google.com/drive/1ZV12qnUQMpC0g3j-0G-tYhmmdM98a41X?usp=sharing D-FINE-seg is a framework for real-time object detection , instance segmentation , and semantic segmentation - one codebase, one config flag task: detect | segment | sem seg , five model sizes N - X . - End-to-end workflow - dataset prep - training DDP, EMA, AMP, mosaic - export ONNX, TensorRT, OpenVINO, CoreML, LiteRT - benchmarked multi-backend inference - Accuracy - on Cityscapes, beats YOLO26 and RF-DETR on detection & instance-seg F1 and leads mIoU on semantic segmentation, at real-time latency with 2-3x fewer params; also higher F1 than YOLO26 on TACO and VisDrone TensorRT FP16, end-to-end protocol - Paper - D-FINE-seg: Object Detection and Instance Segmentation Framework with Multi-Backend Deployment https://arxiv.org/abs/2602.23043 - Not a fork: the detection core follows the D-FINE paper https://github.com/Peterande/D-FINE ; segmentation heads, training, export and inference are implemented from scratch. One frame, three tasks, one config flag: Instance segmentation head task: segment - lightweight mask head on top of D-FINE's HybridEncoder PAN outputs: stride 8/16/32 features fused to 1/4 resolution, then a dot-product between per-query mask embeddings 3-layer MLP and the shared mask features yields per-instance masks Semantic segmentation head task: sem seg - reuses the pretrained instance-seg mask fuser on full-frame features, followed by a small conv neck and 1x1 classifier: no queries, no NMS Mask-aware training - box-cropped BCE + Dice mask losses instance seg and CE + multi-class soft Dice with ignore index semantic seg , mask supervision inside contrastive denoising, and Dice + sigmoid-focal mask costs in the Hungarian matcher - all train-time only, zero inference cost COCO-pretrained weights for detection , auto-downloaded on first use - fine-tuning starts from a trained mask decoder, not from scratch and instance segmentation Multi-channel inputs - train on RGB + thermal / depth / NIR stacks 4-channel .npy , not just RGB Modern training stack - Muon optimizer, DDP, EMA, mosaic + affine augs, OneCycle, early stopping, WandB Beyond the model - ByteTrack tracking, SAM3 auto-labeling, Gradio demo, INT8 quantization OpenVINO / CoreML / LiteRT git clone https://github.com/ArgoHA/D-FINE-seg.git cd D-FINE-seg uv sync This creates a .venv/ with all dependencies pinned by uv.lock . Activate it with source .venv/bin/activate , or run anything via uv run ... the Makefile already does this . Pretrained weights are auto-downloaded from Hugging Face https://huggingface.co/ArgoSA/D-FINE-seg into pretrained/ on first use, so no manual setup is needed. To download manually instead, grab dfine