Skip to main content

nitid

One library. DETR made simple.

Documentation License Python Open In Colab

Train, validate, export and run vision models. The code and the official pretrained weights are released under the Apache License 2.0, so you can ship them inside your own product without opening your code or paying for a license.

nitid, from Latin nitidus: clear, transparent, precise.

No AGPL, no surprises.

Object detection with nitid1m

Installation · Quick start · Models · Documentation

Why nitid?

  • Edge first. The models are designed to run at the edge, on the hardware next to your cameras, not only on a datacenter GPU or NPU.
  • Self-contained checkpoints. Every checkpoint carries the config and the class names it needs to be reproduced and checked — one file per model.
  • Handles messy datasets. COCO and YOLO layouts are read directly, with no conversion step, and the inconsistencies real datasets have are tolerated.
  • Export anywhere. OpenVINO, ONNX, TorchScript and TensorRT, from the same checkpoint.

One library, three tasks, five operations

Object detection, instance segmentation and semantic segmentation, through one API: predict, track, train, val and export. The DETR family moves fast — RT-DETR, D-FINE — and nitid brings the best DETR made easy, so getting from your dataset to an exported model does not mean following every paper.

What comes with it:

  • Python API and command line
  • Automatic download of the official COCO checkpoints for detection and instance segmentation; semantic segmentation is fine-tuned on your own masks
  • Fine-tuning and validation for boxes, masks and dense semantic maps
  • ByteTrack, BoT-SORT, and OC-SORT tracking with persistent IDs and annotated video output

What "open" means here

The nitid code is released under the Apache License 2.0. You can use it commercially, modify it, and ship it in closed products.

The official pretrained weights are published by their authors under Apache 2.0 as well: the detection checkpoints by D-FINE and the instance-segmentation checkpoints by D-FINE-seg. nitid downloads them from those sources on first use. The public datasets used for pretraining keep their own terms: the checkpoints listed in Verified models are trained on COCO and Objects365.

Installation

Requires Python 3.10, 3.11, 3.12 or 3.13.

pip install nitid

Inference and export work out of the box. Other features are optional extras:

Extra Adds
train Fine-tuning and COCO-style validation
track ByteTrack, BoT-SORT, and OC-SORT object tracking
openvino OpenVINO export and runtime for Intel CPU, iGPU, and NPU
wandb, mlflow Experiment tracking during training
pip install "nitid[train,track]"

pip installs the default PyTorch build for your platform. If you need a specific CUDA version, install PyTorch first following pytorch.org, then install nitid. TensorRT export has its own requirements; see docs/export.md.

Quick Start

The canonical quickstart lives in docs/quickstart.md; use the docs guide for the full walkthrough.

Inference

from nitid import NITID

model = NITID("nitid1s", task="detect")
results = model.predict("image.jpg", conf=0.5)
results[0].save("out.jpg")

# Export detections to Pandas DataFrame or crop bounding boxes
df = results[0].pandas()
results[0].crop(save_dir="crops/")
Input Detection
Skier, input image Skier, detections with nitid1m

Generated with:

nitid predict model=nitid1m task=detect source=docs/assets/demo/source/ski.jpg conf=0.5 save=true

Instance segmentation uses the same API and downloads the matching COCO mask checkpoint:

model = NITID("nitid1s", task="segment")
result = model.predict("image.jpg", conf=0.5)[0]
print(result.masks.data.shape)  # [N, H, W]
result.save("segmented.jpg")
Input Instance segmentation
Watchmaker's desk, input image Watchmaker's desk, masks with nitid1l

Generated with:

nitid predict model=nitid1l task=segment source=docs/assets/demo/source/watchmaker.jpg conf=0.3 save=true

Semantic segmentation returns one class ID per pixel. There are no pretrained semantic weights yet: NITID("nitid1s", task="semantic") is a starting point for fine-tuning, so predict with your fine-tuned checkpoint:

model = NITID("semantic_best.pth", task="semantic")
result = model.predict("image.jpg", return_probs=True)[0]
print(result.semantic.mask.shape)  # [H, W]
result.save_semantic("class_ids.png")

Training

metrics = model.train(
    data="configs/datasets/my_dataset.yml",
    epochs=50,
    batch=8,
)
print(f"mAP50: {metrics['mAP50']:.4f}, mAP50-95: {metrics['mAP50-95']:.4f}")

See fine-tuning for COCO, YOLO, and semantic-mask dataset formats.

Tracking

for result in model.track("video.mp4", conf=0.5, stream=True, save=True):
    if result.boxes.id is not None:
        track_ids = result.boxes.id

Tracking pedestrians with persistent IDs

nitid1s detection with ByteTrack and vid_stride=2 on a CC0 street video.

The annotated video is saved under runs/track/exp/. Tracking dependencies are optional; install them with pip install "nitid[track]".

Validation

metrics = model.val(
    data="configs/datasets/my_dataset.yml",
    project="runs/val",
    name="exp",
)
# saves validation plots to runs/val/exp by default

Export

model.export(format="openvino")
model.export(format="onnx")
model.export(format="torchscript")
model.export(format="tensorrt")
Deployment target Hardware Export format Extra install
OpenVINO Intel CPU, iGPU and NPU format="openvino" pip install "nitid[openvino]"
ONNX Any ONNX runtime (CPU, GPU) format="onnx" A runtime, e.g. pip install onnxruntime
PyTorch CPU, CUDA GPU .pth checkpoint None
TorchScript LibTorch (C++) format="torchscript" None
TensorRT NVIDIA GPU (Jetson, RTX, data center) format="tensorrt" tensorrt>=8.6 (see docs/export.md)

Capture Python API output, environment details, and failure tracebacks in one attachable log:

from nitid import NITID, bugreport

with bugreport("prediction") as report:
    model = NITID("nitid1s", task="detect")
    model.predict("image.jpg")

print(report.path)

Command Line Interface

nitid predict model=nitid1s task=detect source=image.jpg
nitid predict model=semantic_best.pth task=semantic source=image.jpg save=true
nitid track model=nitid1s source=video.mp4 conf=0.5 save=true
nitid train model=nitid1s task=detect data=my_dataset.yml epochs=50
nitid val model=nitid1s task=detect data=my_dataset.yml
nitid export model=nitid1s task=detect format=onnx
nitid predict model=nitid1s source=image.jpg --report
nitid bugreport

For the full guide:

Migrating from YOLO & Compatibility

If you are coming from a YOLO codebase, the quickstart has a side-by-side mapping of the API and the behaviour that differs: Coming from YOLO.

Verified models

💡 NITID("nitid1s", task=...) is the canonical constructor. The trailing size letter selects the model size, and nitid1 identifies the model generation (older model1* names and the d-fine-* alias still resolve to the same models). Supported tasks are detect, segment, and semantic.

Object Detection (task="detect")

Evaluated on COCO val2017 at 640x640 resolution.

Model Alias Architecture COCO mAP50-95 (vs YOLO11) SpeedT4 TRT10 FP16 (vs YOLO11) SpeedArc B390 OV FP16 Params FLOPs Config Official Checkpoint
nitid1n† D-FINE-N 42.8 (40.9) 2.12 ms (1.70 ms) — 4.0M 7B yml pth
nitid1s D-FINE-S 50.7 (48.6) 3.49 ms (2.50 ms) 5.22 ms 10.0M 25B yml pth
nitid1m D-FINE-M 55.1 (53.1) 5.62 ms (4.70 ms) 9.58 ms 19.0M 57B yml pth
nitid1l D-FINE-L 57.3 (55.0) 8.07 ms (6.20 ms) 12.14 ms 31.0M 91B yml pth
nitid1x D-FINE-X 59.3 (57.5) 12.89 ms (11.80 ms) 17.49 ms 62.0M 202B yml pth

Numbers in parentheses correspond to the equivalent YOLO11 model (YOLO11n/s/m/l/x) for quick reference.
SpeedT4 TRT10 FP16 comes from the D-FINE paper. SpeedArc B390 OV FP16 is our own measurement with the same method (how to reproduce it): integrated Arc B390 GPU of an Intel Core Ultra X7 358H, OpenVINO 2026.4.1, mean over 1000 COCO val2017 images. COCO mAP on this GPU is within 0.1 of the table. nitid1n was not measured.
Official checkpoints for nitid1s/m/l/x download automatically upon first use.
† nitid1n has no official detection weights, so NITID("nitid1n", task="detect") raises an error; the row shows the published D-FINE-N figures for reference only. To use it, pass the path to your own checkpoint, or use task="segment".

Instance Segmentation (task="segment")

Based on D-FINE-seg. Published in the official D-FINE-seg model repository. Official checkpoints download automatically upon first use.

Model Alias Architecture Backing Checkpoint Weights
nitid1n D-FINE-Seg-N dfine_seg_n_coco.pt Auto-download / Hugging Face
nitid1s D-FINE-Seg-S dfine_seg_s_coco.pt Auto-download / Hugging Face
nitid1m D-FINE-Seg-M dfine_seg_m_coco.pt Auto-download / Hugging Face
nitid1l D-FINE-Seg-L dfine_seg_l_coco.pt Auto-download / Hugging Face
nitid1x D-FINE-Seg-X dfine_seg_x_coco.pt Auto-download / Hugging Face

Semantic Segmentation (task="semantic")

There are no pretrained semantic checkpoints. NITID("nitid1s", task="semantic") starts from the instance-segmentation checkpoint of the same size and is meant for fine-tuning on your own masks.

Documentation

Doc Description
docs/quickstart.md Full quickstart
examples/ Notebooks (Colab) and runnable scripts
docs/fine_tuning.md Training, validation, AMP, EMA, dataset formats
docs/export.md OpenVINO, ONNX, TorchScript, and TensorRT export
docs/deployment.md Running exported models with ONNX Runtime, OpenVINO, LibTorch, Triton
docs/training_cuda_openvino.md End-to-end run on an NVIDIA GPU or an Intel machine with OpenVINO
docs/cli.md Command-line reference
docs/api_reference.md Full Python API reference
docs/troubleshooting.md FAQ and fixes for common install, model, Docker, CUDA, and CLI problems
docs/macos_docker_setup.md macOS / Apple Silicon development environment with Docker
docs/brand.md Brand: logo, palette, typography, and demo image sources

Development

Everything above is for using nitid. To work on nitid itself, use a source checkout and uv, which installs the exact dependency versions pinned in uv.lock — including CUDA 12.1 PyTorch wheels on Linux and Windows.

git clone https://github.com/Nitidio/nitid.git && cd nitid
uv sync --extra dev --extra train

Inside the checkout, run the CLI and tools through the project environment:

uv run nitid predict model=nitid1s task=detect source=image.jpg

# Unit tests (no GPU, no checkpoint needed)
uv run pytest tests/unit

# All tests (integration tests build a tiny checkpoint automatically)
uv run pytest

# Lint and format
uv run ruff check .
uv run ruff format --check .

# Type-check
uv run mypy dfine tools

Integration tests use a session-scoped fixture in tests/conftest.py that builds a small D-FINE-S model with random weights at test time — no download required.

  • docs/onboarding.md — start here if you're new to the codebase: architecture, conventions, gotchas
  • CONTRIBUTING.md — branch workflow, commit conventions, and the PR checklist

Docker Environment

For developers on macOS (Apple Silicon) or environments needing isolated Linux containers, a preconfigured Dockerfile and docker-compose.yml are provided:

docker compose run --rm nitid-dev

See macOS Docker Setup for the setup guide.

Acknowledgements & Citation

nitid contains code derived from D-FINE and D-FINE-seg, with smaller portions from RT-DETR, DETR and PaddleDetection. See THIRD_PARTY_NOTICES.md and the Apache 2.0 License.

If you use nitid in your research or product, please cite:

@software{nitid2026,
  title={nitid: Real-Time Open Source Computer Vision},
  author={{Vaelsys}},
  year={2026},
  url={https://github.com/Nitidio/nitid}
}

@article{peng2024dfine,
  title={D-FINE: Redefine Regression Task in DETRs as Fine-grained Distribution Refinement},
  author={Peng, Yansong and Shi, Hongtao and Li, Shiyu and Wang, Yan and Li, Hongbin and Liu, Guozheng and Li, Bing and Hu, Weiming},
  journal={arXiv preprint arXiv:2410.13842},
  year={2024}
}

@article{saakyan2026dfineseg,
  title={D-FINE-seg: Object Detection and Instance Segmentation Framework with multi-backend deployment},
  author={Saakyan, Argo and Solntsev, Dmitry},
  journal={arXiv preprint arXiv:2602.23043},
  year={2026}
}

Metadata

Release files for nitid 0.9.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nitid 0.9.5
File Size Uploaded Provenance Actions
nitid-0.9.5.tar.gz 167.8 kB With provenance Details for nitid-0.9.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for nitid 0.9.5
File Interpreter ABI Platform Actions
nitid-0.9.5-py3-none-any.whl Python 3 none any Details for nitid-0.9.5-py3-none-any.whl

Total release size: 348.9 kB

Release files / nitid-0.9.5.tar.gz

Download URL nitid-0.9.5.tar.gz
Size 167.8 kB
Tags Source
SHA-256 checksum
How to use checksums
64fde64372d4364a3e3393324e343d32c3c324d780aa6e3999bdc402ef604300
BLAKE2b-256 checksum
How to use checksums
e9c2fcb6f42009fdd30c2e378712164910d31285840a102a97720980bb34f88f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 17, 2026.

Transparency log

Release files / nitid-0.9.5-py3-none-any.whl

Download URL nitid-0.9.5-py3-none-any.whl
Size 181.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dd3235c558777a43f45ec46d3373ec11f704114d0a3f53f2cacaccb322e1f981
BLAKE2b-256 checksum
How to use checksums
7ab684c3f956ebe9afa510273a48a4d989321ef773301e32068299090185e316
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 17, 2026.

Transparency log

Security for nitid 0.9.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for nitid-0.9.5.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 17, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page