class documentation

Parser for samples in TF Object Detection API format.

This implementation supports samples that are tf.train.Example protos whose features follow the format described in :ref:`this page <TFObjectDetectionDataset-import>`.

Parameters
force_rgbwhether to force convert all images to RGB
Method get_image_metadata Returns the image metadata for the current sample.
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.
Method _parse_image Undocumented
Method _parse_image_metadata Undocumented
Method _parse_label Undocumented
Constant _FEATURES Undocumented

Inherited from TFRecordSampleParser:

Method __init__ Undocumented
Method clear_sample Clears the current sample.
Method get_image Returns the image from the current sample.
Method get_label Returns the label for the current sample.
Method _parse_features Undocumented
Instance Variable _channels Undocumented
Instance Variable _current_features_cache Undocumented
Property _current_features Undocumented

Inherited from LabeledImageSampleParser (via TFRecordSampleParser):

Method get_image_path Returns the image path for the current sample.

Inherited from SampleParser (via TFRecordSampleParser, LabeledImageSampleParser):

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 get_image_metadata(self): (source)

Returns the image metadata for the current sample.

Returns
a fiftyone.core.metadata.ImageMetadata instance
@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
def _parse_image(self, features): (source)
def _parse_image_metadata(self, features): (source)

Undocumented

def _parse_label(self, features): (source)
_FEATURES = (source)

Undocumented

Value
{'image/height': tf.io.FixedLenFeature([], tf.int64),
 'image/width': tf.io.FixedLenFeature([], tf.int64),
 'image/filename': tf.io.FixedLenFeature([], tf.string),
 'image/source_id': tf.io.FixedLenFeature([], tf.string),
 'image/encoded': tf.io.FixedLenFeature([], tf.string),
 'image/format': tf.io.FixedLenFeature([], tf.string),
 'image/object/bbox/xmin': tf.io.FixedLenSequenceFeature([], tf.float32,
...