fiftyone.core.annotation.utils#
Annotation utils
Functions:
|
Ensure a |
Gets the supported App annotation fields for a |
|
|
Lists all valid annotation fields for a |
|
Flattens embedded document fields into dot-separated paths. |
|
Get the |
- fiftyone.core.annotation.utils.ensure_collection_is_supported(sample_collection)#
Ensure a
fiftyone.core.collections.SampleCollectionis supported by the App for annotation.- Args:
- sample_collection: a
- fiftyone.core.annotation.utils.get_supported_app_annotation_fields(sample_collection)#
Gets the supported App annotation fields for a
fiftyone.core.collections.SampleCollection.Currently supported media types for the collection are
imageand3d. Seefiftyone.core.collections.SampleCollection.media_typeAll supported primitive and
embedded.documentprimitives are supported as documented ingenerate_label_schemas()The below
fiftyone.core.labels.Labeltypes are also resolved.- Supported
imagefiftyone.core.labels.Labeltypes are: classification:fiftyone.core.labels.Classificationclassifications:fiftyone.core.labels.Classificationsdetection:fiftyone.core.labels.Detectiondetections:fiftyone.core.labels.Detections
- Supported
3dlabel types are: classification:fiftyone.core.labels.Classificationclassifications:fiftyone.core.labels.Classificationspolyline:fiftyone.core.labels.Polylinepolylines:fiftyone.core.labels.Polylines
- Parameters:
sample_collection โ a
fiftyone.core.collections.SampleCollection- Returns:
a list of supported fields
- Supported
- fiftyone.core.annotation.utils.list_valid_annotation_fields(sample_collection, require_app_support=False, flatten=False)#
Lists all valid annotation fields for a
fiftyone.core.collections.SampleCollection.A field may be valid, but not yet supported by the App for human annotation.
- Parameters:
sample_collection โ a
fiftyone.core.collections.SampleCollectionrequire_app_support (False) โ whether to only include fields supported by the App for annotation
flatten (False) โ whether to flatten embedded documents with
dot.notation
- Returns:
a sorted list of valid annotation field names
- fiftyone.core.annotation.utils.flatten_fields(collection, fields, require_app_support=False)#
Flattens embedded document fields into dot-separated paths.
- Parameters:
collection โ the sample collection
fields โ iterable of field names to flatten
require_app_support (False) โ whether to only include fields supported by the App for annotation
- Returns:
sorted list of flattened field names
- fiftyone.core.annotation.utils.get_type(field)#
Get the
typeof a field for a label schema- Parameters:
field โ the field instance
- Returns:
a label schema
type