A Retico module for Roboflow's Detection Transformer.
Project description
Retico Roboflow Detection Transformer Module
A ReTico module for RfDeTr that works with Roboflow's detection models. The webcam captures the user information, which passes through the model and outputs the name of the detectable object. The model contains two different types of constructors, one using the original RfDeTr and another using the new Hugging Face model. The native RfDeTr is recommended due to its reliability compared to the current Hugging Face model.
Installation and requirements
- Install retico_core:
pip install git+https://github.com/retico-team/retico-core.git - Install the retico-rfdetr:
pip install retico-rfdetr
Modules
RFDETRModule (Native RF-DETR)
Uses Roboflow's rfdetr package. Recommended for real-time webcam use.
Model options: nano, small, medium, large
Segmentation model options: nano, small, medium, large
Arguments:
model: Model size to use, defaults to smallpretain: Path to custom checkpoint, defaults to COCO weightsuse_seg: Segmentation model variation, defaults to Falseshow: Displayable output window, defaults to Falsethreshold: Confidence threshold, default to 0.25
HFRFDETRModule (HuggingFace RF-DETR)
Uses HuggingFace transformers to load RF-DETR models from the Roboflow HuggingFace.
Detection model options: medium, large
Segmentation model options: medium, large
Arguments:
model: Model size to use, defaults to smallpretain: Path to custom checkpoint, defaults to COCO weightsuse_seg: Segmentation model variation, defaults to Falseshow: Displayable output window, defaults to Falsethreshold: Confidence threshold, default to 0.25
Example
Utilizing the original RfDeTr model
import os, sys
os.environ["PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION"] = "python"
prefix = "/path/to/prefix/"
sys.path.append(prefix + "retico-core")
sys.path.append(prefix + "retico-vision")
sys.path.append(prefix + "retico-rfdetr")
from retico_core import *
from retico_core.debug import DebugModule
from retico_vision.vision import WebcamModule
from retico_rfdetr.rfdetr import RFDETRModule
rfdetr = RFDETRModule(model="large", pretrain=None, use_seg=True, show=True)
webcam = WebcamModule()
debug = DebugModule(print_payload_only=True)
webcam.subscribe(rfdetr)
rfdetr.subscribe(debug)
print(f"RFDETR Model running")
webcam.run()
rfdetr.run()
debug.run()
input()
webcam.stop()
rfdetr.stop()
debug.stop()
Utilizing the Hugging Face RfDeTr model
import os, sys
os.environ["PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION"] = "python"
prefix = "/path/to/prefix/"
sys.path.append(prefix + "retico-core")
sys.path.append(prefix + "retico-vision")
sys.path.append(prefix + "retico-rfdetr")
from retico_core import *
from retico_core.debug import DebugModule
from retico_vision.vision import WebcamModule
from retico_rfdetr.hfrfdetr import HFRFDETRModule
rfdetr = HFRFDETRModule(model="large", use_seg=True, show=True)
webcam = WebcamModule()
debug = DebugModule(print_payload_only=True)
webcam.subscribe(rfdetr)
rfdetr.subscribe(debug)
print(f"RFDETR Model running")
webcam.run()
rfdetr.run()
debug.run()
input()
webcam.stop()
rfdetr.stop()
debug.stop()
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 Distribution
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 retico_rfdetr-0.1.0.tar.gz.
File metadata
- Download URL: retico_rfdetr-0.1.0.tar.gz
- Upload date:
- Size: 15.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9658c58e5077830c04a82d758f8ff6fa96c4384fe708df10d833331761c33fd1
|
|
| MD5 |
de7600f148af9e36cf84901717c45cdb
|
|
| BLAKE2b-256 |
ce69bf59b77ac8df81fce05121e6f5e2d23dd55dd02c5e5f0f996c67de938059
|
File details
Details for the file retico_rfdetr-0.1.0-py3-none-any.whl.
File metadata
- Download URL: retico_rfdetr-0.1.0-py3-none-any.whl
- Upload date:
- Size: 14.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e0fbd17f17f4626a9b222169426b078fbf7f0da98fc187f293a3b6087263b29f
|
|
| MD5 |
b9589d04c77bde805387a8443e17ae92
|
|
| BLAKE2b-256 |
63d948919f498b03b17897718eb92a6dec393ce0aa146c9c04861fc82d73f9e9
|