fiftyone.core.fields#

Dataset sample fields.

Copyright 2017-2025, Voxel51, Inc.

Functions:

validate_constraints([ftype, ...])

Validates the given field constraints.

matches_constraints(field[, ftype, ...])

Determines whether the field matches the given constraints.

validate_field(field[, path, ftype, ...])

Validates that the field matches the given constraints.

get_field_metadata(field)

Returns a dict of editable metadata for the given field.

filter_schema(schema[, ftype, ...])

Filters the schema according to the given constraints.

flatten_schema(schema[, ftype, ...])

Returns a flat version of the given schema where all embedded document fields are included as top-level keys.

is_integer_mask_targets(mask_targets)

Determines whether the provided mask targets use integer keys.

is_integer_target(target)

Determines whether the provided target is an integer.

is_rgb_mask_targets(mask_targets)

Determines whether the provided mask targets use RGB hex string keys.

is_rgb_target(target)

Determines whether the provided target is an RGB string.

hex_to_int(hex_str)

Converts a hex string like "#ff6d04" to a hex integer.

int_to_hex(value)

Converts an RRGGBB integer value to hex string like "#ff6d04".

rgb_array_to_int(mask)

Converts an RGB mask array to a 2D hex integer mask array.

int_array_to_rgb(mask)

Converts a 2D hex integer mask array to an RGB mask array.

Classes:

Field([description, info, read_only, created_at])

A generic field.

IntField([description, info, read_only, ...])

A 32 bit integer field.

ObjectIdField([description, info, ...])

An Object ID field.

UUIDField([description, info, read_only, ...])

A UUID field.

BooleanField([description, info, read_only, ...])

A boolean field.

DateField([description, info, read_only, ...])

A date field.

DateTimeField([description, info, ...])

A datetime field.

FloatField([description, info, read_only, ...])

A floating point number field.

StringField([description, info, read_only, ...])

A unicode string field.

ColorField([description, info, read_only, ...])

A string field that holds a hex color string like '#FF6D04'.

ListField([field, description, info, ...])

A list field that wraps a standard Field, allowing multiple instances of the field to be stored as a list in the database.

HeatmapRangeField(**kwargs)

A [min, max] range of the values in a fiftyone.core.labels.Heatmap.

DictField([field, description, info, ...])

A dictionary field that wraps a standard Python dictionary.

KeypointsField([field, description, info, ...])

A list of (x, y) coordinate pairs.

PolylinePointsField([field, description, ...])

A list of lists of (x, y) coordinate pairs.

GeoPointField([description, info, ...])

A GeoJSON field storing a longitude and latitude coordinate point.

GeoLineStringField([description, info, ...])

A GeoJSON field storing a line of longitude and latitude coordinates.

GeoPolygonField([description, info, ...])

A GeoJSON field storing a polygon of longitude and latitude coordinates.

GeoMultiPointField([description, info, ...])

A GeoJSON field storing a list of points.

GeoMultiLineStringField([description, info, ...])

A GeoJSON field storing a list of lines.

GeoMultiPolygonField([description, info, ...])

A GeoJSON field storing a list of polygons.

VectorField([description, info, read_only, ...])

A one-dimensional array field.

ArrayField([description, info, read_only, ...])

An n-dimensional array field.

FrameNumberField([description, info, ...])

A video frame number field.

FrameSupportField(**kwargs)

A [first, last] frame support in a video.

ClassesField(**kwargs)

A ListField that stores class label strings.

MaskTargetsField(**kwargs)

A DictField that stores mapping between integer keys or RGB string hex keys and string targets.

EmbeddedDocumentField(document_type[, ...])

A field that stores instances of a given type of fiftyone.core.odm.BaseEmbeddedDocument object.

EmbeddedDocumentListField(document_type[, ...])

A field that stores a list of a given type of fiftyone.core.odm.BaseEmbeddedDocument objects.

ReferenceField(document_type[, dbref, ...])

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 dict

  • created_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 dict

  • created_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 messages

  • 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)

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 instances

  • 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

  • info_keys (None) – an optional key or list of keys that must be in the field’s info dict

  • created_after (None) – an optional datetime specifying a minimum creation date

  • include_private (False) – whether to include fields that start with _ in the returned schema

  • flat (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 instances

  • 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

  • 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 dict

  • created_after (None) – an optional datetime specifying a minimum creation date

  • include_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:

path

The fully-qualified path of this field in the dataset's schema, or None if the field is not associated with a dataset.

description

A user-editable description of the field.

info

A user-editable dictionary of information about the field.

read_only

Whether the field is read-only.

created_at

The datetime the field was created.

auto_creation_counter

creation_counter

name

owner_document

Methods:

copy()

Returns a copy of the field.

save([_enforce_read_only])

Saves any edits to this field's description and info 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 and info 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)#

Bases: IntField, Field

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 and info 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:

auto_creation_counter

created_at

The datetime the field was created.

creation_counter

description

A user-editable description of the field.

info

A user-editable dictionary of information about the field.

name

owner_document

path

The fully-qualified path of this field in the dataset's schema, or None if the field is not associated with a dataset.

read_only

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 and info 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 and info attributes.

set_auto_dereferencing(value)

validate(value)

Perform validation on a value.

Attributes:

auto_creation_counter

created_at

The datetime the field was created.

creation_counter

description

A user-editable description of the field.

info

A user-editable dictionary of information about the field.

name

owner_document

path

The fully-qualified path of this field in the dataset's schema, or None if the field is not associated with a dataset.

read_only

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 and info 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)#

Bases: UUIDField, Field

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:

auto_creation_counter

created_at

The datetime the field was created.

creation_counter

description

A user-editable description of the field.

info

A user-editable dictionary of information about the field.

name

owner_document

path

The fully-qualified path of this field in the dataset's schema, or None if the field is not associated with a dataset.

read_only

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 and info 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 and info 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 and info 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:

auto_creation_counter

created_at

The datetime the field was created.

creation_counter

description

A user-editable description of the field.

info

A user-editable dictionary of information about the field.

name

owner_document

path

The fully-qualified path of this field in the dataset's schema, or None if the field is not associated with a dataset.

read_only

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 and info 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 and info attributes.

set_auto_dereferencing(value)

Attributes:

auto_creation_counter

created_at

The datetime the field was created.

creation_counter

description

A user-editable description of the field.

info

A user-editable dictionary of information about the field.

name

owner_document

path

The fully-qualified path of this field in the dataset's schema, or None if the field is not associated with a dataset.

read_only

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 and info 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 and info 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:

auto_creation_counter

created_at

The datetime the field was created.

creation_counter

description

A user-editable description of the field.

info

A user-editable dictionary of information about the field.

name

owner_document

path

The fully-qualified path of this field in the dataset's schema, or None if the field is not associated with a dataset.

read_only

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 and info 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 and info attributes.

set_auto_dereferencing(value)

to_python(value)

Convert a MongoDB-compatible type to a Python type.

Attributes:

auto_creation_counter

created_at

The datetime the field was created.

creation_counter

description

A user-editable description of the field.

info

A user-editable dictionary of information about the field.

name

owner_document

path

The fully-qualified path of this field in the dataset's schema, or None if the field is not associated with a dataset.

read_only

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 and info 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:

auto_creation_counter

created_at

The datetime the field was created.

creation_counter

description

A user-editable description of the field.

info

A user-editable dictionary of information about the field.

name

owner_document

path

The fully-qualified path of this field in the dataset's schema, or None if the field is not associated with a dataset.

read_only

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 and info 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 and info 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 and info 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:

auto_creation_counter

created_at

The datetime the field was created.

creation_counter

description

A user-editable description of the field.

info

A user-editable dictionary of information about the field.

name

owner_document

path

The fully-qualified path of this field in the dataset's schema, or None if the field is not associated with a dataset.

read_only

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 and info 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)#

Bases: ListField, Field

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 elements

  • 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:

auto_creation_counter

created_at

The datetime the field was created.

creation_counter

description

A user-editable description of the field.

info

A user-editable dictionary of information about the field.

name

owner_document

path

The fully-qualified path of this field in the dataset's schema, or None if the field is not associated with a dataset.

read_only

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 and info 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 and info 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 a fiftyone.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 and info 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:

auto_creation_counter

created_at

The datetime the field was created.

creation_counter

description

A user-editable description of the field.

info

A user-editable dictionary of information about the field.

name

owner_document

path

The fully-qualified path of this field in the dataset's schema, or None if the field is not associated with a dataset.

read_only

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 and info 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)#

Bases: DictField, Field

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 dict

  • 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 and info 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:

auto_creation_counter

created_at

The datetime the field was created.

creation_counter

description

A user-editable description of the field.

info

A user-editable dictionary of information about the field.

name

owner_document

path

The fully-qualified path of this field in the dataset's schema, or None if the field is not associated with a dataset.

read_only

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 and info 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 and info 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:

auto_creation_counter

created_at

The datetime the field was created.

creation_counter

description

A user-editable description of the field.

info

A user-editable dictionary of information about the field.

name

owner_document

path

The fully-qualified path of this field in the dataset's schema, or None if the field is not associated with a dataset.

read_only

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 and info 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 and info 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:

auto_creation_counter

created_at

The datetime the field was created.

creation_counter

description

A user-editable description of the field.

info

A user-editable dictionary of information about the field.

name

owner_document

path

The fully-qualified path of this field in the dataset's schema, or None if the field is not associated with a dataset.

read_only

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 and info 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 and info 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:

auto_creation_counter

created_at

The datetime the field was created.

creation_counter

description

A user-editable description of the field.

info

A user-editable dictionary of information about the field.

name

owner_document

path

The fully-qualified path of this field in the dataset's schema, or None if the field is not associated with a dataset.

read_only

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 and info 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 and info 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:

auto_creation_counter

created_at

The datetime the field was created.

creation_counter

description

A user-editable description of the field.

info

A user-editable dictionary of information about the field.

name

owner_document

path

The fully-qualified path of this field in the dataset's schema, or None if the field is not associated with a dataset.

read_only

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 and info 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 and info 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:

auto_creation_counter

created_at

The datetime the field was created.

creation_counter

description

A user-editable description of the field.

info

A user-editable dictionary of information about the field.

name

owner_document

path

The fully-qualified path of this field in the dataset's schema, or None if the field is not associated with a dataset.

read_only

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 and info 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 and info 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:

auto_creation_counter

created_at

The datetime the field was created.

creation_counter

description

A user-editable description of the field.

info

A user-editable dictionary of information about the field.

name

owner_document

path

The fully-qualified path of this field in the dataset's schema, or None if the field is not associated with a dataset.

read_only

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 and info 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 and info 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:

auto_creation_counter

created_at

The datetime the field was created.

creation_counter

description

A user-editable description of the field.

info

A user-editable dictionary of information about the field.

name

owner_document

path

The fully-qualified path of this field in the dataset's schema, or None if the field is not associated with a dataset.

read_only

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 and info 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 and info 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:

auto_creation_counter

created_at

The datetime the field was created.

creation_counter

description

A user-editable description of the field.

info

A user-editable dictionary of information about the field.

name

owner_document

path

The fully-qualified path of this field in the dataset's schema, or None if the field is not associated with a dataset.

read_only

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 and info 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 by numpy.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 and info attributes.

set_auto_dereferencing(value)

Attributes:

auto_creation_counter

created_at

The datetime the field was created.

creation_counter

description

A user-editable description of the field.

info

A user-editable dictionary of information about the field.

name

owner_document

path

The fully-qualified path of this field in the dataset's schema, or None if the field is not associated with a dataset.

read_only

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 and info 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 by numpy.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 and info attributes.

set_auto_dereferencing(value)

Attributes:

auto_creation_counter

created_at

The datetime the field was created.

creation_counter

description

A user-editable description of the field.

info

A user-editable dictionary of information about the field.

name

owner_document

path

The fully-qualified path of this field in the dataset's schema, or None if the field is not associated with a dataset.

read_only

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 and info 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 and info 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:

auto_creation_counter

created_at

The datetime the field was created.

creation_counter

description

A user-editable description of the field.

info

A user-editable dictionary of information about the field.

name

owner_document

path

The fully-qualified path of this field in the dataset's schema, or None if the field is not associated with a dataset.

read_only

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 and info 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 and info 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:

auto_creation_counter

created_at

The datetime the field was created.

creation_counter

description

A user-editable description of the field.

info

A user-editable dictionary of information about the field.

name

owner_document

path

The fully-qualified path of this field in the dataset's schema, or None if the field is not associated with a dataset.

read_only

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 and info 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:

auto_creation_counter

created_at

The datetime the field was created.

creation_counter

description

A user-editable description of the field.

info

A user-editable dictionary of information about the field.

name

owner_document

path

The fully-qualified path of this field in the dataset's schema, or None if the field is not associated with a dataset.

read_only

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 and info 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 and info 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 and info attributes.

set_auto_dereferencing(value)

Attributes:

auto_creation_counter

created_at

The datetime the field was created.

creation_counter

description

A user-editable description of the field.

info

A user-editable dictionary of information about the field.

name

owner_document

path

The fully-qualified path of this field in the dataset's schema, or None if the field is not associated with a dataset.

read_only

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 and info 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 field

  • 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:

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 and info 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:

auto_creation_counter

created_at

The datetime the field was created.

creation_counter

description

A user-editable description of the field.

document_type

info

A user-editable dictionary of information about the field.

name

owner_document

path

The fully-qualified path of this field in the dataset's schema, or None if the field is not associated with a dataset.

read_only

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 or None

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 schema

  • flat (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 and info 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 field

  • 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:

auto_creation_counter

created_at

The datetime the field was created.

creation_counter

description

A user-editable description of the field.

info

A user-editable dictionary of information about the field.

name

owner_document

path

The fully-qualified path of this field in the dataset's schema, or None if the field is not associated with a dataset.

read_only

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 and info 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 and info 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:

auto_creation_counter

created_at

The datetime the field was created.

creation_counter

description

A user-editable description of the field.

document_type

info

A user-editable dictionary of information about the field.

name

owner_document

path

The fully-qualified path of this field in the dataset's schema, or None if the field is not associated with a dataset.

read_only

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 and info 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 and info 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.