PromptTrack
📄 Overview
PromptTracker is a powerful object tracking tool that enables the detection and tracking of objects in videos using text-based prompts. It supports advanced object detection models such as MDETR and OWL-VITV2, providing robust tracking with options to handle fixed populations in enclosed environments.
📥 Installation
To install PromptTracker, use the following command:
pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ PromptTrack (version test)
pip install --no-deps bytetracker
The package has been implemented for python from 3.9 to earlier (last version currently 3.12)
You can check our github repo
Usage
Step 1 initialization
from PromptTrack import PromptTracker
#initialize PromptTrack
tracker = PromptTracker()
Step 2: Object Detection
Detect objects in a video using a text prompt:
Parameters:
-
video_file (str): Path to the input video file.
-
prompt (str): Comma-separated names of entities to track (e.g., "pig,bird").
-
nms_threshold (float): Non-Maximum Suppression threshold for filtering overlapping detections.
-
detection_threshold (float): Confidence threshold for reporting detections.
-
detector (str): Detection model to use ("MDETR" or "OWL-VITV2").
tracker.detect_objects(video_file, prompt="penguin",nms_threshold=0.8, detection_threshold=0.3 ,detector="OWL-VITV2")
Step 3: Tracking Objects
Process the video using a Multiple Object Tracker (MOT):
Parameters:
-
video_file (str): Path to the input video file.
-
fixed_parc (bool, default=True): Set to True if the number of tracked objects remains constant.
-
track_thresh (float, default=0.40): Detection confidence threshold for the tracker.
-
match_thresh (float, default=1.0): Matching threshold between new detections and existing tracks (1 to match all, 0 to match none).
-
frame_rate (int, default=6): Frame rate of the video.
-
max_time_lost (float, default=inf): Maximum time an object can be missing before being removed.
-
nbr_frames_fixing (int, default=300): Number of frames considered for tracking in a fixed setting.
tracker.process_mot (video_file, fixed_parc=True,track_thresh=0.40, match_thresh=0.8, frame_rate=25,max_time_lost=float('inf'),nbr_frames_fixing=800)
Step 4: Read Processed Video
To visualize the tracked objects in the processed video:
Parameters:
-
video_file (str): Path to the input video file.
-
fps (int, default=20): Frames per second for video playback.
tracker.read_video_with_mot(video_file,fps=20)
Full example usage
tracker = PromptTracker()
video_file = "[path_to_your_video]"
tracker.detect_objects(video_file, prompt="penguin", nms_threshold=0.8, detection_threshold=0.3, detector="OWL-VITV2")
tracker.process_mot(video_file, fixed_parc=True, track_thresh=0.40, match_thresh=1, frame_rate=25, max_time_lost=float('inf'), nbr_frames_fixing=800)
tracker.read_video_with_mot(video_file, fps=20)
Examples (on our github)
Metadata
Release files for PromptTrack 1.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| prompttrack-1.0.2.tar.gz | 22.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| PromptTrack-1.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 45.6 kB
Release files / prompttrack-1.0.2.tar.gz
| Download URL | prompttrack-1.0.2.tar.gz |
|---|---|
| Size | 22.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
65b474bcf20b178b515fc8d3afa987ee1287e73ca9d92756af5f476896d201d2
|
|
BLAKE2b-256 checksum How to use checksums |
6622d8802bc86c4ce871b9de0c01abcdb0d6c6f669fa8ee38179cb291ef96116
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.11
|
Release files / PromptTrack-1.0.2-py3-none-any.whl
| Download URL | PromptTrack-1.0.2-py3-none-any.whl |
|---|---|
| Size | 23.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8434cad2e63db648f2a733d537ff01ae567ef3e37b44e2768b25d882a011c584
|
|
BLAKE2b-256 checksum How to use checksums |
1d29f15b8eabc846d80c24516bd638c3419de7502c676b840491411a333ab371
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.11
|