class documentation
class ImagePatchesExtractor(object): (source)
Constructor: ImagePatchesExtractor(samples, patches_field, include_labels, force_rgb, ...)
Class for iterating over the labeled/unlabeled image patches in a collection.
By default, this class emits only the image patches, but you can set include_labels to True to emit (img_patch, label) tuples.
Parameters | |
samples | a fiftyone.core.collections.SampleCollection |
patches | the name of the field defining the image patches
in each sample to extract. Must be of type
fiftyone.core.labels.Detection ,
fiftyone.core.labels.Detections ,
fiftyone.core.labels.Polyline , or
fiftyone.core.labels.Polylines . This can be automatically
inferred (only) if samples is a patches view |
include | whether to emit (img_patch, label) tuples rather than just image patches |
force | whether to force convert the images to RGB |
force | whether to minimally manipulate the patch bounding boxes into squares prior to extraction |
alpha | an optional expansion/contraction to apply to the patches before extracting them, in [-1, inf). If provided, the length and width of the box are expanded (or contracted, when alpha < 0) by (100 * alpha)%. For example, set alpha = 0.1 to expand the boxes by 10%, and set alpha = -0.1 to contract the boxes by 10% |
Method | __init__ |
Undocumented |
Method | __iter__ |
Undocumented |
Method | __len__ |
Undocumented |
Instance Variable | alpha |
Undocumented |
Instance Variable | force |
Undocumented |
Instance Variable | force |
Undocumented |
Instance Variable | include |
Undocumented |
Instance Variable | patches |
Undocumented |
Instance Variable | samples |
Undocumented |