pixano.inference.provider
Abstract inference provider interface. This module defines the abstract interface that all inference providers must implement. Pixano uses this interface to communicate with different backends (pixano-inference, OpenAI, Gemini, local models, etc.) in a uniform way. Only discovery methods are abstract; each task method defaults to raising `TaskNotSupportedError`, so a provider implements only what its backend supports.
Classes
InferenceProvider
(ABC)Attributes
| Name | Type | Default | Description |
|---|---|---|---|
name | str | — | Provider name (e.g., 'pixano-inference', 'openai', 'gemini'). |
Methods
cancel_video_mask_generation_job
(job_id, timeout)
→ VideoMaskGenerationJobStatus Cancel an asynchronous video mask generation job.
| Parameter | Type | Default |
|---|---|---|
job_id | str | — |
timeout | float | 30.0 |
close
()
→ None Release any resources held by the provider (e.g. HTTP connections).
detection
(input_data, timeout)
→ DetectionResult Detect objects in an image using zero-shot detection.
| Parameter | Type | Default |
|---|---|---|
input_data | DetectionInput | — |
timeout | float | 60.0 |
embedding
(input_data, timeout)
→ EmbeddingResult Embed an image or text into a shared vector space (CLIP-style).
| Parameter | Type | Default |
|---|---|---|
input_data | EmbeddingInput | — |
timeout | float | 60.0 |
get_server_info
()
→ ServerInfo Get server information (version, models, models_to_task).
get_video_mask_generation_job
(job_id, timeout)
→ VideoMaskGenerationJobStatus Fetch the current status of an asynchronous video mask generation job.
| Parameter | Type | Default |
|---|---|---|
job_id | str | — |
timeout | float | 30.0 |
image_mask_generation
(input_data, timeout)
→ ImageMaskGenerationResult Generate masks for an image.
| Parameter | Type | Default |
|---|---|---|
input_data | ImageMaskGenerationInput | — |
timeout | float | 60.0 |
list_models
(task)
→ list[ModelInfo] List available models, optionally filtered by task.
| Parameter | Type | Default |
|---|---|---|
task | InferenceTask | None | None |
submit_video_mask_generation_job
(input_data, timeout)
→ VideoMaskGenerationJobStatus Submit an asynchronous video mask generation job.
| Parameter | Type | Default |
|---|---|---|
input_data | VideoMaskGenerationInput | — |
timeout | float | 30.0 |
video_mask_generation
(input_data, timeout)
→ VideoMaskGenerationResult Generate masks for video frames (synchronous).
| Parameter | Type | Default |
|---|---|---|
input_data | VideoMaskGenerationInput | — |
timeout | float | 120.0 |
vlm
(input_data, timeout)
→ VLMResult Generate text conditioned on images.
| Parameter | Type | Default |
|---|---|---|
input_data | VLMInput | — |
timeout | float | 60.0 |