class documentation

A generic field.

Parameters
descriptionan optional description
infoan optional info dict
read_onlywhether the field is read-only
created_atthe datetime the field was created
Method __init__ Undocumented
Method __str__ Undocumented
Method copy Returns a copy of the field.
Method description.setter Undocumented
Method info.setter Undocumented
Method read_only.setter Undocumented
Method save Saves any edits to this field's description and info attributes.
Property created_at The datetime the field was created.
Property description A user-editable description of the field.
Property info A user-editable dictionary of information about the field.
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 read_only Whether the field is read-only.
Method _set_created_at Undocumented
Method _set_dataset Undocumented
Instance Variable __dataset Undocumented
Instance Variable __path Undocumented
Instance Variable _created_at Undocumented
Instance Variable _description Undocumented
Instance Variable _info Undocumented
Instance Variable _read_only Undocumented
Property _dataset The fiftyone.core.dataset.Dataset that this field belongs to, or None if the field is not associated with a dataset.
def copy(self): (source)

Returns a copy of the field.

The returned copy is not associated with a dataset.

Returns
a Field
@description.setter
def description(self, description): (source)

Undocumented

@info.setter
def info(self, info): (source)

Undocumented

@read_only.setter
def read_only(self, read_only): (source)

Undocumented

def save(self, _enforce_read_only=True): (source)

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"}
@property
description = (source)

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'

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'}

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

def _set_created_at(self, created_at): (source)

Undocumented

__dataset = (source)

Undocumented

Undocumented

The fiftyone.core.dataset.Dataset that this field belongs to, or None if the field is not associated with a dataset.