pixano.features.schemas.source
Source(created_at=None, updated_at=None, **data)
Bases: BaseSchema
Source of the annotation.
Attributes:
Name | Type | Description |
---|---|---|
name |
str
|
Name of the source. |
kind |
str
|
Kind of source. |
metadata |
str
|
Metadata of the source. dict[str, Any] encoded in a string. |
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.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
created_at
|
datetime | None
|
The creation date of the object. |
None
|
updated_at
|
datetime | None
|
The last modification date of the object. |
None
|
data
|
Any
|
The data of the object validated by Pydantic. |
{}
|
Source code in pixano/features/schemas/base_schema.py
create_ground_truth(metadata={})
classmethod
Create a ground truth source.
Source code in pixano/features/schemas/source.py
SourceKind
Bases: Enum
Kind of source that produced the annotation.
Attributes:
Name | Type | Description |
---|---|---|
MODEL |
Source produced by a model. |
|
HUMAN |
Source produced by a human. |
|
GROUND_TRUTH |
The source is a ground truth. |
|
OTHER |
Source produced by other means. |
create_source(id, name, kind, metadata)
Create a Source
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
id
|
str
|
Identifier of the source. |
required |
name
|
str
|
Name of the source. |
required |
kind
|
Literal['model', 'human', 'ground_truth', 'other'] | SourceKind
|
Kind of source. |
required |
metadata
|
str | dict[str, Any]
|
Metadata of the source. |
required |
Returns:
Type | Description |
---|---|
Source
|
The created |