Skip to main content

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 small
  • pretain : Path to custom checkpoint, defaults to COCO weights
  • use_seg : Segmentation model variation, defaults to False
  • show : Displayable output window, defaults to False
  • threshold : 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 small
  • pretain : Path to custom checkpoint, defaults to COCO weights
  • use_seg : Segmentation model variation, defaults to False
  • show : Displayable output window, defaults to False
  • threshold : 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


Download files

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

Source Distribution

retico_rfdetr-0.1.0.tar.gz (15.7 kB view details)

Uploaded Source

Built Distribution

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

retico_rfdetr-0.1.0-py3-none-any.whl (14.6 kB view details)

Uploaded Python 3

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

Hashes for retico_rfdetr-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9658c58e5077830c04a82d758f8ff6fa96c4384fe708df10d833331761c33fd1
MD5 de7600f148af9e36cf84901717c45cdb
BLAKE2b-256 ce69bf59b77ac8df81fce05121e6f5e2d23dd55dd02c5e5f0f996c67de938059

See more details on using hashes here.

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

Hashes for retico_rfdetr-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e0fbd17f17f4626a9b222169426b078fbf7f0da98fc187f293a3b6087263b29f
MD5 b9589d04c77bde805387a8443e17ae92
BLAKE2b-256 63d948919f498b03b17897718eb92a6dec393ce0aa146c9c04861fc82d73f9e9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page