Skip to main content

A python library for single-object tracking.

Project description

rbobjecttracking is based on an algorithm I invented called RBOT. it stands for ROI Based Object Tracking.

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>", batch_size=64, img_size=(128, 128), 
                  lr=<your chosen learning rate>, model_path="<path you want to save your model>") # Create the Trainer object
                  
trainer.train(epochs=<number of epochs you want to train for>) # This will train and save the model to your specified model path

After training, you can then start tracking the object with rbot.rbot.

from rbot.rbot import RBOT # Import the RBOT class
import cv2 # Import opencv for accessing the webcam

rbot = RBOT(hsvValues="blue", image_size=(256, 256), 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()

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

rbobjecttracking-1.1.2.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

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

rbobjecttracking-1.1.2-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

Details for the file rbobjecttracking-1.1.2.tar.gz.

File metadata

  • Download URL: rbobjecttracking-1.1.2.tar.gz
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for rbobjecttracking-1.1.2.tar.gz
Algorithm Hash digest
SHA256 d73035992448ee25881e2cae4b6ae460f51a67b36da3535e3870e307b718cc6d
MD5 ea05407e1e0fccf4deeaccc3ca43b74f
BLAKE2b-256 70c306510184f54ec49f10d2a23ef99f80dcb79762cf6b3320b5f6fe82676d9b

See more details on using hashes here.

File details

Details for the file rbobjecttracking-1.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for rbobjecttracking-1.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c2fb11db519324b8d1a40605e8885174dfa061128e612b15048147ce1056a86a
MD5 3dbc4346cc6ac451bb5e5b0a847bc84b
BLAKE2b-256 9a453ed09f4fabd63d3a4c043bca9b9749cdce7a4db9e34a26021aa0878922f4

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