Skip to main content

Demo library

Project description

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)

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

prompttrack-1.0.2.tar.gz (22.6 kB view details)

Uploaded Source

Built Distribution

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

PromptTrack-1.0.2-py3-none-any.whl (23.0 kB view details)

Uploaded Python 3

File details

Details for the file prompttrack-1.0.2.tar.gz.

File metadata

  • Download URL: prompttrack-1.0.2.tar.gz
  • Upload date:
  • Size: 22.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.11

File hashes

Hashes for prompttrack-1.0.2.tar.gz
Algorithm Hash digest
SHA256 65b474bcf20b178b515fc8d3afa987ee1287e73ca9d92756af5f476896d201d2
MD5 38340395ef426b5cdb92a88299108457
BLAKE2b-256 6622d8802bc86c4ce871b9de0c01abcdb0d6c6f669fa8ee38179cb291ef96116

See more details on using hashes here.

File details

Details for the file PromptTrack-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: PromptTrack-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 23.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.11

File hashes

Hashes for PromptTrack-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8434cad2e63db648f2a733d537ff01ae567ef3e37b44e2768b25d882a011c584
MD5 2a9920d2133f1123749bf4f7bae45ce2
BLAKE2b-256 1d29f15b8eabc846d80c24516bd638c3419de7502c676b840491411a333ab371

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