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.1.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.1-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: rbobjecttracking-1.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 bcf1a11d829c79f01a7c54600f1c386e8447fe6389daaefc34253388b2d45d41
MD5 a62f8f11244b6cca54271a8ebf1fce33
BLAKE2b-256 b73103f0a18f65b380cabcdde0c8c63c753ad271d1f48df5b19d711fd4b3381f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rbobjecttracking-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a943afc7cf27821a8cd983660d6faf276595074f183b3c5278f891de002562a3
MD5 73025371cd931b39baf0c3d3732204cc
BLAKE2b-256 26e2326e3432bf1f8f0161a03e4b14f35ac75ef2ac7a9f680e031c804dea677c

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