Skip to main content

rtdetr

Real-time object detection you can ship: PyTorch training, OpenVINO inference, 100% Apache-2.0 — code and pretrained weights alike.

detections on a street scene

Install

pip install rtdetr              # inference
pip install "rtdetr[train]"     # + training

Detect

from rtdetr import RTDETR

model = RTDETR("rtdetr-r18")          # COCO weights, downloaded on first use
r = model("bus.jpg", conf=0.5)[0]

r.boxes.xyxy, r.boxes.conf, r.boxes.cls   # plain numpy
r.names[int(r.boxes.cls[0])]              # "person"
r.plot(); r.save(); r.show()

Point it at an image, a folder, a glob, a video, an RTSP stream, a webcam index, or a numpy array. Long sources stream:

for r in model.predict(0, stream=True, show=True):   # webcam, q or Esc quits
    print(r.boxes.xyxyn)

model.track("clip.mp4")        # adds r.boxes.id

Train

model = RTDETR("rtdetr-r18")
model.train(data="data.yaml", epochs=100, imgsz=640, batch=8, device=0)
model.val(data="data.yaml").box.map50
model.export(format="openvino", half=True)     # IR + labels.txt
# data.yaml
path: /data/cans
train: images/train
val: images/val
names: {0: can, 1: bottle}

Command line

rtdetr predict model=rtdetr-r18 source=bus.jpg conf=0.5
rtdetr train   model=rtdetr-r18 data=data.yaml epochs=100
rtdetr val     model=best.pt data=data.yaml
rtdetr export  model=best.pt format=openvino half=true

A browser front end

platform/ is a small web app on top of this package — label images, queue training runs, watch the curve, run the result over a folder, a video or a webcam, and download the weights and the IR:

pip install -r platform/requirements.txt
python platform/run.py          # http://127.0.0.1:8080

the platform

Models

name params COCO AP notes
rtdetr-r18 20M 46.4 fastest
rtdetr-r34 31M 48.9
rtdetr-r50 43M 53.1 most accurate

Docs

  • Using the model — sources, results, tracking, saving
  • Platform — the browser app: labelling, jobs, artefacts
  • Training — datasets, validation, export, CLI
  • Weights — the mirror, building it, offline use
  • Performance — measured speeds and how to improve them
  • Design — architecture and provenance
  • Development — tests, releases

한국어

from rtdetr import RTDETR

model = RTDETR("rtdetr-r18")               # COCO 사전학습 가중치 자동 다운로드
model("bus.jpg", conf=0.5)[0].save()       # 결과 이미지 저장
model.train(data="data.yaml", epochs=100)  # 내 데이터로 학습
model.export(format="openvino", half=True) # 배포용 IR + labels.txt

가중치 캐시는 ~/.rtdetr/, 사내 미러는 RTDETR_ASSETS_URL 환경변수로 지정합니다.

License

Apache-2.0 — see LICENSE and NOTICE.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rtdetr-0.6.2.tar.gz (68.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rtdetr-0.6.2-py3-none-any.whl (53.3 kB view details)

Uploaded Python 3

File details

Details for the file rtdetr-0.6.2.tar.gz.

File metadata

  • Download URL: rtdetr-0.6.2.tar.gz
  • Upload date:
  • Size: 68.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for rtdetr-0.6.2.tar.gz
Algorithm Hash digest
SHA256 489b3bd8df2863f60064e44d9dc681b8dbefcc613f41ec29c64fc2405822f0cd
MD5 93651e3f373d58708dc62dc3ef533c52
BLAKE2b-256 1b558126c3ae4834de9fedc6ad1a9ebebdf44728b373f4411775d4ac72e2e126

See more details on using hashes here.

Provenance

The following attestation bundles were made for rtdetr-0.6.2.tar.gz:

Publisher: publish.yml on leeyunjai82/rtdetr

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rtdetr-0.6.2-py3-none-any.whl.

File metadata

  • Download URL: rtdetr-0.6.2-py3-none-any.whl
  • Upload date:
  • Size: 53.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for rtdetr-0.6.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b0b87885ae81956045406efb47950a27b03cfb3fd795e9ea9c9de448ef2808e9
MD5 4f62855fa2b0c55e6c77f7c6aa2a31ce
BLAKE2b-256 5afd7d1b2626e5a92f64fc80c2007ba9301ad86fa87bde1a8cd881cd96a78899

See more details on using hashes here.

Provenance

The following attestation bundles were made for rtdetr-0.6.2-py3-none-any.whl:

Publisher: publish.yml on leeyunjai82/rtdetr

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.6.2 This release

2 files

0.6.1

2 files

0.6.0

2 files

0.5.0

2 files

0.4.0

2 files

0.3.2

2 files

0.3.1

2 files

0.3.0

2 files

0.2.1

2 files

0.2.0

2 files

0.1.0

2 files

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