class ImageLabelsSampleParser(LabeledImageTupleSampleParser): (source)
Known subclasses: fiftyone.utils.data.parsers.FiftyOneImageLabelsSampleParser
Constructor: ImageLabelsSampleParser(prefix, labels_dict, multilabel, skip_non_categorical)
Generic parser for multitask image prediction samples whose labels are stored in eta.core.image.ImageLabels format.
This implementation provided by this class supports samples that are (image_or_path, image_labels_or_path) tuples, where:
- image_or_path is either an image that can be converted to numpy format via np.asarray() or the path to an image on disk
- image_labels_or_path is an eta.core.image.ImageLabels instance, an eta.core.frames.FrameLabels instance, a serialized dict representation of either, or the path to either on disk
Parameters | |
prefix | a string prefix to prepend to each label name in the expanded label dictionary |
labels | a dictionary mapping names of attributes/objects in the image labels to field names into which to expand them |
multilabel | whether to store attributes in a single
fiftyone.core.labels.Classifications instance |
skip | whether to skip non-categorical attributes (True) or cast them to strings (False) |
Method | __init__ |
Undocumented |
Method | get |
Returns the label for the current sample. |
Instance Variable | labels |
Undocumented |
Instance Variable | multilabel |
Undocumented |
Instance Variable | prefix |
Undocumented |
Instance Variable | skip |
Undocumented |
Property | label |
The fiftyone.core.labels.Label class(es) returned by this parser. |
Method | _parse |
Undocumented |
Inherited from LabeledImageTupleSampleParser
:
Method | clear |
Clears the current sample. |
Method | get |
Returns the image from the current sample. |
Method | get |
Returns the image path for the current sample. |
Property | has |
Whether this parser produces fiftyone.core.metadata.ImageMetadata instances for samples that it parses. |
Property | has |
Whether this parser produces paths to images on disk for samples that it parses. |
Method | _get |
Undocumented |
Method | _parse |
Undocumented |
Instance Variable | _current |
Undocumented |
Property | _current |
Undocumented |
Inherited from LabeledImageSampleParser
(via LabeledImageTupleSampleParser
):
Method | get |
Returns the image metadata for the current sample. |
Inherited from SampleParser
(via LabeledImageTupleSampleParser
, LabeledImageSampleParser
):
Method | with |
Sets the current sample so that subsequent calls to methods of this parser will return information from the given sample. |
Property | current |
The current sample. |
Instance Variable | _current |
Undocumented |
Undocumented
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