fiftyone.core.fields#
Dataset sample fields.
Functions:
|
Validates the given field constraints. |
|
Determines whether the field matches the given constraints. |
|
Validates that the field matches the given constraints. |
|
Returns a dict of editable metadata for the given field. |
|
Filters the schema according to the given constraints. |
|
Returns a flat version of the given schema where all embedded document fields are included as top-level keys. |
|
Determines whether the provided mask targets use integer keys. |
|
Determines whether the provided target is an integer. |
|
Determines whether the provided mask targets use RGB hex string keys. |
|
Determines whether the provided target is an RGB string. |
|
Converts a hex string like "#ff6d04" to a hex integer. |
|
Converts an RRGGBB integer value to hex string like "#ff6d04". |
|
Converts an RGB mask array to a 2D hex integer mask array. |
|
Converts a 2D hex integer mask array to an RGB mask array. |
Classes:
|
A generic field. |
|
A 32 bit integer field. |
|
An Object ID field. |
|
A UUID field. |
|
A boolean field. |
|
A date field. |
|
A datetime field. |
|
A floating point number field. |
|
A unicode string field. |
|
A string field that holds a hex color string like '#FF6D04'. |
|
A list field that wraps a standard |
|
A |
|
A dictionary field that wraps a standard Python dictionary. |
|
A list of |
|
A list of lists of |
|
A GeoJSON field storing a longitude and latitude coordinate point. |
|
A GeoJSON field storing a line of longitude and latitude coordinates. |
|
A GeoJSON field storing a polygon of longitude and latitude coordinates. |
|
A GeoJSON field storing a list of points. |
|
A GeoJSON field storing a list of lines. |
|
A GeoJSON field storing a list of polygons. |
|
A one-dimensional array field. |
|
An n-dimensional array field. |
|
A video frame number field. |
|
A |
|
A |
|
A |
|
A field that stores instances of a given type of |
|
A field that stores a list of a given type of |
|
A reference field. |
- fiftyone.core.fields.validate_constraints(ftype=None, embedded_doc_type=None, subfield=None, read_only=None, info_keys=None, created_after=None)#
Validates the given field constraints.
- Parameters:
ftype (None) – an optional field type or iterable of types to enforce. Must be subclass(es) of
Field
embedded_doc_type (None) – an optional embedded document type or iterable of types to enforce. Must be subclass(es) of
fiftyone.core.odm.BaseEmbeddedDocument
subfield (None) – an optional subfield type or iterable of subfield types to enforce. Must be subclass(es) of
Field
read_only (None) – whether to optionally enforce that the field is read-only (True) or not read-only (False)
info_keys (None) – an optional key or list of keys that must be in the field’s
info
dictcreated_after (None) – an optional
datetime
specifying a minimum creation date
- Returns:
True/False whether any constraints were provided
- Raises:
ValueError – if the constraints are not valid
- fiftyone.core.fields.matches_constraints(field, ftype=None, embedded_doc_type=None, subfield=None, read_only=None, info_keys=None, created_after=None)#
Determines whether the field matches the given constraints.
- Parameters:
field – a
Field
ftype (None) – an optional field type or iterable of types to enforce. Must be subclass(es) of
Field
embedded_doc_type (None) – an optional embedded document type or iterable of types to enforce. Must be subclass(es) of
fiftyone.core.odm.BaseEmbeddedDocument
subfield (None) – an optional subfield type or iterable of subfield types to enforce. Must be subclass(es) of
Field
read_only (None) – whether to optionally enforce that the field is read-only (True) or not read-only (False)
info_keys (None) – an optional key or list of keys that must be in the field’s
info
dictcreated_after (None) – an optional
datetime
specifying a minimum creation date
- Returns:
True/False
- fiftyone.core.fields.validate_field(field, path=None, ftype=None, embedded_doc_type=None, subfield=None, read_only=None)#
Validates that the field matches the given constraints.
- Parameters:
field – a
Field
path (None) – the field or
embedded.field.name
. Only used to generate more informative error messagesftype (None) – an optional field type or iterable of types to enforce. Must be subclass(es) of
Field
embedded_doc_type (None) – an optional embedded document type or iterable of types to enforce. Must be subclass(es) of
fiftyone.core.odm.BaseEmbeddedDocument
subfield (None) – an optional subfield type or iterable of subfield types to enforce. Must be subclass(es) of
Field
read_only (None) – whether to optionally enforce that the field is read-only (True) or not read-only (False)
- Raises:
ValueError – if the constraints are not valid
- fiftyone.core.fields.get_field_metadata(field)#
Returns a dict of editable metadata for the given field.
- Parameters:
field – a
Field
- Returns:
a dict of field metadata
- fiftyone.core.fields.filter_schema(schema, ftype=None, embedded_doc_type=None, subfield=None, read_only=None, info_keys=None, created_after=None, include_private=False, flat=False, unwind=True, mode=None)#
Filters the schema according to the given constraints.
- Parameters:
schema – a dict mapping field names to
Field
instancesftype (None) – an optional field type or iterable of types to which to restrict the returned schema. Must be subclass(es) of
Field
embedded_doc_type (None) – an optional embedded document type or iterable of types to which to restrict the returned schema. Must be subclass(es) of
fiftyone.core.odm.BaseEmbeddedDocument
subfield (None) – an optional subfield type or iterable of subfield types to which to restrict the returned schema. Must be subclass(es) of
Field
read_only (None) – whether to restrict to (True) or exclude (False) read-only fields. By default, all fields are included
info_keys (None) – an optional key or list of keys that must be in the field’s
info
dictcreated_after (None) – an optional
datetime
specifying a minimum creation dateinclude_private (False) – whether to include fields that start with
_
in the returned schemaflat (False) – whether to return a flattened schema where all embedded document fields are included as top-level keys
unwind (True) – whether to traverse into list fields. Only applicable when
flat=True
mode (None) – whether to apply the above constraints before and/or after flattening the schema. Only applicable when
flat=True
. Supported values are("before", "after", "both")
. The default is"after"
- Returns:
a dict mapping field names to
Field
instances
- fiftyone.core.fields.flatten_schema(schema, ftype=None, embedded_doc_type=None, subfield=None, unwind=True, read_only=None, info_keys=None, created_after=None, include_private=False)#
Returns a flat version of the given schema where all embedded document fields are included as top-level keys.
- Parameters:
schema – a dict mapping field names to
Field
instancesftype (None) – an optional field type or iterable of types to which to restrict the returned schema. Must be subclass(es) of
Field
embedded_doc_type (None) – an optional embedded document type or iterable of types to which to restrict the returned schema. Must be subclass(es) of
fiftyone.core.odm.BaseEmbeddedDocument
subfield (None) – an optional subfield type or iterable of subfield types to which to restrict the returned schema. Must be subclass(es) of
Field
unwind (True) – whether to traverse into list fields
read_only (None) – whether to restrict to (True) or exclude (False) read-only fields. By default, all fields are included
info_keys (None) – an optional key or list of keys that must be in the field’s
info
dictcreated_after (None) – an optional
datetime
specifying a minimum creation dateinclude_private (False) – whether to include fields that start with
_
in the returned schema
- Returns:
a dict mapping flattened paths to
Field
instances
- class fiftyone.core.fields.Field(description=None, info=None, read_only=False, created_at=None, **kwargs)#
Bases:
BaseField
A generic field.
- Parameters:
description (None) – an optional description
info (None) – an optional info dict
read_only (False) – whether the field is read-only
created_at (None) – the datetime the field was created
Attributes:
The fully-qualified path of this field in the dataset's schema, or
None
if the field is not associated with a dataset.A user-editable description of the field.
A user-editable dictionary of information about the field.
Whether the field is read-only.
The datetime the field was created.
Methods:
copy
()Returns a copy of the field.
save
([_enforce_read_only])Saves any edits to this field's
description
andinfo
attributes.error
([message, errors, field_name])Raise a ValidationError.
prepare_query_value
(op, value)Prepare a value that is being used in a query for PyMongo.
set_auto_dereferencing
(value)to_mongo
(value)Convert a Python type to a MongoDB-compatible type.
to_python
(value)Convert a MongoDB-compatible type to a Python type.
validate
(value[, clean])Perform validation on a value.
- property path#
The fully-qualified path of this field in the dataset’s schema, or
None
if the field is not associated with a dataset.
- property description#
A user-editable description of the field.
Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") dataset.add_dynamic_sample_fields() field = dataset.get_field("ground_truth") field.description = "Ground truth annotations" field.save() field = dataset.get_field("ground_truth.detections.area") field.description = "Area of the box, in pixels^2" field.save() dataset.reload() field = dataset.get_field("ground_truth") print(field.description) # Ground truth annotations field = dataset.get_field("ground_truth.detections.area") print(field.description) # 'Area of the box, in pixels^2'
- property info#
A user-editable dictionary of information about the field.
Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") dataset.add_dynamic_sample_fields() field = dataset.get_field("ground_truth") field.info = {"url": "https://fiftyone.ai"} field.save() field = dataset.get_field("ground_truth.detections.area") field.info = {"url": "https://fiftyone.ai"} field.save() dataset.reload() field = dataset.get_field("ground_truth") print(field.info) # {'url': 'https://fiftyone.ai'} field = dataset.get_field("ground_truth.detections.area") print(field.info) # {'url': 'https://fiftyone.ai'}
- property read_only#
Whether the field is read-only.
Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") field = dataset.get_field("uniqueness") field.read_only = True field.save()
- property created_at#
The datetime the field was created.
- copy()#
Returns a copy of the field.
The returned copy is not associated with a dataset.
- Returns:
a
Field
- save(_enforce_read_only=True)#
Saves any edits to this field’s
description
andinfo
attributes.Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") dataset.add_dynamic_sample_fields() field = dataset.get_field("ground_truth") field.description = "Ground truth annotations" field.info = {"url": "https://fiftyone.ai"} field.save() field = dataset.get_field("ground_truth.detections.area") field.description = "Area of the box, in pixels^2" field.info = {"url": "https://fiftyone.ai"} field.save() dataset.reload() field = dataset.get_field("ground_truth") print(field.description) # Ground truth annotations print(field.info) # {'url': 'https://fiftyone.ai'} field = dataset.get_field("ground_truth.detections.area") print(field.description) # 'Area of the box, in pixels^2' field.info = {"url": "https://fiftyone.ai"}
- auto_creation_counter = -11#
- creation_counter = 272#
- error(message='', errors=None, field_name=None)#
Raise a ValidationError.
- name = None#
- property owner_document#
- prepare_query_value(op, value)#
Prepare a value that is being used in a query for PyMongo.
- set_auto_dereferencing(value)#
- to_mongo(value)#
Convert a Python type to a MongoDB-compatible type.
- to_python(value)#
Convert a MongoDB-compatible type to a Python type.
- validate(value, clean=True)#
Perform validation on a value.
- class fiftyone.core.fields.IntField(description=None, info=None, read_only=False, created_at=None, **kwargs)#
-
A 32 bit integer field.
- Parameters:
description (None) – an optional description
info (None) – an optional info dict
read_only (False) – whether the field is read-only
created_at (None) – the datetime the field was created
Methods:
to_mongo
(value)Convert a Python type to a MongoDB-compatible type.
copy
()Returns a copy of the field.
error
([message, errors, field_name])Raise a ValidationError.
prepare_query_value
(op, value)Prepare a value that is being used in a query for PyMongo.
save
([_enforce_read_only])Saves any edits to this field's
description
andinfo
attributes.set_auto_dereferencing
(value)to_python
(value)Convert a MongoDB-compatible type to a Python type.
validate
(value)Perform validation on a value.
Attributes:
The datetime the field was created.
A user-editable description of the field.
A user-editable dictionary of information about the field.
The fully-qualified path of this field in the dataset's schema, or
None
if the field is not associated with a dataset.Whether the field is read-only.
- to_mongo(value)#
Convert a Python type to a MongoDB-compatible type.
- auto_creation_counter = -11#
- copy()#
Returns a copy of the field.
The returned copy is not associated with a dataset.
- Returns:
a
Field
- property created_at#
The datetime the field was created.
- creation_counter = 272#
- property description#
A user-editable description of the field.
Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") dataset.add_dynamic_sample_fields() field = dataset.get_field("ground_truth") field.description = "Ground truth annotations" field.save() field = dataset.get_field("ground_truth.detections.area") field.description = "Area of the box, in pixels^2" field.save() dataset.reload() field = dataset.get_field("ground_truth") print(field.description) # Ground truth annotations field = dataset.get_field("ground_truth.detections.area") print(field.description) # 'Area of the box, in pixels^2'
- error(message='', errors=None, field_name=None)#
Raise a ValidationError.
- property info#
A user-editable dictionary of information about the field.
Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") dataset.add_dynamic_sample_fields() field = dataset.get_field("ground_truth") field.info = {"url": "https://fiftyone.ai"} field.save() field = dataset.get_field("ground_truth.detections.area") field.info = {"url": "https://fiftyone.ai"} field.save() dataset.reload() field = dataset.get_field("ground_truth") print(field.info) # {'url': 'https://fiftyone.ai'} field = dataset.get_field("ground_truth.detections.area") print(field.info) # {'url': 'https://fiftyone.ai'}
- name = None#
- property owner_document#
- property path#
The fully-qualified path of this field in the dataset’s schema, or
None
if the field is not associated with a dataset.
- prepare_query_value(op, value)#
Prepare a value that is being used in a query for PyMongo.
- property read_only#
Whether the field is read-only.
Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") field = dataset.get_field("uniqueness") field.read_only = True field.save()
- save(_enforce_read_only=True)#
Saves any edits to this field’s
description
andinfo
attributes.Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") dataset.add_dynamic_sample_fields() field = dataset.get_field("ground_truth") field.description = "Ground truth annotations" field.info = {"url": "https://fiftyone.ai"} field.save() field = dataset.get_field("ground_truth.detections.area") field.description = "Area of the box, in pixels^2" field.info = {"url": "https://fiftyone.ai"} field.save() dataset.reload() field = dataset.get_field("ground_truth") print(field.description) # Ground truth annotations print(field.info) # {'url': 'https://fiftyone.ai'} field = dataset.get_field("ground_truth.detections.area") print(field.description) # 'Area of the box, in pixels^2' field.info = {"url": "https://fiftyone.ai"}
- set_auto_dereferencing(value)#
- to_python(value)#
Convert a MongoDB-compatible type to a Python type.
- validate(value)#
Perform validation on a value.
- class fiftyone.core.fields.ObjectIdField(description=None, info=None, read_only=False, created_at=None, **kwargs)#
Bases:
ObjectIdField
,Field
An Object ID field.
- Parameters:
description (None) – an optional description
info (None) – an optional info dict
read_only (False) – whether the field is read-only
created_at (None) – the datetime the field was created
Methods:
to_mongo
(value)Convert a Python type to a MongoDB-compatible type.
to_python
(value)Convert a MongoDB-compatible type to a Python type.
copy
()Returns a copy of the field.
error
([message, errors, field_name])Raise a ValidationError.
prepare_query_value
(op, value)Prepare a value that is being used in a query for PyMongo.
save
([_enforce_read_only])Saves any edits to this field's
description
andinfo
attributes.set_auto_dereferencing
(value)validate
(value)Perform validation on a value.
Attributes:
The datetime the field was created.
A user-editable description of the field.
A user-editable dictionary of information about the field.
The fully-qualified path of this field in the dataset's schema, or
None
if the field is not associated with a dataset.Whether the field is read-only.
- to_mongo(value)#
Convert a Python type to a MongoDB-compatible type.
- to_python(value)#
Convert a MongoDB-compatible type to a Python type.
- auto_creation_counter = -11#
- copy()#
Returns a copy of the field.
The returned copy is not associated with a dataset.
- Returns:
a
Field
- property created_at#
The datetime the field was created.
- creation_counter = 272#
- property description#
A user-editable description of the field.
Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") dataset.add_dynamic_sample_fields() field = dataset.get_field("ground_truth") field.description = "Ground truth annotations" field.save() field = dataset.get_field("ground_truth.detections.area") field.description = "Area of the box, in pixels^2" field.save() dataset.reload() field = dataset.get_field("ground_truth") print(field.description) # Ground truth annotations field = dataset.get_field("ground_truth.detections.area") print(field.description) # 'Area of the box, in pixels^2'
- error(message='', errors=None, field_name=None)#
Raise a ValidationError.
- property info#
A user-editable dictionary of information about the field.
Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") dataset.add_dynamic_sample_fields() field = dataset.get_field("ground_truth") field.info = {"url": "https://fiftyone.ai"} field.save() field = dataset.get_field("ground_truth.detections.area") field.info = {"url": "https://fiftyone.ai"} field.save() dataset.reload() field = dataset.get_field("ground_truth") print(field.info) # {'url': 'https://fiftyone.ai'} field = dataset.get_field("ground_truth.detections.area") print(field.info) # {'url': 'https://fiftyone.ai'}
- name = None#
- property owner_document#
- property path#
The fully-qualified path of this field in the dataset’s schema, or
None
if the field is not associated with a dataset.
- prepare_query_value(op, value)#
Prepare a value that is being used in a query for PyMongo.
- property read_only#
Whether the field is read-only.
Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") field = dataset.get_field("uniqueness") field.read_only = True field.save()
- save(_enforce_read_only=True)#
Saves any edits to this field’s
description
andinfo
attributes.Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") dataset.add_dynamic_sample_fields() field = dataset.get_field("ground_truth") field.description = "Ground truth annotations" field.info = {"url": "https://fiftyone.ai"} field.save() field = dataset.get_field("ground_truth.detections.area") field.description = "Area of the box, in pixels^2" field.info = {"url": "https://fiftyone.ai"} field.save() dataset.reload() field = dataset.get_field("ground_truth") print(field.description) # Ground truth annotations print(field.info) # {'url': 'https://fiftyone.ai'} field = dataset.get_field("ground_truth.detections.area") print(field.description) # 'Area of the box, in pixels^2' field.info = {"url": "https://fiftyone.ai"}
- set_auto_dereferencing(value)#
- validate(value)#
Perform validation on a value.
- class fiftyone.core.fields.UUIDField(description=None, info=None, read_only=False, created_at=None, **kwargs)#
-
A UUID field.
- Parameters:
description (None) – an optional description
info (None) – an optional info dict
read_only (False) – whether the field is read-only
created_at (None) – the datetime the field was created
Attributes:
The datetime the field was created.
A user-editable description of the field.
A user-editable dictionary of information about the field.
The fully-qualified path of this field in the dataset's schema, or
None
if the field is not associated with a dataset.Whether the field is read-only.
Methods:
copy
()Returns a copy of the field.
error
([message, errors, field_name])Raise a ValidationError.
prepare_query_value
(op, value)Prepare a value that is being used in a query for PyMongo.
save
([_enforce_read_only])Saves any edits to this field's
description
andinfo
attributes.set_auto_dereferencing
(value)to_mongo
(value)Convert a Python type to a MongoDB-compatible type.
to_python
(value)Convert a MongoDB-compatible type to a Python type.
validate
(value)Perform validation on a value.
- auto_creation_counter = -11#
- copy()#
Returns a copy of the field.
The returned copy is not associated with a dataset.
- Returns:
a
Field
- property created_at#
The datetime the field was created.
- creation_counter = 272#
- property description#
A user-editable description of the field.
Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") dataset.add_dynamic_sample_fields() field = dataset.get_field("ground_truth") field.description = "Ground truth annotations" field.save() field = dataset.get_field("ground_truth.detections.area") field.description = "Area of the box, in pixels^2" field.save() dataset.reload() field = dataset.get_field("ground_truth") print(field.description) # Ground truth annotations field = dataset.get_field("ground_truth.detections.area") print(field.description) # 'Area of the box, in pixels^2'
- error(message='', errors=None, field_name=None)#
Raise a ValidationError.
- property info#
A user-editable dictionary of information about the field.
Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") dataset.add_dynamic_sample_fields() field = dataset.get_field("ground_truth") field.info = {"url": "https://fiftyone.ai"} field.save() field = dataset.get_field("ground_truth.detections.area") field.info = {"url": "https://fiftyone.ai"} field.save() dataset.reload() field = dataset.get_field("ground_truth") print(field.info) # {'url': 'https://fiftyone.ai'} field = dataset.get_field("ground_truth.detections.area") print(field.info) # {'url': 'https://fiftyone.ai'}
- name = None#
- property owner_document#
- property path#
The fully-qualified path of this field in the dataset’s schema, or
None
if the field is not associated with a dataset.
- prepare_query_value(op, value)#
Prepare a value that is being used in a query for PyMongo.
- property read_only#
Whether the field is read-only.
Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") field = dataset.get_field("uniqueness") field.read_only = True field.save()
- save(_enforce_read_only=True)#
Saves any edits to this field’s
description
andinfo
attributes.Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") dataset.add_dynamic_sample_fields() field = dataset.get_field("ground_truth") field.description = "Ground truth annotations" field.info = {"url": "https://fiftyone.ai"} field.save() field = dataset.get_field("ground_truth.detections.area") field.description = "Area of the box, in pixels^2" field.info = {"url": "https://fiftyone.ai"} field.save() dataset.reload() field = dataset.get_field("ground_truth") print(field.description) # Ground truth annotations print(field.info) # {'url': 'https://fiftyone.ai'} field = dataset.get_field("ground_truth.detections.area") print(field.description) # 'Area of the box, in pixels^2' field.info = {"url": "https://fiftyone.ai"}
- set_auto_dereferencing(value)#
- to_mongo(value)#
Convert a Python type to a MongoDB-compatible type.
- to_python(value)#
Convert a MongoDB-compatible type to a Python type.
- validate(value)#
Perform validation on a value.
- class fiftyone.core.fields.BooleanField(description=None, info=None, read_only=False, created_at=None, **kwargs)#
Bases:
BooleanField
,Field
A boolean field.
- Parameters:
description (None) – an optional description
info (None) – an optional info dict
read_only (False) – whether the field is read-only
created_at (None) – the datetime the field was created
Methods:
validate
(value)Perform validation on a value.
copy
()Returns a copy of the field.
error
([message, errors, field_name])Raise a ValidationError.
prepare_query_value
(op, value)Prepare a value that is being used in a query for PyMongo.
save
([_enforce_read_only])Saves any edits to this field's
description
andinfo
attributes.set_auto_dereferencing
(value)to_mongo
(value)Convert a Python type to a MongoDB-compatible type.
to_python
(value)Convert a MongoDB-compatible type to a Python type.
Attributes:
The datetime the field was created.
A user-editable description of the field.
A user-editable dictionary of information about the field.
The fully-qualified path of this field in the dataset's schema, or
None
if the field is not associated with a dataset.Whether the field is read-only.
- validate(value)#
Perform validation on a value.
- auto_creation_counter = -11#
- copy()#
Returns a copy of the field.
The returned copy is not associated with a dataset.
- Returns:
a
Field
- property created_at#
The datetime the field was created.
- creation_counter = 272#
- property description#
A user-editable description of the field.
Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") dataset.add_dynamic_sample_fields() field = dataset.get_field("ground_truth") field.description = "Ground truth annotations" field.save() field = dataset.get_field("ground_truth.detections.area") field.description = "Area of the box, in pixels^2" field.save() dataset.reload() field = dataset.get_field("ground_truth") print(field.description) # Ground truth annotations field = dataset.get_field("ground_truth.detections.area") print(field.description) # 'Area of the box, in pixels^2'
- error(message='', errors=None, field_name=None)#
Raise a ValidationError.
- property info#
A user-editable dictionary of information about the field.
Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") dataset.add_dynamic_sample_fields() field = dataset.get_field("ground_truth") field.info = {"url": "https://fiftyone.ai"} field.save() field = dataset.get_field("ground_truth.detections.area") field.info = {"url": "https://fiftyone.ai"} field.save() dataset.reload() field = dataset.get_field("ground_truth") print(field.info) # {'url': 'https://fiftyone.ai'} field = dataset.get_field("ground_truth.detections.area") print(field.info) # {'url': 'https://fiftyone.ai'}
- name = None#
- property owner_document#
- property path#
The fully-qualified path of this field in the dataset’s schema, or
None
if the field is not associated with a dataset.
- prepare_query_value(op, value)#
Prepare a value that is being used in a query for PyMongo.
- property read_only#
Whether the field is read-only.
Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") field = dataset.get_field("uniqueness") field.read_only = True field.save()
- save(_enforce_read_only=True)#
Saves any edits to this field’s
description
andinfo
attributes.Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") dataset.add_dynamic_sample_fields() field = dataset.get_field("ground_truth") field.description = "Ground truth annotations" field.info = {"url": "https://fiftyone.ai"} field.save() field = dataset.get_field("ground_truth.detections.area") field.description = "Area of the box, in pixels^2" field.info = {"url": "https://fiftyone.ai"} field.save() dataset.reload() field = dataset.get_field("ground_truth") print(field.description) # Ground truth annotations print(field.info) # {'url': 'https://fiftyone.ai'} field = dataset.get_field("ground_truth.detections.area") print(field.description) # 'Area of the box, in pixels^2' field.info = {"url": "https://fiftyone.ai"}
- set_auto_dereferencing(value)#
- to_mongo(value)#
Convert a Python type to a MongoDB-compatible type.
- to_python(value)#
Convert a MongoDB-compatible type to a Python type.
- class fiftyone.core.fields.DateField(description=None, info=None, read_only=False, created_at=None, **kwargs)#
Bases:
DateField
,Field
A date field.
- Parameters:
description (None) – an optional description
info (None) – an optional info dict
read_only (False) – whether the field is read-only
created_at (None) – the datetime the field was created
Methods:
to_mongo
(value)Convert a Python type to a MongoDB-compatible type.
to_python
(value)Convert a MongoDB-compatible type to a Python type.
validate
(value)Perform validation on a value.
copy
()Returns a copy of the field.
error
([message, errors, field_name])Raise a ValidationError.
prepare_query_value
(op, value)Prepare a value that is being used in a query for PyMongo.
save
([_enforce_read_only])Saves any edits to this field's
description
andinfo
attributes.set_auto_dereferencing
(value)Attributes:
The datetime the field was created.
A user-editable description of the field.
A user-editable dictionary of information about the field.
The fully-qualified path of this field in the dataset's schema, or
None
if the field is not associated with a dataset.Whether the field is read-only.
- to_mongo(value)#
Convert a Python type to a MongoDB-compatible type.
- to_python(value)#
Convert a MongoDB-compatible type to a Python type.
- validate(value)#
Perform validation on a value.
- auto_creation_counter = -11#
- copy()#
Returns a copy of the field.
The returned copy is not associated with a dataset.
- Returns:
a
Field
- property created_at#
The datetime the field was created.
- creation_counter = 272#
- property description#
A user-editable description of the field.
Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") dataset.add_dynamic_sample_fields() field = dataset.get_field("ground_truth") field.description = "Ground truth annotations" field.save() field = dataset.get_field("ground_truth.detections.area") field.description = "Area of the box, in pixels^2" field.save() dataset.reload() field = dataset.get_field("ground_truth") print(field.description) # Ground truth annotations field = dataset.get_field("ground_truth.detections.area") print(field.description) # 'Area of the box, in pixels^2'
- error(message='', errors=None, field_name=None)#
Raise a ValidationError.
- property info#
A user-editable dictionary of information about the field.
Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") dataset.add_dynamic_sample_fields() field = dataset.get_field("ground_truth") field.info = {"url": "https://fiftyone.ai"} field.save() field = dataset.get_field("ground_truth.detections.area") field.info = {"url": "https://fiftyone.ai"} field.save() dataset.reload() field = dataset.get_field("ground_truth") print(field.info) # {'url': 'https://fiftyone.ai'} field = dataset.get_field("ground_truth.detections.area") print(field.info) # {'url': 'https://fiftyone.ai'}
- name = None#
- property owner_document#
- property path#
The fully-qualified path of this field in the dataset’s schema, or
None
if the field is not associated with a dataset.
- prepare_query_value(op, value)#
Prepare a value that is being used in a query for PyMongo.
- property read_only#
Whether the field is read-only.
Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") field = dataset.get_field("uniqueness") field.read_only = True field.save()
- save(_enforce_read_only=True)#
Saves any edits to this field’s
description
andinfo
attributes.Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") dataset.add_dynamic_sample_fields() field = dataset.get_field("ground_truth") field.description = "Ground truth annotations" field.info = {"url": "https://fiftyone.ai"} field.save() field = dataset.get_field("ground_truth.detections.area") field.description = "Area of the box, in pixels^2" field.info = {"url": "https://fiftyone.ai"} field.save() dataset.reload() field = dataset.get_field("ground_truth") print(field.description) # Ground truth annotations print(field.info) # {'url': 'https://fiftyone.ai'} field = dataset.get_field("ground_truth.detections.area") print(field.description) # 'Area of the box, in pixels^2' field.info = {"url": "https://fiftyone.ai"}
- set_auto_dereferencing(value)#
- class fiftyone.core.fields.DateTimeField(description=None, info=None, read_only=False, created_at=None, **kwargs)#
Bases:
DateTimeField
,Field
A datetime field.
- Parameters:
description (None) – an optional description
info (None) – an optional info dict
read_only (False) – whether the field is read-only
created_at (None) – the datetime the field was created
Methods:
validate
(value)Perform validation on a value.
copy
()Returns a copy of the field.
error
([message, errors, field_name])Raise a ValidationError.
prepare_query_value
(op, value)Prepare a value that is being used in a query for PyMongo.
save
([_enforce_read_only])Saves any edits to this field's
description
andinfo
attributes.set_auto_dereferencing
(value)to_mongo
(value)Convert a Python type to a MongoDB-compatible type.
to_python
(value)Convert a MongoDB-compatible type to a Python type.
Attributes:
The datetime the field was created.
A user-editable description of the field.
A user-editable dictionary of information about the field.
The fully-qualified path of this field in the dataset's schema, or
None
if the field is not associated with a dataset.Whether the field is read-only.
- validate(value)#
Perform validation on a value.
- auto_creation_counter = -11#
- copy()#
Returns a copy of the field.
The returned copy is not associated with a dataset.
- Returns:
a
Field
- property created_at#
The datetime the field was created.
- creation_counter = 272#
- property description#
A user-editable description of the field.
Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") dataset.add_dynamic_sample_fields() field = dataset.get_field("ground_truth") field.description = "Ground truth annotations" field.save() field = dataset.get_field("ground_truth.detections.area") field.description = "Area of the box, in pixels^2" field.save() dataset.reload() field = dataset.get_field("ground_truth") print(field.description) # Ground truth annotations field = dataset.get_field("ground_truth.detections.area") print(field.description) # 'Area of the box, in pixels^2'
- error(message='', errors=None, field_name=None)#
Raise a ValidationError.
- property info#
A user-editable dictionary of information about the field.
Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") dataset.add_dynamic_sample_fields() field = dataset.get_field("ground_truth") field.info = {"url": "https://fiftyone.ai"} field.save() field = dataset.get_field("ground_truth.detections.area") field.info = {"url": "https://fiftyone.ai"} field.save() dataset.reload() field = dataset.get_field("ground_truth") print(field.info) # {'url': 'https://fiftyone.ai'} field = dataset.get_field("ground_truth.detections.area") print(field.info) # {'url': 'https://fiftyone.ai'}
- name = None#
- property owner_document#
- property path#
The fully-qualified path of this field in the dataset’s schema, or
None
if the field is not associated with a dataset.
- prepare_query_value(op, value)#
Prepare a value that is being used in a query for PyMongo.
- property read_only#
Whether the field is read-only.
Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") field = dataset.get_field("uniqueness") field.read_only = True field.save()
- save(_enforce_read_only=True)#
Saves any edits to this field’s
description
andinfo
attributes.Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") dataset.add_dynamic_sample_fields() field = dataset.get_field("ground_truth") field.description = "Ground truth annotations" field.info = {"url": "https://fiftyone.ai"} field.save() field = dataset.get_field("ground_truth.detections.area") field.description = "Area of the box, in pixels^2" field.info = {"url": "https://fiftyone.ai"} field.save() dataset.reload() field = dataset.get_field("ground_truth") print(field.description) # Ground truth annotations print(field.info) # {'url': 'https://fiftyone.ai'} field = dataset.get_field("ground_truth.detections.area") print(field.description) # 'Area of the box, in pixels^2' field.info = {"url": "https://fiftyone.ai"}
- set_auto_dereferencing(value)#
- to_mongo(value)#
Convert a Python type to a MongoDB-compatible type.
- to_python(value)#
Convert a MongoDB-compatible type to a Python type.
- class fiftyone.core.fields.FloatField(description=None, info=None, read_only=False, created_at=None, **kwargs)#
Bases:
FloatField
,Field
A floating point number field.
- Parameters:
description (None) – an optional description
info (None) – an optional info dict
read_only (False) – whether the field is read-only
created_at (None) – the datetime the field was created
Methods:
to_mongo
(value)Convert a Python type to a MongoDB-compatible type.
validate
(value)Perform validation on a value.
copy
()Returns a copy of the field.
error
([message, errors, field_name])Raise a ValidationError.
prepare_query_value
(op, value)Prepare a value that is being used in a query for PyMongo.
save
([_enforce_read_only])Saves any edits to this field's
description
andinfo
attributes.set_auto_dereferencing
(value)to_python
(value)Convert a MongoDB-compatible type to a Python type.
Attributes:
The datetime the field was created.
A user-editable description of the field.
A user-editable dictionary of information about the field.
The fully-qualified path of this field in the dataset's schema, or
None
if the field is not associated with a dataset.Whether the field is read-only.
- to_mongo(value)#
Convert a Python type to a MongoDB-compatible type.
- validate(value)#
Perform validation on a value.
- auto_creation_counter = -11#
- copy()#
Returns a copy of the field.
The returned copy is not associated with a dataset.
- Returns:
a
Field
- property created_at#
The datetime the field was created.
- creation_counter = 272#
- property description#
A user-editable description of the field.
Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") dataset.add_dynamic_sample_fields() field = dataset.get_field("ground_truth") field.description = "Ground truth annotations" field.save() field = dataset.get_field("ground_truth.detections.area") field.description = "Area of the box, in pixels^2" field.save() dataset.reload() field = dataset.get_field("ground_truth") print(field.description) # Ground truth annotations field = dataset.get_field("ground_truth.detections.area") print(field.description) # 'Area of the box, in pixels^2'
- error(message='', errors=None, field_name=None)#
Raise a ValidationError.
- property info#
A user-editable dictionary of information about the field.
Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") dataset.add_dynamic_sample_fields() field = dataset.get_field("ground_truth") field.info = {"url": "https://fiftyone.ai"} field.save() field = dataset.get_field("ground_truth.detections.area") field.info = {"url": "https://fiftyone.ai"} field.save() dataset.reload() field = dataset.get_field("ground_truth") print(field.info) # {'url': 'https://fiftyone.ai'} field = dataset.get_field("ground_truth.detections.area") print(field.info) # {'url': 'https://fiftyone.ai'}
- name = None#
- property owner_document#
- property path#
The fully-qualified path of this field in the dataset’s schema, or
None
if the field is not associated with a dataset.
- prepare_query_value(op, value)#
Prepare a value that is being used in a query for PyMongo.
- property read_only#
Whether the field is read-only.
Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") field = dataset.get_field("uniqueness") field.read_only = True field.save()
- save(_enforce_read_only=True)#
Saves any edits to this field’s
description
andinfo
attributes.Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") dataset.add_dynamic_sample_fields() field = dataset.get_field("ground_truth") field.description = "Ground truth annotations" field.info = {"url": "https://fiftyone.ai"} field.save() field = dataset.get_field("ground_truth.detections.area") field.description = "Area of the box, in pixels^2" field.info = {"url": "https://fiftyone.ai"} field.save() dataset.reload() field = dataset.get_field("ground_truth") print(field.description) # Ground truth annotations print(field.info) # {'url': 'https://fiftyone.ai'} field = dataset.get_field("ground_truth.detections.area") print(field.description) # 'Area of the box, in pixels^2' field.info = {"url": "https://fiftyone.ai"}
- set_auto_dereferencing(value)#
- to_python(value)#
Convert a MongoDB-compatible type to a Python type.
- class fiftyone.core.fields.StringField(description=None, info=None, read_only=False, created_at=None, **kwargs)#
Bases:
StringField
,Field
A unicode string field.
- Parameters:
description (None) – an optional description
info (None) – an optional info dict
read_only (False) – whether the field is read-only
created_at (None) – the datetime the field was created
Attributes:
The datetime the field was created.
A user-editable description of the field.
A user-editable dictionary of information about the field.
The fully-qualified path of this field in the dataset's schema, or
None
if the field is not associated with a dataset.Whether the field is read-only.
Methods:
copy
()Returns a copy of the field.
error
([message, errors, field_name])Raise a ValidationError.
lookup_member
(member_name)prepare_query_value
(op, value)Prepare a value that is being used in a query for PyMongo.
save
([_enforce_read_only])Saves any edits to this field's
description
andinfo
attributes.set_auto_dereferencing
(value)to_mongo
(value)Convert a Python type to a MongoDB-compatible type.
to_python
(value)Convert a MongoDB-compatible type to a Python type.
validate
(value)Perform validation on a value.
- auto_creation_counter = -11#
- copy()#
Returns a copy of the field.
The returned copy is not associated with a dataset.
- Returns:
a
Field
- property created_at#
The datetime the field was created.
- creation_counter = 272#
- property description#
A user-editable description of the field.
Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") dataset.add_dynamic_sample_fields() field = dataset.get_field("ground_truth") field.description = "Ground truth annotations" field.save() field = dataset.get_field("ground_truth.detections.area") field.description = "Area of the box, in pixels^2" field.save() dataset.reload() field = dataset.get_field("ground_truth") print(field.description) # Ground truth annotations field = dataset.get_field("ground_truth.detections.area") print(field.description) # 'Area of the box, in pixels^2'
- error(message='', errors=None, field_name=None)#
Raise a ValidationError.
- property info#
A user-editable dictionary of information about the field.
Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") dataset.add_dynamic_sample_fields() field = dataset.get_field("ground_truth") field.info = {"url": "https://fiftyone.ai"} field.save() field = dataset.get_field("ground_truth.detections.area") field.info = {"url": "https://fiftyone.ai"} field.save() dataset.reload() field = dataset.get_field("ground_truth") print(field.info) # {'url': 'https://fiftyone.ai'} field = dataset.get_field("ground_truth.detections.area") print(field.info) # {'url': 'https://fiftyone.ai'}
- lookup_member(member_name)#
- name = None#
- property owner_document#
- property path#
The fully-qualified path of this field in the dataset’s schema, or
None
if the field is not associated with a dataset.
- prepare_query_value(op, value)#
Prepare a value that is being used in a query for PyMongo.
- property read_only#
Whether the field is read-only.
Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") field = dataset.get_field("uniqueness") field.read_only = True field.save()
- save(_enforce_read_only=True)#
Saves any edits to this field’s
description
andinfo
attributes.Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") dataset.add_dynamic_sample_fields() field = dataset.get_field("ground_truth") field.description = "Ground truth annotations" field.info = {"url": "https://fiftyone.ai"} field.save() field = dataset.get_field("ground_truth.detections.area") field.description = "Area of the box, in pixels^2" field.info = {"url": "https://fiftyone.ai"} field.save() dataset.reload() field = dataset.get_field("ground_truth") print(field.description) # Ground truth annotations print(field.info) # {'url': 'https://fiftyone.ai'} field = dataset.get_field("ground_truth.detections.area") print(field.description) # 'Area of the box, in pixels^2' field.info = {"url": "https://fiftyone.ai"}
- set_auto_dereferencing(value)#
- to_mongo(value)#
Convert a Python type to a MongoDB-compatible type.
- to_python(value)#
Convert a MongoDB-compatible type to a Python type.
- validate(value)#
Perform validation on a value.
- class fiftyone.core.fields.ColorField(description=None, info=None, read_only=False, created_at=None, **kwargs)#
Bases:
StringField
A string field that holds a hex color string like ‘#FF6D04’.
- Parameters:
description (None) – an optional description
info (None) – an optional info dict
read_only (False) – whether the field is read-only
created_at (None) – the datetime the field was created
Methods:
validate
(value)Perform validation on a value.
copy
()Returns a copy of the field.
error
([message, errors, field_name])Raise a ValidationError.
lookup_member
(member_name)prepare_query_value
(op, value)Prepare a value that is being used in a query for PyMongo.
save
([_enforce_read_only])Saves any edits to this field's
description
andinfo
attributes.set_auto_dereferencing
(value)to_mongo
(value)Convert a Python type to a MongoDB-compatible type.
to_python
(value)Convert a MongoDB-compatible type to a Python type.
Attributes:
The datetime the field was created.
A user-editable description of the field.
A user-editable dictionary of information about the field.
The fully-qualified path of this field in the dataset's schema, or
None
if the field is not associated with a dataset.Whether the field is read-only.
- validate(value)#
Perform validation on a value.
- auto_creation_counter = -11#
- copy()#
Returns a copy of the field.
The returned copy is not associated with a dataset.
- Returns:
a
Field
- property created_at#
The datetime the field was created.
- creation_counter = 272#
- property description#
A user-editable description of the field.
Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") dataset.add_dynamic_sample_fields() field = dataset.get_field("ground_truth") field.description = "Ground truth annotations" field.save() field = dataset.get_field("ground_truth.detections.area") field.description = "Area of the box, in pixels^2" field.save() dataset.reload() field = dataset.get_field("ground_truth") print(field.description) # Ground truth annotations field = dataset.get_field("ground_truth.detections.area") print(field.description) # 'Area of the box, in pixels^2'
- error(message='', errors=None, field_name=None)#
Raise a ValidationError.
- property info#
A user-editable dictionary of information about the field.
Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") dataset.add_dynamic_sample_fields() field = dataset.get_field("ground_truth") field.info = {"url": "https://fiftyone.ai"} field.save() field = dataset.get_field("ground_truth.detections.area") field.info = {"url": "https://fiftyone.ai"} field.save() dataset.reload() field = dataset.get_field("ground_truth") print(field.info) # {'url': 'https://fiftyone.ai'} field = dataset.get_field("ground_truth.detections.area") print(field.info) # {'url': 'https://fiftyone.ai'}
- lookup_member(member_name)#
- name = None#
- property owner_document#
- property path#
The fully-qualified path of this field in the dataset’s schema, or
None
if the field is not associated with a dataset.
- prepare_query_value(op, value)#
Prepare a value that is being used in a query for PyMongo.
- property read_only#
Whether the field is read-only.
Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") field = dataset.get_field("uniqueness") field.read_only = True field.save()
- save(_enforce_read_only=True)#
Saves any edits to this field’s
description
andinfo
attributes.Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") dataset.add_dynamic_sample_fields() field = dataset.get_field("ground_truth") field.description = "Ground truth annotations" field.info = {"url": "https://fiftyone.ai"} field.save() field = dataset.get_field("ground_truth.detections.area") field.description = "Area of the box, in pixels^2" field.info = {"url": "https://fiftyone.ai"} field.save() dataset.reload() field = dataset.get_field("ground_truth") print(field.description) # Ground truth annotations print(field.info) # {'url': 'https://fiftyone.ai'} field = dataset.get_field("ground_truth.detections.area") print(field.description) # 'Area of the box, in pixels^2' field.info = {"url": "https://fiftyone.ai"}
- set_auto_dereferencing(value)#
- to_mongo(value)#
Convert a Python type to a MongoDB-compatible type.
- to_python(value)#
Convert a MongoDB-compatible type to a Python type.
- class fiftyone.core.fields.ListField(field=None, description=None, info=None, read_only=False, created_at=None, **kwargs)#
-
A list field that wraps a standard
Field
, allowing multiple instances of the field to be stored as a list in the database.If this field is not set, its default value is
[]
.- Parameters:
field (None) – an optional
Field
instance describing the type of the list elementsdescription (None) – an optional description
info (None) – an optional info dict
read_only (False) – whether the field is read-only
created_at (None) – the datetime the field was created
Attributes:
The datetime the field was created.
A user-editable description of the field.
A user-editable dictionary of information about the field.
The fully-qualified path of this field in the dataset's schema, or
None
if the field is not associated with a dataset.Whether the field is read-only.
Methods:
copy
()Returns a copy of the field.
error
([message, errors, field_name])Raise a ValidationError.
lookup_member
(member_name)prepare_query_value
(op, value)Prepare a value that is being used in a query for PyMongo.
save
([_enforce_read_only])Saves any edits to this field's
description
andinfo
attributes.set_auto_dereferencing
(value)to_mongo
(value[, use_db_field, fields])Convert a Python type to a MongoDB-compatible type.
to_python
(value)Convert a MongoDB-compatible type to a Python type.
validate
(value)Make sure that a list of valid fields is being used.
- auto_creation_counter = -11#
- copy()#
Returns a copy of the field.
The returned copy is not associated with a dataset.
- Returns:
a
Field
- property created_at#
The datetime the field was created.
- creation_counter = 272#
- property description#
A user-editable description of the field.
Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") dataset.add_dynamic_sample_fields() field = dataset.get_field("ground_truth") field.description = "Ground truth annotations" field.save() field = dataset.get_field("ground_truth.detections.area") field.description = "Area of the box, in pixels^2" field.save() dataset.reload() field = dataset.get_field("ground_truth") print(field.description) # Ground truth annotations field = dataset.get_field("ground_truth.detections.area") print(field.description) # 'Area of the box, in pixels^2'
- error(message='', errors=None, field_name=None)#
Raise a ValidationError.
- property info#
A user-editable dictionary of information about the field.
Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") dataset.add_dynamic_sample_fields() field = dataset.get_field("ground_truth") field.info = {"url": "https://fiftyone.ai"} field.save() field = dataset.get_field("ground_truth.detections.area") field.info = {"url": "https://fiftyone.ai"} field.save() dataset.reload() field = dataset.get_field("ground_truth") print(field.info) # {'url': 'https://fiftyone.ai'} field = dataset.get_field("ground_truth.detections.area") print(field.info) # {'url': 'https://fiftyone.ai'}
- lookup_member(member_name)#
- name = None#
- property owner_document#
- property path#
The fully-qualified path of this field in the dataset’s schema, or
None
if the field is not associated with a dataset.
- prepare_query_value(op, value)#
Prepare a value that is being used in a query for PyMongo.
- property read_only#
Whether the field is read-only.
Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") field = dataset.get_field("uniqueness") field.read_only = True field.save()
- save(_enforce_read_only=True)#
Saves any edits to this field’s
description
andinfo
attributes.Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") dataset.add_dynamic_sample_fields() field = dataset.get_field("ground_truth") field.description = "Ground truth annotations" field.info = {"url": "https://fiftyone.ai"} field.save() field = dataset.get_field("ground_truth.detections.area") field.description = "Area of the box, in pixels^2" field.info = {"url": "https://fiftyone.ai"} field.save() dataset.reload() field = dataset.get_field("ground_truth") print(field.description) # Ground truth annotations print(field.info) # {'url': 'https://fiftyone.ai'} field = dataset.get_field("ground_truth.detections.area") print(field.description) # 'Area of the box, in pixels^2' field.info = {"url": "https://fiftyone.ai"}
- set_auto_dereferencing(value)#
- to_mongo(value, use_db_field=True, fields=None)#
Convert a Python type to a MongoDB-compatible type.
- to_python(value)#
Convert a MongoDB-compatible type to a Python type.
- validate(value)#
Make sure that a list of valid fields is being used.
- class fiftyone.core.fields.HeatmapRangeField(**kwargs)#
Bases:
ListField
A
[min, max]
range of the values in afiftyone.core.labels.Heatmap
.- Parameters:
description (None) – an optional description
info (None) – an optional info dict
read_only (False) – whether the field is read-only
created_at (None) – the datetime the field was created
Methods:
validate
(value)Make sure that a list of valid fields is being used.
copy
()Returns a copy of the field.
error
([message, errors, field_name])Raise a ValidationError.
lookup_member
(member_name)prepare_query_value
(op, value)Prepare a value that is being used in a query for PyMongo.
save
([_enforce_read_only])Saves any edits to this field's
description
andinfo
attributes.set_auto_dereferencing
(value)to_mongo
(value[, use_db_field, fields])Convert a Python type to a MongoDB-compatible type.
to_python
(value)Convert a MongoDB-compatible type to a Python type.
Attributes:
The datetime the field was created.
A user-editable description of the field.
A user-editable dictionary of information about the field.
The fully-qualified path of this field in the dataset's schema, or
None
if the field is not associated with a dataset.Whether the field is read-only.
- validate(value)#
Make sure that a list of valid fields is being used.
- auto_creation_counter = -11#
- copy()#
Returns a copy of the field.
The returned copy is not associated with a dataset.
- Returns:
a
Field
- property created_at#
The datetime the field was created.
- creation_counter = 272#
- property description#
A user-editable description of the field.
Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") dataset.add_dynamic_sample_fields() field = dataset.get_field("ground_truth") field.description = "Ground truth annotations" field.save() field = dataset.get_field("ground_truth.detections.area") field.description = "Area of the box, in pixels^2" field.save() dataset.reload() field = dataset.get_field("ground_truth") print(field.description) # Ground truth annotations field = dataset.get_field("ground_truth.detections.area") print(field.description) # 'Area of the box, in pixels^2'
- error(message='', errors=None, field_name=None)#
Raise a ValidationError.
- property info#
A user-editable dictionary of information about the field.
Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") dataset.add_dynamic_sample_fields() field = dataset.get_field("ground_truth") field.info = {"url": "https://fiftyone.ai"} field.save() field = dataset.get_field("ground_truth.detections.area") field.info = {"url": "https://fiftyone.ai"} field.save() dataset.reload() field = dataset.get_field("ground_truth") print(field.info) # {'url': 'https://fiftyone.ai'} field = dataset.get_field("ground_truth.detections.area") print(field.info) # {'url': 'https://fiftyone.ai'}
- lookup_member(member_name)#
- name = None#
- property owner_document#
- property path#
The fully-qualified path of this field in the dataset’s schema, or
None
if the field is not associated with a dataset.
- prepare_query_value(op, value)#
Prepare a value that is being used in a query for PyMongo.
- property read_only#
Whether the field is read-only.
Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") field = dataset.get_field("uniqueness") field.read_only = True field.save()
- save(_enforce_read_only=True)#
Saves any edits to this field’s
description
andinfo
attributes.Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") dataset.add_dynamic_sample_fields() field = dataset.get_field("ground_truth") field.description = "Ground truth annotations" field.info = {"url": "https://fiftyone.ai"} field.save() field = dataset.get_field("ground_truth.detections.area") field.description = "Area of the box, in pixels^2" field.info = {"url": "https://fiftyone.ai"} field.save() dataset.reload() field = dataset.get_field("ground_truth") print(field.description) # Ground truth annotations print(field.info) # {'url': 'https://fiftyone.ai'} field = dataset.get_field("ground_truth.detections.area") print(field.description) # 'Area of the box, in pixels^2' field.info = {"url": "https://fiftyone.ai"}
- set_auto_dereferencing(value)#
- to_mongo(value, use_db_field=True, fields=None)#
Convert a Python type to a MongoDB-compatible type.
- to_python(value)#
Convert a MongoDB-compatible type to a Python type.
- class fiftyone.core.fields.DictField(field=None, description=None, info=None, read_only=False, created_at=None, **kwargs)#
-
A dictionary field that wraps a standard Python dictionary.
If this field is not set, its default value is
{}
.- Parameters:
field (None) – an optional
Field
instance describing the type of the values in the dictdescription (None) – an optional description
info (None) – an optional info dict
read_only (False) – whether the field is read-only
created_at (None) – the datetime the field was created
Methods:
validate
(value)Make sure that a list of valid fields is being used.
copy
()Returns a copy of the field.
error
([message, errors, field_name])Raise a ValidationError.
lookup_member
(member_name)prepare_query_value
(op, value)Prepare a value that is being used in a query for PyMongo.
save
([_enforce_read_only])Saves any edits to this field's
description
andinfo
attributes.set_auto_dereferencing
(value)to_mongo
(value[, use_db_field, fields])Convert a Python type to a MongoDB-compatible type.
to_python
(value)Convert a MongoDB-compatible type to a Python type.
Attributes:
The datetime the field was created.
A user-editable description of the field.
A user-editable dictionary of information about the field.
The fully-qualified path of this field in the dataset's schema, or
None
if the field is not associated with a dataset.Whether the field is read-only.
- validate(value)#
Make sure that a list of valid fields is being used.
- auto_creation_counter = -11#
- copy()#
Returns a copy of the field.
The returned copy is not associated with a dataset.
- Returns:
a
Field
- property created_at#
The datetime the field was created.
- creation_counter = 272#
- property description#
A user-editable description of the field.
Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") dataset.add_dynamic_sample_fields() field = dataset.get_field("ground_truth") field.description = "Ground truth annotations" field.save() field = dataset.get_field("ground_truth.detections.area") field.description = "Area of the box, in pixels^2" field.save() dataset.reload() field = dataset.get_field("ground_truth") print(field.description) # Ground truth annotations field = dataset.get_field("ground_truth.detections.area") print(field.description) # 'Area of the box, in pixels^2'
- error(message='', errors=None, field_name=None)#
Raise a ValidationError.
- property info#
A user-editable dictionary of information about the field.
Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") dataset.add_dynamic_sample_fields() field = dataset.get_field("ground_truth") field.info = {"url": "https://fiftyone.ai"} field.save() field = dataset.get_field("ground_truth.detections.area") field.info = {"url": "https://fiftyone.ai"} field.save() dataset.reload() field = dataset.get_field("ground_truth") print(field.info) # {'url': 'https://fiftyone.ai'} field = dataset.get_field("ground_truth.detections.area") print(field.info) # {'url': 'https://fiftyone.ai'}
- lookup_member(member_name)#
- name = None#
- property owner_document#
- property path#
The fully-qualified path of this field in the dataset’s schema, or
None
if the field is not associated with a dataset.
- prepare_query_value(op, value)#
Prepare a value that is being used in a query for PyMongo.
- property read_only#
Whether the field is read-only.
Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") field = dataset.get_field("uniqueness") field.read_only = True field.save()
- save(_enforce_read_only=True)#
Saves any edits to this field’s
description
andinfo
attributes.Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") dataset.add_dynamic_sample_fields() field = dataset.get_field("ground_truth") field.description = "Ground truth annotations" field.info = {"url": "https://fiftyone.ai"} field.save() field = dataset.get_field("ground_truth.detections.area") field.description = "Area of the box, in pixels^2" field.info = {"url": "https://fiftyone.ai"} field.save() dataset.reload() field = dataset.get_field("ground_truth") print(field.description) # Ground truth annotations print(field.info) # {'url': 'https://fiftyone.ai'} field = dataset.get_field("ground_truth.detections.area") print(field.description) # 'Area of the box, in pixels^2' field.info = {"url": "https://fiftyone.ai"}
- set_auto_dereferencing(value)#
- to_mongo(value, use_db_field=True, fields=None)#
Convert a Python type to a MongoDB-compatible type.
- to_python(value)#
Convert a MongoDB-compatible type to a Python type.
- class fiftyone.core.fields.KeypointsField(field=None, description=None, info=None, read_only=False, created_at=None, **kwargs)#
Bases:
ListField
A list of
(x, y)
coordinate pairs.If this field is not set, its default value is
[]
.- Parameters:
description (None) – an optional description
info (None) – an optional info dict
read_only (False) – whether the field is read-only
created_at (None) – the datetime the field was created
Methods:
validate
(value)Make sure that a list of valid fields is being used.
copy
()Returns a copy of the field.
error
([message, errors, field_name])Raise a ValidationError.
lookup_member
(member_name)prepare_query_value
(op, value)Prepare a value that is being used in a query for PyMongo.
save
([_enforce_read_only])Saves any edits to this field's
description
andinfo
attributes.set_auto_dereferencing
(value)to_mongo
(value[, use_db_field, fields])Convert a Python type to a MongoDB-compatible type.
to_python
(value)Convert a MongoDB-compatible type to a Python type.
Attributes:
The datetime the field was created.
A user-editable description of the field.
A user-editable dictionary of information about the field.
The fully-qualified path of this field in the dataset's schema, or
None
if the field is not associated with a dataset.Whether the field is read-only.
- validate(value)#
Make sure that a list of valid fields is being used.
- auto_creation_counter = -11#
- copy()#
Returns a copy of the field.
The returned copy is not associated with a dataset.
- Returns:
a
Field
- property created_at#
The datetime the field was created.
- creation_counter = 272#
- property description#
A user-editable description of the field.
Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") dataset.add_dynamic_sample_fields() field = dataset.get_field("ground_truth") field.description = "Ground truth annotations" field.save() field = dataset.get_field("ground_truth.detections.area") field.description = "Area of the box, in pixels^2" field.save() dataset.reload() field = dataset.get_field("ground_truth") print(field.description) # Ground truth annotations field = dataset.get_field("ground_truth.detections.area") print(field.description) # 'Area of the box, in pixels^2'
- error(message='', errors=None, field_name=None)#
Raise a ValidationError.
- property info#
A user-editable dictionary of information about the field.
Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") dataset.add_dynamic_sample_fields() field = dataset.get_field("ground_truth") field.info = {"url": "https://fiftyone.ai"} field.save() field = dataset.get_field("ground_truth.detections.area") field.info = {"url": "https://fiftyone.ai"} field.save() dataset.reload() field = dataset.get_field("ground_truth") print(field.info) # {'url': 'https://fiftyone.ai'} field = dataset.get_field("ground_truth.detections.area") print(field.info) # {'url': 'https://fiftyone.ai'}
- lookup_member(member_name)#
- name = None#
- property owner_document#
- property path#
The fully-qualified path of this field in the dataset’s schema, or
None
if the field is not associated with a dataset.
- prepare_query_value(op, value)#
Prepare a value that is being used in a query for PyMongo.
- property read_only#
Whether the field is read-only.
Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") field = dataset.get_field("uniqueness") field.read_only = True field.save()
- save(_enforce_read_only=True)#
Saves any edits to this field’s
description
andinfo
attributes.Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") dataset.add_dynamic_sample_fields() field = dataset.get_field("ground_truth") field.description = "Ground truth annotations" field.info = {"url": "https://fiftyone.ai"} field.save() field = dataset.get_field("ground_truth.detections.area") field.description = "Area of the box, in pixels^2" field.info = {"url": "https://fiftyone.ai"} field.save() dataset.reload() field = dataset.get_field("ground_truth") print(field.description) # Ground truth annotations print(field.info) # {'url': 'https://fiftyone.ai'} field = dataset.get_field("ground_truth.detections.area") print(field.description) # 'Area of the box, in pixels^2' field.info = {"url": "https://fiftyone.ai"}
- set_auto_dereferencing(value)#
- to_mongo(value, use_db_field=True, fields=None)#
Convert a Python type to a MongoDB-compatible type.
- to_python(value)#
Convert a MongoDB-compatible type to a Python type.
- class fiftyone.core.fields.PolylinePointsField(field=None, description=None, info=None, read_only=False, created_at=None, **kwargs)#
Bases:
ListField
A list of lists of
(x, y)
coordinate pairs.If this field is not set, its default value is
[]
.- Parameters:
description (None) – an optional description
info (None) – an optional info dict
read_only (False) – whether the field is read-only
created_at (None) – the datetime the field was created
Methods:
validate
(value)Make sure that a list of valid fields is being used.
copy
()Returns a copy of the field.
error
([message, errors, field_name])Raise a ValidationError.
lookup_member
(member_name)prepare_query_value
(op, value)Prepare a value that is being used in a query for PyMongo.
save
([_enforce_read_only])Saves any edits to this field's
description
andinfo
attributes.set_auto_dereferencing
(value)to_mongo
(value[, use_db_field, fields])Convert a Python type to a MongoDB-compatible type.
to_python
(value)Convert a MongoDB-compatible type to a Python type.
Attributes:
The datetime the field was created.
A user-editable description of the field.
A user-editable dictionary of information about the field.
The fully-qualified path of this field in the dataset's schema, or
None
if the field is not associated with a dataset.Whether the field is read-only.
- validate(value)#
Make sure that a list of valid fields is being used.
- auto_creation_counter = -11#
- copy()#
Returns a copy of the field.
The returned copy is not associated with a dataset.
- Returns:
a
Field
- property created_at#
The datetime the field was created.
- creation_counter = 272#
- property description#
A user-editable description of the field.
Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") dataset.add_dynamic_sample_fields() field = dataset.get_field("ground_truth") field.description = "Ground truth annotations" field.save() field = dataset.get_field("ground_truth.detections.area") field.description = "Area of the box, in pixels^2" field.save() dataset.reload() field = dataset.get_field("ground_truth") print(field.description) # Ground truth annotations field = dataset.get_field("ground_truth.detections.area") print(field.description) # 'Area of the box, in pixels^2'
- error(message='', errors=None, field_name=None)#
Raise a ValidationError.
- property info#
A user-editable dictionary of information about the field.
Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") dataset.add_dynamic_sample_fields() field = dataset.get_field("ground_truth") field.info = {"url": "https://fiftyone.ai"} field.save() field = dataset.get_field("ground_truth.detections.area") field.info = {"url": "https://fiftyone.ai"} field.save() dataset.reload() field = dataset.get_field("ground_truth") print(field.info) # {'url': 'https://fiftyone.ai'} field = dataset.get_field("ground_truth.detections.area") print(field.info) # {'url': 'https://fiftyone.ai'}
- lookup_member(member_name)#
- name = None#
- property owner_document#
- property path#
The fully-qualified path of this field in the dataset’s schema, or
None
if the field is not associated with a dataset.
- prepare_query_value(op, value)#
Prepare a value that is being used in a query for PyMongo.
- property read_only#
Whether the field is read-only.
Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") field = dataset.get_field("uniqueness") field.read_only = True field.save()
- save(_enforce_read_only=True)#
Saves any edits to this field’s
description
andinfo
attributes.Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") dataset.add_dynamic_sample_fields() field = dataset.get_field("ground_truth") field.description = "Ground truth annotations" field.info = {"url": "https://fiftyone.ai"} field.save() field = dataset.get_field("ground_truth.detections.area") field.description = "Area of the box, in pixels^2" field.info = {"url": "https://fiftyone.ai"} field.save() dataset.reload() field = dataset.get_field("ground_truth") print(field.description) # Ground truth annotations print(field.info) # {'url': 'https://fiftyone.ai'} field = dataset.get_field("ground_truth.detections.area") print(field.description) # 'Area of the box, in pixels^2' field.info = {"url": "https://fiftyone.ai"}
- set_auto_dereferencing(value)#
- to_mongo(value, use_db_field=True, fields=None)#
Convert a Python type to a MongoDB-compatible type.
- to_python(value)#
Convert a MongoDB-compatible type to a Python type.
- class fiftyone.core.fields.GeoPointField(description=None, info=None, read_only=False, created_at=None, **kwargs)#
Bases:
_GeoField
,PointField
A GeoJSON field storing a longitude and latitude coordinate point.
The data is stored as
[longitude, latitude]
.- Parameters:
description (None) – an optional description
info (None) – an optional info dict
read_only (False) – whether the field is read-only
created_at (None) – the datetime the field was created
Methods:
validate
(value)Perform validation on a value.
copy
()Returns a copy of the field.
error
([message, errors, field_name])Raise a ValidationError.
prepare_query_value
(op, value)Prepare a value that is being used in a query for PyMongo.
save
([_enforce_read_only])Saves any edits to this field's
description
andinfo
attributes.set_auto_dereferencing
(value)to_mongo
(value)Convert a Python type to a MongoDB-compatible type.
to_python
(value)Convert a MongoDB-compatible type to a Python type.
Attributes:
The datetime the field was created.
A user-editable description of the field.
A user-editable dictionary of information about the field.
The fully-qualified path of this field in the dataset's schema, or
None
if the field is not associated with a dataset.Whether the field is read-only.
- validate(value)#
Perform validation on a value.
- auto_creation_counter = -11#
- copy()#
Returns a copy of the field.
The returned copy is not associated with a dataset.
- Returns:
a
Field
- property created_at#
The datetime the field was created.
- creation_counter = 272#
- property description#
A user-editable description of the field.
Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") dataset.add_dynamic_sample_fields() field = dataset.get_field("ground_truth") field.description = "Ground truth annotations" field.save() field = dataset.get_field("ground_truth.detections.area") field.description = "Area of the box, in pixels^2" field.save() dataset.reload() field = dataset.get_field("ground_truth") print(field.description) # Ground truth annotations field = dataset.get_field("ground_truth.detections.area") print(field.description) # 'Area of the box, in pixels^2'
- error(message='', errors=None, field_name=None)#
Raise a ValidationError.
- property info#
A user-editable dictionary of information about the field.
Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") dataset.add_dynamic_sample_fields() field = dataset.get_field("ground_truth") field.info = {"url": "https://fiftyone.ai"} field.save() field = dataset.get_field("ground_truth.detections.area") field.info = {"url": "https://fiftyone.ai"} field.save() dataset.reload() field = dataset.get_field("ground_truth") print(field.info) # {'url': 'https://fiftyone.ai'} field = dataset.get_field("ground_truth.detections.area") print(field.info) # {'url': 'https://fiftyone.ai'}
- name = None#
- property owner_document#
- property path#
The fully-qualified path of this field in the dataset’s schema, or
None
if the field is not associated with a dataset.
- prepare_query_value(op, value)#
Prepare a value that is being used in a query for PyMongo.
- property read_only#
Whether the field is read-only.
Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") field = dataset.get_field("uniqueness") field.read_only = True field.save()
- save(_enforce_read_only=True)#
Saves any edits to this field’s
description
andinfo
attributes.Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") dataset.add_dynamic_sample_fields() field = dataset.get_field("ground_truth") field.description = "Ground truth annotations" field.info = {"url": "https://fiftyone.ai"} field.save() field = dataset.get_field("ground_truth.detections.area") field.description = "Area of the box, in pixels^2" field.info = {"url": "https://fiftyone.ai"} field.save() dataset.reload() field = dataset.get_field("ground_truth") print(field.description) # Ground truth annotations print(field.info) # {'url': 'https://fiftyone.ai'} field = dataset.get_field("ground_truth.detections.area") print(field.description) # 'Area of the box, in pixels^2' field.info = {"url": "https://fiftyone.ai"}
- set_auto_dereferencing(value)#
- to_mongo(value)#
Convert a Python type to a MongoDB-compatible type.
- to_python(value)#
Convert a MongoDB-compatible type to a Python type.
- class fiftyone.core.fields.GeoLineStringField(description=None, info=None, read_only=False, created_at=None, **kwargs)#
Bases:
_GeoField
,LineStringField
A GeoJSON field storing a line of longitude and latitude coordinates.
The data is stored as follows:
[[lon1, lat1], [lon2, lat2], ...]
- Parameters:
description (None) – an optional description
info (None) – an optional info dict
read_only (False) – whether the field is read-only
created_at (None) – the datetime the field was created
Methods:
validate
(value)Perform validation on a value.
copy
()Returns a copy of the field.
error
([message, errors, field_name])Raise a ValidationError.
prepare_query_value
(op, value)Prepare a value that is being used in a query for PyMongo.
save
([_enforce_read_only])Saves any edits to this field's
description
andinfo
attributes.set_auto_dereferencing
(value)to_mongo
(value)Convert a Python type to a MongoDB-compatible type.
to_python
(value)Convert a MongoDB-compatible type to a Python type.
Attributes:
The datetime the field was created.
A user-editable description of the field.
A user-editable dictionary of information about the field.
The fully-qualified path of this field in the dataset's schema, or
None
if the field is not associated with a dataset.Whether the field is read-only.
- validate(value)#
Perform validation on a value.
- auto_creation_counter = -11#
- copy()#
Returns a copy of the field.
The returned copy is not associated with a dataset.
- Returns:
a
Field
- property created_at#
The datetime the field was created.
- creation_counter = 272#
- property description#
A user-editable description of the field.
Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") dataset.add_dynamic_sample_fields() field = dataset.get_field("ground_truth") field.description = "Ground truth annotations" field.save() field = dataset.get_field("ground_truth.detections.area") field.description = "Area of the box, in pixels^2" field.save() dataset.reload() field = dataset.get_field("ground_truth") print(field.description) # Ground truth annotations field = dataset.get_field("ground_truth.detections.area") print(field.description) # 'Area of the box, in pixels^2'
- error(message='', errors=None, field_name=None)#
Raise a ValidationError.
- property info#
A user-editable dictionary of information about the field.
Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") dataset.add_dynamic_sample_fields() field = dataset.get_field("ground_truth") field.info = {"url": "https://fiftyone.ai"} field.save() field = dataset.get_field("ground_truth.detections.area") field.info = {"url": "https://fiftyone.ai"} field.save() dataset.reload() field = dataset.get_field("ground_truth") print(field.info) # {'url': 'https://fiftyone.ai'} field = dataset.get_field("ground_truth.detections.area") print(field.info) # {'url': 'https://fiftyone.ai'}
- name = None#
- property owner_document#
- property path#
The fully-qualified path of this field in the dataset’s schema, or
None
if the field is not associated with a dataset.
- prepare_query_value(op, value)#
Prepare a value that is being used in a query for PyMongo.
- property read_only#
Whether the field is read-only.
Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") field = dataset.get_field("uniqueness") field.read_only = True field.save()
- save(_enforce_read_only=True)#
Saves any edits to this field’s
description
andinfo
attributes.Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") dataset.add_dynamic_sample_fields() field = dataset.get_field("ground_truth") field.description = "Ground truth annotations" field.info = {"url": "https://fiftyone.ai"} field.save() field = dataset.get_field("ground_truth.detections.area") field.description = "Area of the box, in pixels^2" field.info = {"url": "https://fiftyone.ai"} field.save() dataset.reload() field = dataset.get_field("ground_truth") print(field.description) # Ground truth annotations print(field.info) # {'url': 'https://fiftyone.ai'} field = dataset.get_field("ground_truth.detections.area") print(field.description) # 'Area of the box, in pixels^2' field.info = {"url": "https://fiftyone.ai"}
- set_auto_dereferencing(value)#
- to_mongo(value)#
Convert a Python type to a MongoDB-compatible type.
- to_python(value)#
Convert a MongoDB-compatible type to a Python type.
- class fiftyone.core.fields.GeoPolygonField(description=None, info=None, read_only=False, created_at=None, **kwargs)#
Bases:
_GeoField
,PolygonField
A GeoJSON field storing a polygon of longitude and latitude coordinates.
The data is stored as follows:
[ [[lon1, lat1], [lon2, lat2], ...], [[lon1, lat1], [lon2, lat2], ...], ... ]
where the first element describes the boundary of the polygon and any remaining entries describe holes.
- Parameters:
description (None) – an optional description
info (None) – an optional info dict
read_only (False) – whether the field is read-only
created_at (None) – the datetime the field was created
Methods:
validate
(value)Perform validation on a value.
copy
()Returns a copy of the field.
error
([message, errors, field_name])Raise a ValidationError.
prepare_query_value
(op, value)Prepare a value that is being used in a query for PyMongo.
save
([_enforce_read_only])Saves any edits to this field's
description
andinfo
attributes.set_auto_dereferencing
(value)to_mongo
(value)Convert a Python type to a MongoDB-compatible type.
to_python
(value)Convert a MongoDB-compatible type to a Python type.
Attributes:
The datetime the field was created.
A user-editable description of the field.
A user-editable dictionary of information about the field.
The fully-qualified path of this field in the dataset's schema, or
None
if the field is not associated with a dataset.Whether the field is read-only.
- validate(value)#
Perform validation on a value.
- auto_creation_counter = -11#
- copy()#
Returns a copy of the field.
The returned copy is not associated with a dataset.
- Returns:
a
Field
- property created_at#
The datetime the field was created.
- creation_counter = 272#
- property description#
A user-editable description of the field.
Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") dataset.add_dynamic_sample_fields() field = dataset.get_field("ground_truth") field.description = "Ground truth annotations" field.save() field = dataset.get_field("ground_truth.detections.area") field.description = "Area of the box, in pixels^2" field.save() dataset.reload() field = dataset.get_field("ground_truth") print(field.description) # Ground truth annotations field = dataset.get_field("ground_truth.detections.area") print(field.description) # 'Area of the box, in pixels^2'
- error(message='', errors=None, field_name=None)#
Raise a ValidationError.
- property info#
A user-editable dictionary of information about the field.
Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") dataset.add_dynamic_sample_fields() field = dataset.get_field("ground_truth") field.info = {"url": "https://fiftyone.ai"} field.save() field = dataset.get_field("ground_truth.detections.area") field.info = {"url": "https://fiftyone.ai"} field.save() dataset.reload() field = dataset.get_field("ground_truth") print(field.info) # {'url': 'https://fiftyone.ai'} field = dataset.get_field("ground_truth.detections.area") print(field.info) # {'url': 'https://fiftyone.ai'}
- name = None#
- property owner_document#
- property path#
The fully-qualified path of this field in the dataset’s schema, or
None
if the field is not associated with a dataset.
- prepare_query_value(op, value)#
Prepare a value that is being used in a query for PyMongo.
- property read_only#
Whether the field is read-only.
Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") field = dataset.get_field("uniqueness") field.read_only = True field.save()
- save(_enforce_read_only=True)#
Saves any edits to this field’s
description
andinfo
attributes.Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") dataset.add_dynamic_sample_fields() field = dataset.get_field("ground_truth") field.description = "Ground truth annotations" field.info = {"url": "https://fiftyone.ai"} field.save() field = dataset.get_field("ground_truth.detections.area") field.description = "Area of the box, in pixels^2" field.info = {"url": "https://fiftyone.ai"} field.save() dataset.reload() field = dataset.get_field("ground_truth") print(field.description) # Ground truth annotations print(field.info) # {'url': 'https://fiftyone.ai'} field = dataset.get_field("ground_truth.detections.area") print(field.description) # 'Area of the box, in pixels^2' field.info = {"url": "https://fiftyone.ai"}
- set_auto_dereferencing(value)#
- to_mongo(value)#
Convert a Python type to a MongoDB-compatible type.
- to_python(value)#
Convert a MongoDB-compatible type to a Python type.
- class fiftyone.core.fields.GeoMultiPointField(description=None, info=None, read_only=False, created_at=None, **kwargs)#
Bases:
_GeoField
,MultiPointField
A GeoJSON field storing a list of points.
The data is stored as follows:
[[lon1, lat1], [lon2, lat2], ...]
- Parameters:
description (None) – an optional description
info (None) – an optional info dict
read_only (False) – whether the field is read-only
created_at (None) – the datetime the field was created
Methods:
validate
(value)Perform validation on a value.
copy
()Returns a copy of the field.
error
([message, errors, field_name])Raise a ValidationError.
prepare_query_value
(op, value)Prepare a value that is being used in a query for PyMongo.
save
([_enforce_read_only])Saves any edits to this field's
description
andinfo
attributes.set_auto_dereferencing
(value)to_mongo
(value)Convert a Python type to a MongoDB-compatible type.
to_python
(value)Convert a MongoDB-compatible type to a Python type.
Attributes:
The datetime the field was created.
A user-editable description of the field.
A user-editable dictionary of information about the field.
The fully-qualified path of this field in the dataset's schema, or
None
if the field is not associated with a dataset.Whether the field is read-only.
- validate(value)#
Perform validation on a value.
- auto_creation_counter = -11#
- copy()#
Returns a copy of the field.
The returned copy is not associated with a dataset.
- Returns:
a
Field
- property created_at#
The datetime the field was created.
- creation_counter = 272#
- property description#
A user-editable description of the field.
Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") dataset.add_dynamic_sample_fields() field = dataset.get_field("ground_truth") field.description = "Ground truth annotations" field.save() field = dataset.get_field("ground_truth.detections.area") field.description = "Area of the box, in pixels^2" field.save() dataset.reload() field = dataset.get_field("ground_truth") print(field.description) # Ground truth annotations field = dataset.get_field("ground_truth.detections.area") print(field.description) # 'Area of the box, in pixels^2'
- error(message='', errors=None, field_name=None)#
Raise a ValidationError.
- property info#
A user-editable dictionary of information about the field.
Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") dataset.add_dynamic_sample_fields() field = dataset.get_field("ground_truth") field.info = {"url": "https://fiftyone.ai"} field.save() field = dataset.get_field("ground_truth.detections.area") field.info = {"url": "https://fiftyone.ai"} field.save() dataset.reload() field = dataset.get_field("ground_truth") print(field.info) # {'url': 'https://fiftyone.ai'} field = dataset.get_field("ground_truth.detections.area") print(field.info) # {'url': 'https://fiftyone.ai'}
- name = None#
- property owner_document#
- property path#
The fully-qualified path of this field in the dataset’s schema, or
None
if the field is not associated with a dataset.
- prepare_query_value(op, value)#
Prepare a value that is being used in a query for PyMongo.
- property read_only#
Whether the field is read-only.
Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") field = dataset.get_field("uniqueness") field.read_only = True field.save()
- save(_enforce_read_only=True)#
Saves any edits to this field’s
description
andinfo
attributes.Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") dataset.add_dynamic_sample_fields() field = dataset.get_field("ground_truth") field.description = "Ground truth annotations" field.info = {"url": "https://fiftyone.ai"} field.save() field = dataset.get_field("ground_truth.detections.area") field.description = "Area of the box, in pixels^2" field.info = {"url": "https://fiftyone.ai"} field.save() dataset.reload() field = dataset.get_field("ground_truth") print(field.description) # Ground truth annotations print(field.info) # {'url': 'https://fiftyone.ai'} field = dataset.get_field("ground_truth.detections.area") print(field.description) # 'Area of the box, in pixels^2' field.info = {"url": "https://fiftyone.ai"}
- set_auto_dereferencing(value)#
- to_mongo(value)#
Convert a Python type to a MongoDB-compatible type.
- to_python(value)#
Convert a MongoDB-compatible type to a Python type.
- class fiftyone.core.fields.GeoMultiLineStringField(description=None, info=None, read_only=False, created_at=None, **kwargs)#
Bases:
_GeoField
,MultiLineStringField
A GeoJSON field storing a list of lines.
The data is stored as follows:
[ [[lon1, lat1], [lon2, lat2], ...], [[lon1, lat1], [lon2, lat2], ...], ... ]
- Parameters:
description (None) – an optional description
info (None) – an optional info dict
read_only (False) – whether the field is read-only
created_at (None) – the datetime the field was created
Methods:
validate
(value)Perform validation on a value.
copy
()Returns a copy of the field.
error
([message, errors, field_name])Raise a ValidationError.
prepare_query_value
(op, value)Prepare a value that is being used in a query for PyMongo.
save
([_enforce_read_only])Saves any edits to this field's
description
andinfo
attributes.set_auto_dereferencing
(value)to_mongo
(value)Convert a Python type to a MongoDB-compatible type.
to_python
(value)Convert a MongoDB-compatible type to a Python type.
Attributes:
The datetime the field was created.
A user-editable description of the field.
A user-editable dictionary of information about the field.
The fully-qualified path of this field in the dataset's schema, or
None
if the field is not associated with a dataset.Whether the field is read-only.
- validate(value)#
Perform validation on a value.
- auto_creation_counter = -11#
- copy()#
Returns a copy of the field.
The returned copy is not associated with a dataset.
- Returns:
a
Field
- property created_at#
The datetime the field was created.
- creation_counter = 272#
- property description#
A user-editable description of the field.
Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") dataset.add_dynamic_sample_fields() field = dataset.get_field("ground_truth") field.description = "Ground truth annotations" field.save() field = dataset.get_field("ground_truth.detections.area") field.description = "Area of the box, in pixels^2" field.save() dataset.reload() field = dataset.get_field("ground_truth") print(field.description) # Ground truth annotations field = dataset.get_field("ground_truth.detections.area") print(field.description) # 'Area of the box, in pixels^2'
- error(message='', errors=None, field_name=None)#
Raise a ValidationError.
- property info#
A user-editable dictionary of information about the field.
Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") dataset.add_dynamic_sample_fields() field = dataset.get_field("ground_truth") field.info = {"url": "https://fiftyone.ai"} field.save() field = dataset.get_field("ground_truth.detections.area") field.info = {"url": "https://fiftyone.ai"} field.save() dataset.reload() field = dataset.get_field("ground_truth") print(field.info) # {'url': 'https://fiftyone.ai'} field = dataset.get_field("ground_truth.detections.area") print(field.info) # {'url': 'https://fiftyone.ai'}
- name = None#
- property owner_document#
- property path#
The fully-qualified path of this field in the dataset’s schema, or
None
if the field is not associated with a dataset.
- prepare_query_value(op, value)#
Prepare a value that is being used in a query for PyMongo.
- property read_only#
Whether the field is read-only.
Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") field = dataset.get_field("uniqueness") field.read_only = True field.save()
- save(_enforce_read_only=True)#
Saves any edits to this field’s
description
andinfo
attributes.Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") dataset.add_dynamic_sample_fields() field = dataset.get_field("ground_truth") field.description = "Ground truth annotations" field.info = {"url": "https://fiftyone.ai"} field.save() field = dataset.get_field("ground_truth.detections.area") field.description = "Area of the box, in pixels^2" field.info = {"url": "https://fiftyone.ai"} field.save() dataset.reload() field = dataset.get_field("ground_truth") print(field.description) # Ground truth annotations print(field.info) # {'url': 'https://fiftyone.ai'} field = dataset.get_field("ground_truth.detections.area") print(field.description) # 'Area of the box, in pixels^2' field.info = {"url": "https://fiftyone.ai"}
- set_auto_dereferencing(value)#
- to_mongo(value)#
Convert a Python type to a MongoDB-compatible type.
- to_python(value)#
Convert a MongoDB-compatible type to a Python type.
- class fiftyone.core.fields.GeoMultiPolygonField(description=None, info=None, read_only=False, created_at=None, **kwargs)#
Bases:
_GeoField
,MultiPolygonField
A GeoJSON field storing a list of polygons.
The data is stored as follows:
[ [ [[lon1, lat1], [lon2, lat2], ...], [[lon1, lat1], [lon2, lat2], ...], ... ], [ [[lon1, lat1], [lon2, lat2], ...], [[lon1, lat1], [lon2, lat2], ...], ... ], ... ]
- Parameters:
description (None) – an optional description
info (None) – an optional info dict
read_only (False) – whether the field is read-only
created_at (None) – the datetime the field was created
Methods:
validate
(value)Perform validation on a value.
copy
()Returns a copy of the field.
error
([message, errors, field_name])Raise a ValidationError.
prepare_query_value
(op, value)Prepare a value that is being used in a query for PyMongo.
save
([_enforce_read_only])Saves any edits to this field's
description
andinfo
attributes.set_auto_dereferencing
(value)to_mongo
(value)Convert a Python type to a MongoDB-compatible type.
to_python
(value)Convert a MongoDB-compatible type to a Python type.
Attributes:
The datetime the field was created.
A user-editable description of the field.
A user-editable dictionary of information about the field.
The fully-qualified path of this field in the dataset's schema, or
None
if the field is not associated with a dataset.Whether the field is read-only.
- validate(value)#
Perform validation on a value.
- auto_creation_counter = -11#
- copy()#
Returns a copy of the field.
The returned copy is not associated with a dataset.
- Returns:
a
Field
- property created_at#
The datetime the field was created.
- creation_counter = 272#
- property description#
A user-editable description of the field.
Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") dataset.add_dynamic_sample_fields() field = dataset.get_field("ground_truth") field.description = "Ground truth annotations" field.save() field = dataset.get_field("ground_truth.detections.area") field.description = "Area of the box, in pixels^2" field.save() dataset.reload() field = dataset.get_field("ground_truth") print(field.description) # Ground truth annotations field = dataset.get_field("ground_truth.detections.area") print(field.description) # 'Area of the box, in pixels^2'
- error(message='', errors=None, field_name=None)#
Raise a ValidationError.
- property info#
A user-editable dictionary of information about the field.
Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") dataset.add_dynamic_sample_fields() field = dataset.get_field("ground_truth") field.info = {"url": "https://fiftyone.ai"} field.save() field = dataset.get_field("ground_truth.detections.area") field.info = {"url": "https://fiftyone.ai"} field.save() dataset.reload() field = dataset.get_field("ground_truth") print(field.info) # {'url': 'https://fiftyone.ai'} field = dataset.get_field("ground_truth.detections.area") print(field.info) # {'url': 'https://fiftyone.ai'}
- name = None#
- property owner_document#
- property path#
The fully-qualified path of this field in the dataset’s schema, or
None
if the field is not associated with a dataset.
- prepare_query_value(op, value)#
Prepare a value that is being used in a query for PyMongo.
- property read_only#
Whether the field is read-only.
Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") field = dataset.get_field("uniqueness") field.read_only = True field.save()
- save(_enforce_read_only=True)#
Saves any edits to this field’s
description
andinfo
attributes.Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") dataset.add_dynamic_sample_fields() field = dataset.get_field("ground_truth") field.description = "Ground truth annotations" field.info = {"url": "https://fiftyone.ai"} field.save() field = dataset.get_field("ground_truth.detections.area") field.description = "Area of the box, in pixels^2" field.info = {"url": "https://fiftyone.ai"} field.save() dataset.reload() field = dataset.get_field("ground_truth") print(field.description) # Ground truth annotations print(field.info) # {'url': 'https://fiftyone.ai'} field = dataset.get_field("ground_truth.detections.area") print(field.description) # 'Area of the box, in pixels^2' field.info = {"url": "https://fiftyone.ai"}
- set_auto_dereferencing(value)#
- to_mongo(value)#
Convert a Python type to a MongoDB-compatible type.
- to_python(value)#
Convert a MongoDB-compatible type to a Python type.
- class fiftyone.core.fields.VectorField(description=None, info=None, read_only=False, created_at=None, **kwargs)#
Bases:
BinaryField
,Field
A one-dimensional array field.
VectorField
instances accept numeric lists, tuples, and 1D numpy array values. The underlying data is serialized and stored in the database as zlib-compressed bytes generated bynumpy.save
and always retrieved as a numpy array.- Parameters:
description (None) – an optional description
info (None) – an optional info dict
read_only (False) – whether the field is read-only
created_at (None) – the datetime the field was created
Methods:
to_mongo
(value)Convert a Python type to a MongoDB-compatible type.
to_python
(value)Convert a MongoDB-compatible type to a Python type.
validate
(value)Perform validation on a value.
copy
()Returns a copy of the field.
error
([message, errors, field_name])Raise a ValidationError.
prepare_query_value
(op, value)Prepare a value that is being used in a query for PyMongo.
save
([_enforce_read_only])Saves any edits to this field's
description
andinfo
attributes.set_auto_dereferencing
(value)Attributes:
The datetime the field was created.
A user-editable description of the field.
A user-editable dictionary of information about the field.
The fully-qualified path of this field in the dataset's schema, or
None
if the field is not associated with a dataset.Whether the field is read-only.
- to_mongo(value)#
Convert a Python type to a MongoDB-compatible type.
- to_python(value)#
Convert a MongoDB-compatible type to a Python type.
- validate(value)#
Perform validation on a value.
- auto_creation_counter = -11#
- copy()#
Returns a copy of the field.
The returned copy is not associated with a dataset.
- Returns:
a
Field
- property created_at#
The datetime the field was created.
- creation_counter = 272#
- property description#
A user-editable description of the field.
Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") dataset.add_dynamic_sample_fields() field = dataset.get_field("ground_truth") field.description = "Ground truth annotations" field.save() field = dataset.get_field("ground_truth.detections.area") field.description = "Area of the box, in pixels^2" field.save() dataset.reload() field = dataset.get_field("ground_truth") print(field.description) # Ground truth annotations field = dataset.get_field("ground_truth.detections.area") print(field.description) # 'Area of the box, in pixels^2'
- error(message='', errors=None, field_name=None)#
Raise a ValidationError.
- property info#
A user-editable dictionary of information about the field.
Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") dataset.add_dynamic_sample_fields() field = dataset.get_field("ground_truth") field.info = {"url": "https://fiftyone.ai"} field.save() field = dataset.get_field("ground_truth.detections.area") field.info = {"url": "https://fiftyone.ai"} field.save() dataset.reload() field = dataset.get_field("ground_truth") print(field.info) # {'url': 'https://fiftyone.ai'} field = dataset.get_field("ground_truth.detections.area") print(field.info) # {'url': 'https://fiftyone.ai'}
- name = None#
- property owner_document#
- property path#
The fully-qualified path of this field in the dataset’s schema, or
None
if the field is not associated with a dataset.
- prepare_query_value(op, value)#
Prepare a value that is being used in a query for PyMongo.
- property read_only#
Whether the field is read-only.
Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") field = dataset.get_field("uniqueness") field.read_only = True field.save()
- save(_enforce_read_only=True)#
Saves any edits to this field’s
description
andinfo
attributes.Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") dataset.add_dynamic_sample_fields() field = dataset.get_field("ground_truth") field.description = "Ground truth annotations" field.info = {"url": "https://fiftyone.ai"} field.save() field = dataset.get_field("ground_truth.detections.area") field.description = "Area of the box, in pixels^2" field.info = {"url": "https://fiftyone.ai"} field.save() dataset.reload() field = dataset.get_field("ground_truth") print(field.description) # Ground truth annotations print(field.info) # {'url': 'https://fiftyone.ai'} field = dataset.get_field("ground_truth.detections.area") print(field.description) # 'Area of the box, in pixels^2' field.info = {"url": "https://fiftyone.ai"}
- set_auto_dereferencing(value)#
- class fiftyone.core.fields.ArrayField(description=None, info=None, read_only=False, created_at=None, **kwargs)#
Bases:
BinaryField
,Field
An n-dimensional array field.
ArrayField
instances accept numpy array values. The underlying data is serialized and stored in the database as zlib-compressed bytes generated bynumpy.save
and always retrieved as a numpy array.- Parameters:
description (None) – an optional description
info (None) – an optional info dict
read_only (False) – whether the field is read-only
created_at (None) – the datetime the field was created
Methods:
to_mongo
(value)Convert a Python type to a MongoDB-compatible type.
to_python
(value)Convert a MongoDB-compatible type to a Python type.
validate
(value)Perform validation on a value.
copy
()Returns a copy of the field.
error
([message, errors, field_name])Raise a ValidationError.
prepare_query_value
(op, value)Prepare a value that is being used in a query for PyMongo.
save
([_enforce_read_only])Saves any edits to this field's
description
andinfo
attributes.set_auto_dereferencing
(value)Attributes:
The datetime the field was created.
A user-editable description of the field.
A user-editable dictionary of information about the field.
The fully-qualified path of this field in the dataset's schema, or
None
if the field is not associated with a dataset.Whether the field is read-only.
- to_mongo(value)#
Convert a Python type to a MongoDB-compatible type.
- to_python(value)#
Convert a MongoDB-compatible type to a Python type.
- validate(value)#
Perform validation on a value.
- auto_creation_counter = -11#
- copy()#
Returns a copy of the field.
The returned copy is not associated with a dataset.
- Returns:
a
Field
- property created_at#
The datetime the field was created.
- creation_counter = 272#
- property description#
A user-editable description of the field.
Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") dataset.add_dynamic_sample_fields() field = dataset.get_field("ground_truth") field.description = "Ground truth annotations" field.save() field = dataset.get_field("ground_truth.detections.area") field.description = "Area of the box, in pixels^2" field.save() dataset.reload() field = dataset.get_field("ground_truth") print(field.description) # Ground truth annotations field = dataset.get_field("ground_truth.detections.area") print(field.description) # 'Area of the box, in pixels^2'
- error(message='', errors=None, field_name=None)#
Raise a ValidationError.
- property info#
A user-editable dictionary of information about the field.
Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") dataset.add_dynamic_sample_fields() field = dataset.get_field("ground_truth") field.info = {"url": "https://fiftyone.ai"} field.save() field = dataset.get_field("ground_truth.detections.area") field.info = {"url": "https://fiftyone.ai"} field.save() dataset.reload() field = dataset.get_field("ground_truth") print(field.info) # {'url': 'https://fiftyone.ai'} field = dataset.get_field("ground_truth.detections.area") print(field.info) # {'url': 'https://fiftyone.ai'}
- name = None#
- property owner_document#
- property path#
The fully-qualified path of this field in the dataset’s schema, or
None
if the field is not associated with a dataset.
- prepare_query_value(op, value)#
Prepare a value that is being used in a query for PyMongo.
- property read_only#
Whether the field is read-only.
Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") field = dataset.get_field("uniqueness") field.read_only = True field.save()
- save(_enforce_read_only=True)#
Saves any edits to this field’s
description
andinfo
attributes.Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") dataset.add_dynamic_sample_fields() field = dataset.get_field("ground_truth") field.description = "Ground truth annotations" field.info = {"url": "https://fiftyone.ai"} field.save() field = dataset.get_field("ground_truth.detections.area") field.description = "Area of the box, in pixels^2" field.info = {"url": "https://fiftyone.ai"} field.save() dataset.reload() field = dataset.get_field("ground_truth") print(field.description) # Ground truth annotations print(field.info) # {'url': 'https://fiftyone.ai'} field = dataset.get_field("ground_truth.detections.area") print(field.description) # 'Area of the box, in pixels^2' field.info = {"url": "https://fiftyone.ai"}
- set_auto_dereferencing(value)#
- class fiftyone.core.fields.FrameNumberField(description=None, info=None, read_only=False, created_at=None, **kwargs)#
Bases:
IntField
A video frame number field.
- Parameters:
description (None) – an optional description
info (None) – an optional info dict
read_only (False) – whether the field is read-only
created_at (None) – the datetime the field was created
Methods:
validate
(value)Perform validation on a value.
copy
()Returns a copy of the field.
error
([message, errors, field_name])Raise a ValidationError.
prepare_query_value
(op, value)Prepare a value that is being used in a query for PyMongo.
save
([_enforce_read_only])Saves any edits to this field's
description
andinfo
attributes.set_auto_dereferencing
(value)to_mongo
(value)Convert a Python type to a MongoDB-compatible type.
to_python
(value)Convert a MongoDB-compatible type to a Python type.
Attributes:
The datetime the field was created.
A user-editable description of the field.
A user-editable dictionary of information about the field.
The fully-qualified path of this field in the dataset's schema, or
None
if the field is not associated with a dataset.Whether the field is read-only.
- validate(value)#
Perform validation on a value.
- auto_creation_counter = -11#
- copy()#
Returns a copy of the field.
The returned copy is not associated with a dataset.
- Returns:
a
Field
- property created_at#
The datetime the field was created.
- creation_counter = 272#
- property description#
A user-editable description of the field.
Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") dataset.add_dynamic_sample_fields() field = dataset.get_field("ground_truth") field.description = "Ground truth annotations" field.save() field = dataset.get_field("ground_truth.detections.area") field.description = "Area of the box, in pixels^2" field.save() dataset.reload() field = dataset.get_field("ground_truth") print(field.description) # Ground truth annotations field = dataset.get_field("ground_truth.detections.area") print(field.description) # 'Area of the box, in pixels^2'
- error(message='', errors=None, field_name=None)#
Raise a ValidationError.
- property info#
A user-editable dictionary of information about the field.
Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") dataset.add_dynamic_sample_fields() field = dataset.get_field("ground_truth") field.info = {"url": "https://fiftyone.ai"} field.save() field = dataset.get_field("ground_truth.detections.area") field.info = {"url": "https://fiftyone.ai"} field.save() dataset.reload() field = dataset.get_field("ground_truth") print(field.info) # {'url': 'https://fiftyone.ai'} field = dataset.get_field("ground_truth.detections.area") print(field.info) # {'url': 'https://fiftyone.ai'}
- name = None#
- property owner_document#
- property path#
The fully-qualified path of this field in the dataset’s schema, or
None
if the field is not associated with a dataset.
- prepare_query_value(op, value)#
Prepare a value that is being used in a query for PyMongo.
- property read_only#
Whether the field is read-only.
Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") field = dataset.get_field("uniqueness") field.read_only = True field.save()
- save(_enforce_read_only=True)#
Saves any edits to this field’s
description
andinfo
attributes.Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") dataset.add_dynamic_sample_fields() field = dataset.get_field("ground_truth") field.description = "Ground truth annotations" field.info = {"url": "https://fiftyone.ai"} field.save() field = dataset.get_field("ground_truth.detections.area") field.description = "Area of the box, in pixels^2" field.info = {"url": "https://fiftyone.ai"} field.save() dataset.reload() field = dataset.get_field("ground_truth") print(field.description) # Ground truth annotations print(field.info) # {'url': 'https://fiftyone.ai'} field = dataset.get_field("ground_truth.detections.area") print(field.description) # 'Area of the box, in pixels^2' field.info = {"url": "https://fiftyone.ai"}
- set_auto_dereferencing(value)#
- to_mongo(value)#
Convert a Python type to a MongoDB-compatible type.
- to_python(value)#
Convert a MongoDB-compatible type to a Python type.
- class fiftyone.core.fields.FrameSupportField(**kwargs)#
Bases:
ListField
A
[first, last]
frame support in a video.- Parameters:
description (None) – an optional description
info (None) – an optional info dict
read_only (False) – whether the field is read-only
created_at (None) – the datetime the field was created
Methods:
validate
(value)Make sure that a list of valid fields is being used.
copy
()Returns a copy of the field.
error
([message, errors, field_name])Raise a ValidationError.
lookup_member
(member_name)prepare_query_value
(op, value)Prepare a value that is being used in a query for PyMongo.
save
([_enforce_read_only])Saves any edits to this field's
description
andinfo
attributes.set_auto_dereferencing
(value)to_mongo
(value[, use_db_field, fields])Convert a Python type to a MongoDB-compatible type.
to_python
(value)Convert a MongoDB-compatible type to a Python type.
Attributes:
The datetime the field was created.
A user-editable description of the field.
A user-editable dictionary of information about the field.
The fully-qualified path of this field in the dataset's schema, or
None
if the field is not associated with a dataset.Whether the field is read-only.
- validate(value)#
Make sure that a list of valid fields is being used.
- auto_creation_counter = -11#
- copy()#
Returns a copy of the field.
The returned copy is not associated with a dataset.
- Returns:
a
Field
- property created_at#
The datetime the field was created.
- creation_counter = 272#
- property description#
A user-editable description of the field.
Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") dataset.add_dynamic_sample_fields() field = dataset.get_field("ground_truth") field.description = "Ground truth annotations" field.save() field = dataset.get_field("ground_truth.detections.area") field.description = "Area of the box, in pixels^2" field.save() dataset.reload() field = dataset.get_field("ground_truth") print(field.description) # Ground truth annotations field = dataset.get_field("ground_truth.detections.area") print(field.description) # 'Area of the box, in pixels^2'
- error(message='', errors=None, field_name=None)#
Raise a ValidationError.
- property info#
A user-editable dictionary of information about the field.
Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") dataset.add_dynamic_sample_fields() field = dataset.get_field("ground_truth") field.info = {"url": "https://fiftyone.ai"} field.save() field = dataset.get_field("ground_truth.detections.area") field.info = {"url": "https://fiftyone.ai"} field.save() dataset.reload() field = dataset.get_field("ground_truth") print(field.info) # {'url': 'https://fiftyone.ai'} field = dataset.get_field("ground_truth.detections.area") print(field.info) # {'url': 'https://fiftyone.ai'}
- lookup_member(member_name)#
- name = None#
- property owner_document#
- property path#
The fully-qualified path of this field in the dataset’s schema, or
None
if the field is not associated with a dataset.
- prepare_query_value(op, value)#
Prepare a value that is being used in a query for PyMongo.
- property read_only#
Whether the field is read-only.
Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") field = dataset.get_field("uniqueness") field.read_only = True field.save()
- save(_enforce_read_only=True)#
Saves any edits to this field’s
description
andinfo
attributes.Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") dataset.add_dynamic_sample_fields() field = dataset.get_field("ground_truth") field.description = "Ground truth annotations" field.info = {"url": "https://fiftyone.ai"} field.save() field = dataset.get_field("ground_truth.detections.area") field.description = "Area of the box, in pixels^2" field.info = {"url": "https://fiftyone.ai"} field.save() dataset.reload() field = dataset.get_field("ground_truth") print(field.description) # Ground truth annotations print(field.info) # {'url': 'https://fiftyone.ai'} field = dataset.get_field("ground_truth.detections.area") print(field.description) # 'Area of the box, in pixels^2' field.info = {"url": "https://fiftyone.ai"}
- set_auto_dereferencing(value)#
- to_mongo(value, use_db_field=True, fields=None)#
Convert a Python type to a MongoDB-compatible type.
- to_python(value)#
Convert a MongoDB-compatible type to a Python type.
- class fiftyone.core.fields.ClassesField(**kwargs)#
Bases:
ListField
A
ListField
that stores class label strings.If this field is not set, its default value is
[]
.- Parameters:
description (None) – an optional description
info (None) – an optional info dict
read_only (False) – whether the field is read-only
created_at (None) – the datetime the field was created
Attributes:
The datetime the field was created.
A user-editable description of the field.
A user-editable dictionary of information about the field.
The fully-qualified path of this field in the dataset's schema, or
None
if the field is not associated with a dataset.Whether the field is read-only.
Methods:
copy
()Returns a copy of the field.
error
([message, errors, field_name])Raise a ValidationError.
lookup_member
(member_name)prepare_query_value
(op, value)Prepare a value that is being used in a query for PyMongo.
save
([_enforce_read_only])Saves any edits to this field's
description
andinfo
attributes.set_auto_dereferencing
(value)to_mongo
(value[, use_db_field, fields])Convert a Python type to a MongoDB-compatible type.
to_python
(value)Convert a MongoDB-compatible type to a Python type.
validate
(value)Make sure that a list of valid fields is being used.
- auto_creation_counter = -11#
- copy()#
Returns a copy of the field.
The returned copy is not associated with a dataset.
- Returns:
a
Field
- property created_at#
The datetime the field was created.
- creation_counter = 272#
- property description#
A user-editable description of the field.
Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") dataset.add_dynamic_sample_fields() field = dataset.get_field("ground_truth") field.description = "Ground truth annotations" field.save() field = dataset.get_field("ground_truth.detections.area") field.description = "Area of the box, in pixels^2" field.save() dataset.reload() field = dataset.get_field("ground_truth") print(field.description) # Ground truth annotations field = dataset.get_field("ground_truth.detections.area") print(field.description) # 'Area of the box, in pixels^2'
- error(message='', errors=None, field_name=None)#
Raise a ValidationError.
- property info#
A user-editable dictionary of information about the field.
Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") dataset.add_dynamic_sample_fields() field = dataset.get_field("ground_truth") field.info = {"url": "https://fiftyone.ai"} field.save() field = dataset.get_field("ground_truth.detections.area") field.info = {"url": "https://fiftyone.ai"} field.save() dataset.reload() field = dataset.get_field("ground_truth") print(field.info) # {'url': 'https://fiftyone.ai'} field = dataset.get_field("ground_truth.detections.area") print(field.info) # {'url': 'https://fiftyone.ai'}
- lookup_member(member_name)#
- name = None#
- property owner_document#
- property path#
The fully-qualified path of this field in the dataset’s schema, or
None
if the field is not associated with a dataset.
- prepare_query_value(op, value)#
Prepare a value that is being used in a query for PyMongo.
- property read_only#
Whether the field is read-only.
Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") field = dataset.get_field("uniqueness") field.read_only = True field.save()
- save(_enforce_read_only=True)#
Saves any edits to this field’s
description
andinfo
attributes.Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") dataset.add_dynamic_sample_fields() field = dataset.get_field("ground_truth") field.description = "Ground truth annotations" field.info = {"url": "https://fiftyone.ai"} field.save() field = dataset.get_field("ground_truth.detections.area") field.description = "Area of the box, in pixels^2" field.info = {"url": "https://fiftyone.ai"} field.save() dataset.reload() field = dataset.get_field("ground_truth") print(field.description) # Ground truth annotations print(field.info) # {'url': 'https://fiftyone.ai'} field = dataset.get_field("ground_truth.detections.area") print(field.description) # 'Area of the box, in pixels^2' field.info = {"url": "https://fiftyone.ai"}
- set_auto_dereferencing(value)#
- to_mongo(value, use_db_field=True, fields=None)#
Convert a Python type to a MongoDB-compatible type.
- to_python(value)#
Convert a MongoDB-compatible type to a Python type.
- validate(value)#
Make sure that a list of valid fields is being used.
- class fiftyone.core.fields.MaskTargetsField(**kwargs)#
Bases:
DictField
A
DictField
that stores mapping between integer keys or RGB string hex keys and string targets.If this field is not set, its default value is
{}
.- Parameters:
description (None) – an optional description
info (None) – an optional info dict
read_only (False) – whether the field is read-only
created_at (None) – the datetime the field was created
Methods:
to_mongo
(value)Convert a Python type to a MongoDB-compatible type.
to_python
(value)Convert a MongoDB-compatible type to a Python type.
validate
(value)Make sure that a list of valid fields is being used.
copy
()Returns a copy of the field.
error
([message, errors, field_name])Raise a ValidationError.
lookup_member
(member_name)prepare_query_value
(op, value)Prepare a value that is being used in a query for PyMongo.
save
([_enforce_read_only])Saves any edits to this field's
description
andinfo
attributes.set_auto_dereferencing
(value)Attributes:
The datetime the field was created.
A user-editable description of the field.
A user-editable dictionary of information about the field.
The fully-qualified path of this field in the dataset's schema, or
None
if the field is not associated with a dataset.Whether the field is read-only.
- to_mongo(value)#
Convert a Python type to a MongoDB-compatible type.
- to_python(value)#
Convert a MongoDB-compatible type to a Python type.
- validate(value)#
Make sure that a list of valid fields is being used.
- auto_creation_counter = -11#
- copy()#
Returns a copy of the field.
The returned copy is not associated with a dataset.
- Returns:
a
Field
- property created_at#
The datetime the field was created.
- creation_counter = 272#
- property description#
A user-editable description of the field.
Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") dataset.add_dynamic_sample_fields() field = dataset.get_field("ground_truth") field.description = "Ground truth annotations" field.save() field = dataset.get_field("ground_truth.detections.area") field.description = "Area of the box, in pixels^2" field.save() dataset.reload() field = dataset.get_field("ground_truth") print(field.description) # Ground truth annotations field = dataset.get_field("ground_truth.detections.area") print(field.description) # 'Area of the box, in pixels^2'
- error(message='', errors=None, field_name=None)#
Raise a ValidationError.
- property info#
A user-editable dictionary of information about the field.
Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") dataset.add_dynamic_sample_fields() field = dataset.get_field("ground_truth") field.info = {"url": "https://fiftyone.ai"} field.save() field = dataset.get_field("ground_truth.detections.area") field.info = {"url": "https://fiftyone.ai"} field.save() dataset.reload() field = dataset.get_field("ground_truth") print(field.info) # {'url': 'https://fiftyone.ai'} field = dataset.get_field("ground_truth.detections.area") print(field.info) # {'url': 'https://fiftyone.ai'}
- lookup_member(member_name)#
- name = None#
- property owner_document#
- property path#
The fully-qualified path of this field in the dataset’s schema, or
None
if the field is not associated with a dataset.
- prepare_query_value(op, value)#
Prepare a value that is being used in a query for PyMongo.
- property read_only#
Whether the field is read-only.
Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") field = dataset.get_field("uniqueness") field.read_only = True field.save()
- save(_enforce_read_only=True)#
Saves any edits to this field’s
description
andinfo
attributes.Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") dataset.add_dynamic_sample_fields() field = dataset.get_field("ground_truth") field.description = "Ground truth annotations" field.info = {"url": "https://fiftyone.ai"} field.save() field = dataset.get_field("ground_truth.detections.area") field.description = "Area of the box, in pixels^2" field.info = {"url": "https://fiftyone.ai"} field.save() dataset.reload() field = dataset.get_field("ground_truth") print(field.description) # Ground truth annotations print(field.info) # {'url': 'https://fiftyone.ai'} field = dataset.get_field("ground_truth.detections.area") print(field.description) # 'Area of the box, in pixels^2' field.info = {"url": "https://fiftyone.ai"}
- set_auto_dereferencing(value)#
- fiftyone.core.fields.is_integer_mask_targets(mask_targets)#
Determines whether the provided mask targets use integer keys.
- Parameters:
mask_targets – a mask targets dict
- Returns:
True/False
- fiftyone.core.fields.is_integer_target(target)#
Determines whether the provided target is an integer.
- Parameters:
target – an integer or RGB hex string
- Returns:
True/False
- fiftyone.core.fields.is_rgb_mask_targets(mask_targets)#
Determines whether the provided mask targets use RGB hex string keys.
- Parameters:
mask_targets – a mask targets dict
- Returns:
True/False
- fiftyone.core.fields.is_rgb_target(target)#
Determines whether the provided target is an RGB string.
- Parameters:
target – an integer or RGB hex string
- Returns:
True/False
- fiftyone.core.fields.hex_to_int(hex_str)#
Converts a hex string like “#ff6d04” to a hex integer.
- Parameters:
hex_str – a hex string
- Returns:
an integer
- fiftyone.core.fields.int_to_hex(value)#
Converts an RRGGBB integer value to hex string like “#ff6d04”.
- Parameters:
value – an integer value
- Returns:
a hex string
- fiftyone.core.fields.rgb_array_to_int(mask)#
Converts an RGB mask array to a 2D hex integer mask array.
- Parameters:
mask – an RGB mask array
- Returns:
a 2D integer mask array
- fiftyone.core.fields.int_array_to_rgb(mask)#
Converts a 2D hex integer mask array to an RGB mask array.
- Parameters:
mask – a 2D integer mask array
- Returns:
an RGB mask array
- class fiftyone.core.fields.EmbeddedDocumentField(document_type, description=None, info=None, read_only=False, created_at=None, **kwargs)#
Bases:
EmbeddedDocumentField
,Field
A field that stores instances of a given type of
fiftyone.core.odm.BaseEmbeddedDocument
object.- Parameters:
document_type – the
fiftyone.core.odm.BaseEmbeddedDocument
type stored in this fielddescription (None) – an optional description
info (None) – an optional info dict
read_only (False) – whether the field is read-only
created_at (None) – the datetime the field was created
Methods:
has_field
(path)Determines whether this field has the given embedded field.
get_field
(path)Returns the field for the provided path, or
None
.get_field_schema
([ftype, embedded_doc_type, ...])Returns a schema dictionary describing the fields of the embedded document field.
validate
(value, **kwargs)Make sure that the document instance is an instance of the EmbeddedDocument subclass provided when the document was defined.
copy
()Returns a copy of the field.
error
([message, errors, field_name])Raise a ValidationError.
lookup_member
(member_name)prepare_query_value
(op, value)Prepare a value that is being used in a query for PyMongo.
save
([_enforce_read_only])Saves any edits to this field's
description
andinfo
attributes.set_auto_dereferencing
(value)to_mongo
(value[, use_db_field, fields])Convert a Python type to a MongoDB-compatible type.
to_python
(value)Convert a MongoDB-compatible type to a Python type.
Attributes:
The datetime the field was created.
A user-editable description of the field.
A user-editable dictionary of information about the field.
The fully-qualified path of this field in the dataset's schema, or
None
if the field is not associated with a dataset.Whether the field is read-only.
- has_field(path)#
Determines whether this field has the given embedded field.
- Parameters:
path – the field name or
embedded.field.name
- Returns:
True/False
- get_field(path)#
Returns the field for the provided path, or
None
.- Parameters:
path – a field name or
embedded.field.name
- Returns:
a
Field
instance orNone
- get_field_schema(ftype=None, embedded_doc_type=None, subfield=None, read_only=None, include_private=False, flat=False, unwind=True, mode=None)#
Returns a schema dictionary describing the fields of the embedded document field.
- Parameters:
ftype (None) – an optional field type or iterable of types to which to restrict the returned schema. Must be subclass(es) of
Field
embedded_doc_type (None) – an optional embedded document type or iterable of types to which to restrict the returned schema. Must be subclass(es) of
fiftyone.core.odm.BaseEmbeddedDocument
subfield (None) – an optional subfield type or iterable of subfield types to which to restrict the returned schema. Must be subclass(es) of
Field
read_only (None) – whether to restrict to (True) or exclude (False) read-only fields. By default, all fields are included
include_private (False) – whether to include fields that start with
_
in the returned schemaflat (False) – whether to return a flattened schema where all embedded document fields are included as top-level keys
unwind (True) – whether to traverse into list fields. Only applicable when
flat=True
mode (None) – whether to apply the above constraints before and/or after flattening the schema. Only applicable when
flat=True
. Supported values are("before", "after", "both")
. The default is"after"
- Returns:
a dict mapping field names to
Field
instances
- validate(value, **kwargs)#
Make sure that the document instance is an instance of the EmbeddedDocument subclass provided when the document was defined.
- auto_creation_counter = -11#
- copy()#
Returns a copy of the field.
The returned copy is not associated with a dataset.
- Returns:
a
Field
- property created_at#
The datetime the field was created.
- creation_counter = 272#
- property description#
A user-editable description of the field.
Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") dataset.add_dynamic_sample_fields() field = dataset.get_field("ground_truth") field.description = "Ground truth annotations" field.save() field = dataset.get_field("ground_truth.detections.area") field.description = "Area of the box, in pixels^2" field.save() dataset.reload() field = dataset.get_field("ground_truth") print(field.description) # Ground truth annotations field = dataset.get_field("ground_truth.detections.area") print(field.description) # 'Area of the box, in pixels^2'
- property document_type#
- error(message='', errors=None, field_name=None)#
Raise a ValidationError.
- property info#
A user-editable dictionary of information about the field.
Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") dataset.add_dynamic_sample_fields() field = dataset.get_field("ground_truth") field.info = {"url": "https://fiftyone.ai"} field.save() field = dataset.get_field("ground_truth.detections.area") field.info = {"url": "https://fiftyone.ai"} field.save() dataset.reload() field = dataset.get_field("ground_truth") print(field.info) # {'url': 'https://fiftyone.ai'} field = dataset.get_field("ground_truth.detections.area") print(field.info) # {'url': 'https://fiftyone.ai'}
- lookup_member(member_name)#
- name = None#
- property owner_document#
- property path#
The fully-qualified path of this field in the dataset’s schema, or
None
if the field is not associated with a dataset.
- prepare_query_value(op, value)#
Prepare a value that is being used in a query for PyMongo.
- property read_only#
Whether the field is read-only.
Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") field = dataset.get_field("uniqueness") field.read_only = True field.save()
- save(_enforce_read_only=True)#
Saves any edits to this field’s
description
andinfo
attributes.Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") dataset.add_dynamic_sample_fields() field = dataset.get_field("ground_truth") field.description = "Ground truth annotations" field.info = {"url": "https://fiftyone.ai"} field.save() field = dataset.get_field("ground_truth.detections.area") field.description = "Area of the box, in pixels^2" field.info = {"url": "https://fiftyone.ai"} field.save() dataset.reload() field = dataset.get_field("ground_truth") print(field.description) # Ground truth annotations print(field.info) # {'url': 'https://fiftyone.ai'} field = dataset.get_field("ground_truth.detections.area") print(field.description) # 'Area of the box, in pixels^2' field.info = {"url": "https://fiftyone.ai"}
- set_auto_dereferencing(value)#
- to_mongo(value, use_db_field=True, fields=None)#
Convert a Python type to a MongoDB-compatible type.
- to_python(value)#
Convert a MongoDB-compatible type to a Python type.
- class fiftyone.core.fields.EmbeddedDocumentListField(document_type, description=None, info=None, read_only=False, created_at=None, **kwargs)#
Bases:
EmbeddedDocumentListField
,Field
A field that stores a list of a given type of
fiftyone.core.odm.BaseEmbeddedDocument
objects.- Parameters:
document_type – the
fiftyone.core.odm.BaseEmbeddedDocument
type stored in this fielddescription (None) – an optional description
info (None) – an optional info dict
read_only (False) – whether the field is read-only
created_at (None) – the datetime the field was created
Attributes:
The datetime the field was created.
A user-editable description of the field.
A user-editable dictionary of information about the field.
The fully-qualified path of this field in the dataset's schema, or
None
if the field is not associated with a dataset.Whether the field is read-only.
Methods:
copy
()Returns a copy of the field.
error
([message, errors, field_name])Raise a ValidationError.
lookup_member
(member_name)prepare_query_value
(op, value)Prepare a value that is being used in a query for PyMongo.
save
([_enforce_read_only])Saves any edits to this field's
description
andinfo
attributes.set_auto_dereferencing
(value)to_mongo
(value[, use_db_field, fields])Convert a Python type to a MongoDB-compatible type.
to_python
(value)Convert a MongoDB-compatible type to a Python type.
validate
(value)Make sure that a list of valid fields is being used.
- auto_creation_counter = -11#
- copy()#
Returns a copy of the field.
The returned copy is not associated with a dataset.
- Returns:
a
Field
- property created_at#
The datetime the field was created.
- creation_counter = 272#
- property description#
A user-editable description of the field.
Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") dataset.add_dynamic_sample_fields() field = dataset.get_field("ground_truth") field.description = "Ground truth annotations" field.save() field = dataset.get_field("ground_truth.detections.area") field.description = "Area of the box, in pixels^2" field.save() dataset.reload() field = dataset.get_field("ground_truth") print(field.description) # Ground truth annotations field = dataset.get_field("ground_truth.detections.area") print(field.description) # 'Area of the box, in pixels^2'
- error(message='', errors=None, field_name=None)#
Raise a ValidationError.
- property info#
A user-editable dictionary of information about the field.
Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") dataset.add_dynamic_sample_fields() field = dataset.get_field("ground_truth") field.info = {"url": "https://fiftyone.ai"} field.save() field = dataset.get_field("ground_truth.detections.area") field.info = {"url": "https://fiftyone.ai"} field.save() dataset.reload() field = dataset.get_field("ground_truth") print(field.info) # {'url': 'https://fiftyone.ai'} field = dataset.get_field("ground_truth.detections.area") print(field.info) # {'url': 'https://fiftyone.ai'}
- lookup_member(member_name)#
- name = None#
- property owner_document#
- property path#
The fully-qualified path of this field in the dataset’s schema, or
None
if the field is not associated with a dataset.
- prepare_query_value(op, value)#
Prepare a value that is being used in a query for PyMongo.
- property read_only#
Whether the field is read-only.
Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") field = dataset.get_field("uniqueness") field.read_only = True field.save()
- save(_enforce_read_only=True)#
Saves any edits to this field’s
description
andinfo
attributes.Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") dataset.add_dynamic_sample_fields() field = dataset.get_field("ground_truth") field.description = "Ground truth annotations" field.info = {"url": "https://fiftyone.ai"} field.save() field = dataset.get_field("ground_truth.detections.area") field.description = "Area of the box, in pixels^2" field.info = {"url": "https://fiftyone.ai"} field.save() dataset.reload() field = dataset.get_field("ground_truth") print(field.description) # Ground truth annotations print(field.info) # {'url': 'https://fiftyone.ai'} field = dataset.get_field("ground_truth.detections.area") print(field.description) # 'Area of the box, in pixels^2' field.info = {"url": "https://fiftyone.ai"}
- set_auto_dereferencing(value)#
- to_mongo(value, use_db_field=True, fields=None)#
Convert a Python type to a MongoDB-compatible type.
- to_python(value)#
Convert a MongoDB-compatible type to a Python type.
- validate(value)#
Make sure that a list of valid fields is being used.
- class fiftyone.core.fields.ReferenceField(document_type, dbref=False, reverse_delete_rule=0, **kwargs)#
Bases:
ReferenceField
,Field
A reference field.
- Parameters:
document_type – the
fiftyone.core.odm.Document
type stored in this field
Attributes:
The datetime the field was created.
A user-editable description of the field.
A user-editable dictionary of information about the field.
The fully-qualified path of this field in the dataset's schema, or
None
if the field is not associated with a dataset.Whether the field is read-only.
Methods:
copy
()Returns a copy of the field.
error
([message, errors, field_name])Raise a ValidationError.
lookup_member
(member_name)prepare_query_value
(op, value)Prepare a value that is being used in a query for PyMongo.
save
([_enforce_read_only])Saves any edits to this field's
description
andinfo
attributes.set_auto_dereferencing
(value)to_mongo
(document)Convert a Python type to a MongoDB-compatible type.
to_python
(value)Convert a MongoDB-compatible type to a Python type.
validate
(value)Perform validation on a value.
- auto_creation_counter = -11#
- copy()#
Returns a copy of the field.
The returned copy is not associated with a dataset.
- Returns:
a
Field
- property created_at#
The datetime the field was created.
- creation_counter = 272#
- property description#
A user-editable description of the field.
Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") dataset.add_dynamic_sample_fields() field = dataset.get_field("ground_truth") field.description = "Ground truth annotations" field.save() field = dataset.get_field("ground_truth.detections.area") field.description = "Area of the box, in pixels^2" field.save() dataset.reload() field = dataset.get_field("ground_truth") print(field.description) # Ground truth annotations field = dataset.get_field("ground_truth.detections.area") print(field.description) # 'Area of the box, in pixels^2'
- property document_type#
- error(message='', errors=None, field_name=None)#
Raise a ValidationError.
- property info#
A user-editable dictionary of information about the field.
Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") dataset.add_dynamic_sample_fields() field = dataset.get_field("ground_truth") field.info = {"url": "https://fiftyone.ai"} field.save() field = dataset.get_field("ground_truth.detections.area") field.info = {"url": "https://fiftyone.ai"} field.save() dataset.reload() field = dataset.get_field("ground_truth") print(field.info) # {'url': 'https://fiftyone.ai'} field = dataset.get_field("ground_truth.detections.area") print(field.info) # {'url': 'https://fiftyone.ai'}
- lookup_member(member_name)#
- name = None#
- property owner_document#
- property path#
The fully-qualified path of this field in the dataset’s schema, or
None
if the field is not associated with a dataset.
- prepare_query_value(op, value)#
Prepare a value that is being used in a query for PyMongo.
- property read_only#
Whether the field is read-only.
Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") field = dataset.get_field("uniqueness") field.read_only = True field.save()
- save(_enforce_read_only=True)#
Saves any edits to this field’s
description
andinfo
attributes.Examples:
import fiftyone as fo import fiftyone.zoo as foz dataset = foz.load_zoo_dataset("quickstart") dataset.add_dynamic_sample_fields() field = dataset.get_field("ground_truth") field.description = "Ground truth annotations" field.info = {"url": "https://fiftyone.ai"} field.save() field = dataset.get_field("ground_truth.detections.area") field.description = "Area of the box, in pixels^2" field.info = {"url": "https://fiftyone.ai"} field.save() dataset.reload() field = dataset.get_field("ground_truth") print(field.description) # Ground truth annotations print(field.info) # {'url': 'https://fiftyone.ai'} field = dataset.get_field("ground_truth.detections.area") print(field.description) # 'Area of the box, in pixels^2' field.info = {"url": "https://fiftyone.ai"}
- set_auto_dereferencing(value)#
- to_mongo(document)#
Convert a Python type to a MongoDB-compatible type.
- to_python(value)#
Convert a MongoDB-compatible type to a Python type.
- validate(value)#
Perform validation on a value.