class documentation

Legacy importer for FiftyOne datasets stored on disk in a serialized JSON format.

Warning

The fiftyone.types.FiftyOneDataset format was upgraded in fiftyone==0.8 and this importer is now deprecated.

However, to maintain backwards compatibility, FiftyOneDatasetImporter will check for instances of datasets of this type at runtime and defer to this class to load them.

Parameters
dataset_dirthe dataset directory
rel_dira relative directory to prepend to each filepath if it is not absolute. This path is converted to an absolute path (if necessary) via fiftyone.core.storage.normalize_path
import_saved_viewswhether to include saved views in the import. Only applicable when importing full datasets
import_runswhether to include annotation/brain/evaluation runs in the import. Only applicable when importing full datasets
import_workspaceswhether to include saved workspaces in the import. Only applicable when importing full datasets
shufflewhether to randomly shuffle the order in which the samples are imported
seeda random seed to use when shuffling
max_samplesa maximum number of samples to import. By default, all samples are imported
Method __init__ Undocumented
Method __iter__ Undocumented
Method __len__ The total number of samples that will be imported.
Method __next__ Returns information about the next sample in the dataset.
Method get_dataset_info Returns the dataset info for the dataset.
Method get_sample_field_schema Returns a dictionary describing the field schema of the samples loaded by this importer.
Method import_extras Undocumented
Method setup Performs any necessary setup before importing the first sample in the dataset.
Instance Variable import_runs Undocumented
Instance Variable import_saved_views Undocumented
Instance Variable import_workspaces Undocumented
Instance Variable rel_dir Undocumented
Property has_dataset_info Whether this importer produces a dataset info dictionary.
Property has_sample_field_schema Whether this importer produces a sample field schema.
Static Method _get_classes Undocumented
Static Method _get_num_samples Undocumented
Method _import_frame_labels Undocumented
Instance Variable _anno_dir Undocumented
Instance Variable _brain_dir Undocumented
Instance Variable _eval_dir Undocumented
Instance Variable _fields_dir Undocumented
Instance Variable _frame_labels_dir Undocumented
Instance Variable _iter_samples Undocumented
Instance Variable _media_fields Undocumented
Instance Variable _media_type Undocumented
Instance Variable _metadata Undocumented
Instance Variable _num_samples Undocumented
Instance Variable _rel_dir Undocumented
Instance Variable _runs_dir Undocumented
Instance Variable _samples Undocumented

Inherited from DatasetImporter (via GenericSampleDatasetImporter):

Method __enter__ Undocumented
Method __exit__ Undocumented
Method close Performs any necessary actions after the last sample has been imported.
Method _preprocess_list Internal utility that preprocesses the given list---which is presumed to be a list defining the samples that should be imported---by applying the values of the shuffle, seed, and max_samples parameters of the importer.
def __init__(self, dataset_dir, rel_dir=None, import_saved_views=True, import_runs=True, import_workspaces=True, shuffle=False, seed=None, max_samples=None): (source)
def __len__(self): (source)

The total number of samples that will be imported.

Raises
TypeErrorif the total number is not known
def __next__(self): (source)

Returns information about the next sample in the dataset.

Returns
a fiftyone.core.sample.Sample instance
Raises
StopIterationif there are no more samples to import
def get_dataset_info(self): (source)

Returns the dataset info for the dataset.

By convention, this method should be called after all samples in the dataset have been imported.

Returns
a dict of dataset info
def get_sample_field_schema(self): (source)

Returns a dictionary describing the field schema of the samples loaded by this importer.

Returns
a dict mapping field names to fiftyone.core.fields.Field instances or str(field) representations of them
def import_extras(self, sample_collection): (source)

Undocumented

def setup(self): (source)

Performs any necessary setup before importing the first sample in the dataset.

This method is called when the importer's context manager interface is entered, DatasetImporter.__enter__.

import_runs: True = (source)

Undocumented

import_saved_views: True = (source)

Undocumented

import_workspaces: True = (source)

Undocumented

Undocumented

@property
has_dataset_info = (source)

Whether this importer produces a dataset info dictionary.

@property
has_sample_field_schema = (source)

Whether this importer produces a sample field schema.

@staticmethod
def _get_classes(dataset_dir): (source)

Undocumented

@staticmethod
def _get_num_samples(dataset_dir): (source)

Undocumented

def _import_frame_labels(self, sample, labels_path): (source)

Undocumented

_anno_dir = (source)

Undocumented

_brain_dir = (source)

Undocumented

_eval_dir = (source)

Undocumented

_fields_dir = (source)

Undocumented

_frame_labels_dir = (source)

Undocumented

_iter_samples = (source)

Undocumented

_media_fields = (source)

Undocumented

_media_type = (source)

Undocumented

_metadata = (source)

Undocumented

_num_samples = (source)

Undocumented

_rel_dir = (source)

Undocumented

_runs_dir = (source)

Undocumented

_samples = (source)

Undocumented