pixano.features.schemas.annotations.classification
Classification(created_at=None, updated_at=None, **data)
Bases: Annotation
Classification at the media level (Image or Text).
Attributes:
Name | Type | Description |
---|---|---|
labels |
list[str]
|
List of class names. |
confidences |
list[float]
|
List of prediction confidences. |
Source code in pixano/features/schemas/base_schema.py
predictions
property
Get list of zipped predictions (labels and confidences).
none()
classmethod
Utility function to get a None
equivalent.
Should be removed as soon as Lance manages None
value.
Returns:
Type | Description |
---|---|
Classification
|
"None" Classification. |
Source code in pixano/features/schemas/annotations/classification.py
create_classification(labels, confidences, id='', item_ref=ItemRef.none(), view_ref=ViewRef.none(), entity_ref=EntityRef.none(), source_ref=SourceRef.none())
Create a Classification
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
labels
|
list[str]
|
List of class names. |
required |
confidences
|
list[float]
|
List of prediction confidences. |
required |
id
|
str
|
|
''
|
item_ref
|
ItemRef
|
Item reference. |
none()
|
view_ref
|
ViewRef
|
View reference. |
none()
|
entity_ref
|
EntityRef
|
Entity reference. |
none()
|
source_ref
|
SourceRef
|
Source reference. |
none()
|
Returns:
Type | Description |
---|---|
Classification
|
The created |
Source code in pixano/features/schemas/annotations/classification.py
is_classification(cls, strict=False)
Check if a class is a Classification
or subclass of Classification
.