FiftyOne Server utils.
Function | cache |
Caches the given dataset. |
Function | change |
Applies the changes to tags to all labels in the specified label field(s) of the collection, if necessary. |
Function | change |
Applies the changes to tags to all samples of the collection, if necessary. |
Function | from |
Wrapping function for dacite.from_dict that ensures a common configuration is used. |
Function | load |
Loads the dataset with the given name and caches it. |
Function | meets |
Determines whether the field meets type or types, or the field is a fiftyone.core.fields.ListField that meets the type or types |
Function | _parse |
Undocumented |
Variable | _cache |
Undocumented |
Variable | _dacite |
Undocumented |
Caches the given dataset.
This method ensures that subsequent calls to
fiftyone.core.dataset.load_dataset
in async calls will return this
dataset singleton.
See load_and_cache_dataset
for additional details.
Parameters | |
dataset | a fiftyone.core.dataset.Dataset |
Applies the changes to tags to all labels in the specified label field(s) of the collection, if necessary.
Parameters | |
sample | a
fiftyone.core.collections.SampleCollection |
changes | a dict of tags as keys and bools as values. A True value adds the tag to all labels, if necessary. A False value removes the tag from all labels, if necessary |
labelNone | an optional name or iterable of names of
fiftyone.core.labels.Label fields. By default, all label
fields are used |
Applies the changes to tags to all samples of the collection, if necessary.
Parameters | |
sample | a
fiftyone.core.collections.SampleCollection |
changes | a dict of tags as keys and bools as values. A True value adds the tag to all samples, if necessary. A False value removes the tag from all samples, if necessary |
Wrapping function for dacite.from_dict that ensures a common configuration is used.
Parameters | |
datatype[ | a dataclass |
data:Data | the data with which to instantiate the dataclass instance |
Returns | |
T | a dataclass instance |
Loads the dataset with the given name and caches it.
This method is a wrapper around fiftyone.core.dataset.load_dataset
that stores a reference to every dataset it loads in a TTL cache to ensure
that references to recently used datasets exist in memory so that dataset
objects aren't garbage collected between async calls.
It is desirable to avoid dataset objects being garbage collected because datasets are singletons and may have objects (eg brain results) that are expensive to load cached on them.
Parameters | |
name | the dataset name |
Returns | |
a fiftyone.core.dataset.Dataset |
Determines whether the field meets type or types, or the field
is a fiftyone.core.fields.ListField
that meets the type or types
Parameters | |
field:fof.Field | a class:fiftyone.core.fields.Field |
type | Undocumented |
type | a field type or tuple of field types |