tool¶
sam3 tracking tool.
Classes
- class Sam3TrackingTool(device='cpu', model_path='facebook/sam3', api_token=None, max_num_objects=None, overwrite=False, verbose=True)[source]¶
Bases:
TrackingTool- Parameters:
device (str)
model_path (str)
api_token (str)
max_num_objects (int | None)
overwrite (bool)
verbose (bool | int)
- infer(video_path, mask_dir, text_prompt='people', chunk_size=300, iou_threshold=0.3)[source]¶
Perform text-based segmentation and tracking from a video file.
- Parameters:
video_path (
Union[str,Path]) – Path to the input video.mask_dir (
Union[str,Path]) – Path to the output mask directory.text_prompt (
str) – Text description of objects to track.chunk_size (
int) – Number of frames to process at once.iou_threshold (
float) – IoU threshold for stitching chunks together.