rbobjecttracking is based on an algorithm I invented called RBOT. it stands for ROI Based Object Tracking.
using rbobjecttracking, you can get around 50-70 FPS on a CPU
To use rbobjecttracking, first create your custom dataset using rbot.dataCollector.
from rbot.dataCollector import DataCollector # Import the DataCollector class
data_collector = DataCollector() # Create the DataCollector object
data_collector.collectData() # This will open a GUI window using customtkinter and opencv.
After filling in the text fields and collecting the image samples, train a small model using rbot.trainer.
from rbot.trainer import Trainer # Import the Trainer class
trainer = Trainer(dataset_path="<dataset name that you created>", img_size=(128, 128), model_path="<path you want to save your model>") # Create the Trainer object
trainer.train() # This will train and save the model to your specified model path
Training should usually take around 10seconds to a minute on your GPU depending on your dataset size, and image size.
After training, you can need to get the color mask of the object with rbot.colorExtractor.
from rbot.colorExtractor import ColorRangeSelector # import the ColorRangeSelector class
rangeSelector = ColorRangeSelector() # Create the class object
rangeSelector.select_color_range() # call the function to select your object's color range
This will open a GUI with the masked webcam, and some sliders. You need to adjust the sliders so that everything but your object turns black in the webcam view.
After selecting your object's color range, you can then start the object detection with rbot.rbot
from rbot.rbot import RBOT # Import the RBOT class
import cv2 # Import opencv for accessing the webcam
rbot = RBOT(hsvValues="<Your object's color range>", image_size=(128, 128), minimum_confidence=0.9) # Create the RBOT object
cap = cv2.VideoCapture(0) # Access the webcam
while True:
ret, frame = cap.read() # Get a frame from the webcam
processed_frame = rbot.track_object(frame=frame, color=(0, 255, 0), width=2) # Process the frame
cv2.imshow("processed frame", processed_frame) # Display the proccesed frame
if cv2.waitKey(1) & 0xFF == ord('q'):
break
cap.release()
cv2.destroyAllWindows()
Release files for rbobjecttracking 3.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| rbobjecttracking-3.2.0.tar.gz | 6.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| rbobjecttracking-3.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 15.3 kB
Release files / rbobjecttracking-3.2.0.tar.gz
| Download URL | rbobjecttracking-3.2.0.tar.gz |
|---|---|
| Size | 6.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1277a8f4dedfa61e55aa760a6240e56ecd2ce5d7edce95c4c7e7005dad677524
|
|
BLAKE2b-256 checksum How to use checksums |
f8c350a78b7fba742561fecef102e62be992bc5e7625d2fec6178f6456688ab0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.5
|
Release files / rbobjecttracking-3.2.0-py3-none-any.whl
| Download URL | rbobjecttracking-3.2.0-py3-none-any.whl |
|---|---|
| Size | 8.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4b5fc6d987eeef313d00f85d08da325dc869f9b82927a93ab460d3b979f189ef
|
|
BLAKE2b-256 checksum How to use checksums |
1fa5a86eacb5630ffbf9e0bb41bef07dc4109abdeec27e425b787ce05bf0eb38
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.5
|