pixano.data.item.item_object
ItemBBox(**data)
Bases: BaseModel
BBox type for DatasetItem
Type for BBox.to_dict()
Attributes:
Name | Type | Description |
---|---|---|
coords |
list[float]
|
List of coordinates in given format |
format |
str
|
Coordinates format, 'xyxy' or 'xywh' |
is_normalized |
bool
|
True if coordinates are normalized to image size |
confidence |
float
|
Bounding box confidence if predicted |
Raises ValidationError
if the input data cannot be
validated to form a valid model.
self
is explicitly positional-only to allow self
as a field name.
Source code in pydantic/main.py
from_pyarrow(bbox)
staticmethod
to_pyarrow()
ItemObject(**data)
Bases: BaseModel
Object type for DatasetItem
Attributes:
Name | Type | Description |
---|---|---|
id |
str
|
Object ID |
original_id |
str
|
Object original ID |
item_id |
str
|
Object item ID |
view_id |
str
|
Object view ID |
source_id |
str
|
Object source ID |
review_state |
str
|
Object review state ("accepted", "rejected", None) |
bbox |
ItemBBox
|
Object bounding box |
mask |
ItemURLE
|
Object mask |
features |
dict[str, ItemFeature]
|
Object features |
Raises ValidationError
if the input data cannot be
validated to form a valid model.
self
is explicitly positional-only to allow self
as a field name.
Source code in pydantic/main.py
add_or_update(ds_table)
Add or update item object
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ds_table
|
LanceTable
|
Object table |
required |
Source code in pixano/data/item/item_object.py
from_pyarrow(table, schema, source_id)
staticmethod
Create dictionary of ItemObject from PyArrow Table
Parameters:
Name | Type | Description | Default |
---|---|---|---|
table
|
dict[str, Any]
|
PyArrow table |
required |
schema
|
schema
|
PyArrow schema |
required |
source_id
|
str
|
Objects source ID |
required |
Returns:
Type | Description |
---|---|
dict[str, ItemObject]
|
Dictionary of ItemObject |
Source code in pixano/data/item/item_object.py
to_pyarrow()
Return ItemObject in PyArrow format
Returns:
Type | Description |
---|---|
dict[str, Any]
|
Object in PyArrow format |
Source code in pixano/data/item/item_object.py
ItemURLE(**data)
Bases: BaseModel
Uncompressed URLE mask type for DatasetItem
Type for CompressedRLE.to_urle()
Attributes:
Name | Type | Description |
---|---|---|
size |
list[int]
|
Mask size |
counts |
list[int]
|
Mask URLE encoding |
Raises ValidationError
if the input data cannot be
validated to form a valid model.
self
is explicitly positional-only to allow self
as a field name.
Source code in pydantic/main.py
from_pyarrow(rle)
staticmethod
Create ItemURLE from compressed RLE
Parameters:
Name | Type | Description | Default |
---|---|---|---|
rle
|
CompressedRLE
|
Compressed RLE |
required |
Returns:
Type | Description |
---|---|
ItemURLE
|
ItemURLE |