class documentation

Parser for fiftyone.core.sample.Sample instances that contain labeled images.

Parameters
label_fieldthe name of the label field to parse, or a dictionary mapping label field names to keys for the return label dictionaries
label_fcnan optional function or dictionary mapping label field names to functions (must match label_field) to apply to each label before returning it
compute_metadatawhether to compute fiftyone.core.metadata.ImageMetadata instances on-the-fly if get_image_metadata is called and no metadata is available
Method __init__ Undocumented
Method get_image Returns the image from the current sample.
Method get_image_metadata Returns the image metadata for the current sample.
Method get_image_path Returns the image path for the current sample.
Method get_label Returns the label for the current sample.
Instance Variable compute_metadata Undocumented
Instance Variable label_fcn Undocumented
Instance Variable label_field Undocumented
Property has_image_metadata Whether this parser produces fiftyone.core.metadata.ImageMetadata instances for samples that it parses.
Property has_image_path Whether this parser produces paths to images on disk for samples that it parses.
Property label_cls The fiftyone.core.labels.Label class(es) returned by this parser.

Inherited from SampleParser (via LabeledImageSampleParser):

Method clear_sample Clears the current sample.
Method with_sample Sets the current sample so that subsequent calls to methods of this parser will return information from the given sample.
Property current_sample The current sample.
Instance Variable _current_sample Undocumented
def __init__(self, label_field, label_fcn=None, compute_metadata=False): (source)
def get_image(self): (source)

Returns the image from the current sample.

Returns
a numpy image
def get_image_metadata(self): (source)

Returns the image metadata for the current sample.

Returns
a fiftyone.core.metadata.ImageMetadata instance
def get_image_path(self): (source)

Returns the image path for the current sample.

Returns
the path to the image on disk
def get_label(self): (source)

Returns the label for the current sample.

Returns
a fiftyone.core.labels.Label instance, or a dictionary mapping field names to fiftyone.core.labels.Label instances, or None if the sample is unlabeled
compute_metadata: False = (source)

Undocumented

label_fcn: None = (source)

Undocumented

label_field = (source)

Undocumented

@property
has_image_metadata = (source)

Whether this parser produces fiftyone.core.metadata.ImageMetadata instances for samples that it parses.

@property
has_image_path = (source)

Whether this parser produces paths to images on disk for samples that it parses.

The fiftyone.core.labels.Label class(es) returned by this parser.

This can be any of the following:

  • a fiftyone.core.labels.Label class. In this case, the parser is guaranteed to return labels of this type
  • a list or tuple of fiftyone.core.labels.Label classes. In this case, the parser can produce a single label field of any of these types
  • a dict mapping keys to fiftyone.core.labels.Label classes. In this case, the parser will return label dictionaries with keys and value-types specified by this dictionary. Not all keys need be present in the imported labels
  • None. In this case, the parser makes no guarantees about the labels that it may return