Skip to content

pixano_inference.models.tracking

Tracking model base class.

The I/O and prompt types are the wire contract and live in :mod:pixano_inference_client.tracking; they are re-exported here so from pixano_inference.models.tracking import TrackingInput (and the prompt types) keep working.

TrackingModel(config)

Bases: InferenceModel

Base class for video mask generation / tracking models.

Example
@register_model("my-tracker")
class MyTracker(TrackingModel):
    def load_model(self):
        self.model = load_weights(self.config.model_params["path"])

    def predict(self, input: TrackingInput) -> TrackingOutput:
        ...
        return TrackingOutput(objects_ids=..., frame_indexes=..., masks=...)
Source code in pixano_inference/models/base.py
def __init__(self, config: ModelDeploymentConfig) -> None:
    """Initialize the model with deployment config.

    Args:
        config: Model deployment configuration.
    """
    self._config = config

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
@abstractmethod
def predict(self, input: TrackingInput) -> TrackingOutput:
    """Run video mask generation / tracking.

    Args:
        input: Tracking input with video, prompts, and object IDs.

    Returns:
        Tracking output with objects_ids, frame_indexes, and masks.
    """