pixano.app.routers.inference.mask_generation
¶
ImageMaskGenerationOutput(**data)
¶
Bases: BaseModel
Image mask generation output.
Source code in .venv/lib/python3.12/site-packages/pydantic/main.py
VideoMaskGenerationOutput(**data)
¶
Bases: BaseModel
Video masks generation output.
Source code in .venv/lib/python3.12/site-packages/pydantic/main.py
call_image_mask_generation(dataset_id, image, model, mask_table_name, settings, entity=None, bbox=None, points=None, labels=None, provider_name=None)
async
¶
Perform image mask generation on an image.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataset_id
|
Annotated[str, Body(embed=True)]
|
The ID of the dataset to use. |
required |
image
|
Annotated[ViewModel, Body(embed=True)]
|
The image to use for detection. |
required |
entity
|
Annotated[EntityModel | None, Body(embed=True)]
|
The entity to use for detection. |
None
|
model
|
Annotated[str, Body(embed=True)]
|
The name of the model to use. |
required |
mask_table_name
|
Annotated[str, Body(embed=True)]
|
The name of the table to use for masks in dataset. |
required |
settings
|
Annotated[Settings, Depends(get_settings)]
|
App settings. |
required |
bbox
|
Annotated[BBox | None, Body(embed=True)]
|
Input bounding box or None. |
None
|
points
|
Annotated[list[list[int]] | None, Body(embed=True)]
|
Input points or None. |
None
|
labels
|
Annotated[list[int] | None, Body(embed=True)]
|
Labels for input points, or None. |
None
|
provider_name
|
Annotated[str | None, Body(embed=True)]
|
Optional provider name to route the request to. |
None
|
Returns:
| Type | Description |
|---|---|
ImageMaskGenerationOutput
|
The generated mask. |
Source code in pixano/app/routers/inference/mask_generation.py
call_video_mask_generation(dataset_id, video, model, settings, bbox=None, points=None, labels=None, provider_name=None)
async
¶
Perform video mask generation on a video.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataset_id
|
Annotated[str, Body(embed=True)]
|
The ID of the dataset to use. |
required |
video
|
Annotated[list[ViewModel], Body(embed=True)]
|
The video as a list of SequenceFrame (or a subset). |
required |
model
|
Annotated[str, Body(embed=True)]
|
The name of the model to use. |
required |
settings
|
Annotated[Settings, Depends(get_settings)]
|
App settings. |
required |
bbox
|
Annotated[BBox | None, Body(embed=True)]
|
Input bounding box or None. |
None
|
points
|
Annotated[list[list[int]] | None, Body(embed=True)]
|
Input points or None. |
None
|
labels
|
Annotated[list[int] | None, Body(embed=True)]
|
Labels for input points, or None. |
None
|
provider_name
|
Annotated[str | None, Body(embed=True)]
|
Optional provider name to route the request to. |
None
|
Returns:
| Type | Description |
|---|---|
VideoMaskGenerationOutput
|
The generated masks. |