pixano_inference.schemas.segmentation
Segmentation I/O types.
SegmentationInput(**data)
Bases: _BaseModel
Input for image segmentation.
Attributes:
| Name | Type | Description |
|---|---|---|
image |
str | Path | bytes
|
Image for segmentation (path, URL, or base64). |
image_embedding |
NDArrayFloat | None
|
Pre-computed image embedding. |
high_resolution_features |
list[NDArrayFloat] | None
|
High resolution features. |
mask_input |
NDArrayFloat | None
|
Low-resolution mask logits from a previous refinement round. |
reset_predictor |
bool
|
True (default) for a new image. If False, keep current predictor. |
points |
list[list[list[int]]] | None
|
Point prompts [num_prompts, num_points, 2]. |
labels |
list[list[int]] | None
|
Labels for points [num_prompts, num_points]. |
boxes |
list[list[int]] | None
|
Box prompts [num_prompts, 4]. |
num_multimask_outputs |
int
|
Number of masks to generate per prediction. |
multimask_output |
bool
|
Whether to generate multiple masks per prediction. |
return_image_embedding |
bool
|
Whether to return the image embeddings. |
return_logits |
bool
|
Whether to return low-resolution logits for iterative refinement. |
Source code in pydantic/main.py
SegmentationOutput(**data)
Bases: _BaseModel
Output for image segmentation.
Attributes:
| Name | Type | Description |
|---|---|---|
masks |
list[list[CompressedRLE]]
|
Generated masks [num_predictions, num_masks_per_prediction]. |
scores |
NDArrayFloat
|
Scores of the masks. |
image_embedding |
NDArrayFloat | None
|
Image embeddings (optional). |
high_resolution_features |
list[NDArrayFloat] | None
|
High resolution features (optional). |
mask_logits |
NDArrayFloat | None
|
Low-resolution logits for iterative refinement (optional). |