YOLO-like API for RF-DETR real-time object detection
Project description
easy-rfdetr
Train a Model
from easy_rfdetr import RFDETR
model = RFDETR("medium")
model.train(data="my_dataset/", epochs=50)
Run Inference
model("image.jpg").show()
Install
pip install easy-rfdetr
Drop-in replacement for YOLO() from ultralytics. Same API, transformer accuracy.
Training
Drop your dataset in a folder. We auto-detect COCO or YOLO format:
dataset/
├── train/images/ + labels/
├── valid/images/ + labels/
└── test/images/ + labels/
Train:
model.train(data="dataset/", epochs=50, batch=8)
Resume:
model.train(data="dataset/", resume=True)
Inference
model = RFDETR("medium") # nano, small, medium, large
# From file
model("photo.jpg").show()
# From URL
model("https://example.com/img.jpg")
# Batch
model(["a.jpg", "b.jpg"])
# Confidence threshold
model("img.jpg", threshold=0.8)
# Get boxes
r = model("img.jpg")
print(r.boxes) # xyxy
print(r.scores) # confidence
print(r.labels) # ["person", "car", ...]
# Save
r.save("output.jpg")
Web UI
model.ui()
CLI
rfdetr predict source=image.jpg
rfdetr train data=dataset/ epochs=50
Requirements
- Python >= 3.10
- PyTorch >= 2.0.0
- CUDA or Apple Silicon (optional)
License
Apache 2.0 - See LICENSE
Built on RF-DETR by Roboflow.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file easy_rfdetr-0.1.0-py3-none-any.whl.
File metadata
- Download URL: easy_rfdetr-0.1.0-py3-none-any.whl
- Upload date:
- Size: 15.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/1.0.0 requests/2.32.5 rfc3986/1.5.0 tqdm/4.67.3 urllib3/2.6.3 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7e97f24028dfdb423606c7a66487380119e47b6f825a9d1eca8c275a8ba739e9
|
|
| MD5 |
d1ea975fd844236d38336510b42a8a4a
|
|
| BLAKE2b-256 |
7d3392a300b2643da2fa942228649665d331444fb0f8323c85672f3a083f6d67
|