pixano_inference.models.tracking
Tracking model base class and I/O types.
TrackingBoxPrompt(**data)
Bases: BaseModel
Box prompt for a tracking keyframe.
Source code in pydantic/main.py
TrackingInput(**data)
Bases: BaseModel
Input for video mask generation / tracking.
Attributes:
| Name | Type | Description |
|---|---|---|
video |
list[str | Path | bytes] | str | Path | bytes
|
Path to the video, list of frame paths, or base64 encoded video/frames. |
points |
list[list[list[int]]] | None
|
Legacy point prompts [num_objects, num_points, 2]. |
labels |
list[list[int]] | None
|
Legacy labels for points [num_objects, num_points]. |
boxes |
list[list[int]] | None
|
Legacy box prompts [num_objects, 4]. |
propagate |
bool | None
|
Whether to propagate masks beyond the prompted frames. |
interval |
TrackingInterval | None
|
Optional propagation interval relative to the provided frame window. |
keyframes |
list[TrackingKeyframe] | None
|
Optional structured prompt payloads for each object. |
objects_ids |
list[int]
|
IDs of the objects to generate masks for. |
frame_indexes |
list[int]
|
Indexes of the prompted frames. |
Source code in pydantic/main.py
TrackingInterval(**data)
Bases: BaseModel
Optional propagation window relative to the provided video frames.
Source code in pydantic/main.py
TrackingKeyframe(**data)
Bases: BaseModel
Prompt payload for a single tracking keyframe.
Source code in pydantic/main.py
TrackingModel(config)
Bases: InferenceModel
Base class for video mask generation / tracking models.
Example
Source code in pixano_inference/models/base.py
predict(input)
abstractmethod
Run video mask generation / tracking.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input
|
TrackingInput
|
Tracking input with video, prompts, and object IDs. |
required |
Returns:
| Type | Description |
|---|---|
TrackingOutput
|
Tracking output with objects_ids, frame_indexes, and masks. |
Source code in pixano_inference/models/tracking.py
TrackingOutput(**data)
Bases: BaseModel
Output for video mask generation / tracking.
Attributes:
| Name | Type | Description |
|---|---|---|
objects_ids |
list[int]
|
IDs of the objects. |
frame_indexes |
list[int]
|
Indexes of the frames where the objects are located. |
masks |
list[CompressedRLE]
|
Masks for the objects. |
Source code in pydantic/main.py
TrackingPointPrompt(**data)
Bases: BaseModel
Point prompt for a tracking keyframe.