module documentation
Image patch utilities.
Class |
|
Class for iterating over the labeled/unlabeled image patches in a collection. |
Function | extract |
Extracts the patch from the image. |
Function | parse |
Parses the patches from the given document. |
Function | _load |
Undocumented |
Function | _to |
Undocumented |
Extracts the patch from the image.
Parameters | |
img | a numpy image array |
detection | a fiftyone.core.labels.Detection defining the
patch |
forceFalse | whether to minimally manipulate the patch bounding box into a square prior to extraction |
alpha:None | an optional expansion/contraction to apply to the patch before extracting it, 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 box by 10%, and set alpha = -0.1 to contract the box by 10% |
Returns | |
the image patch |
Parses the patches from the given document.
Parameters | |
doc | Undocumented |
patches | the name of the field defining the image patches. Must
be of type fiftyone.core.labels.Detection ,
fiftyone.core.labels.Detections ,
fiftyone.core.labels.Polyline , or
fiftyone.core.labels.Polylines |
handle | how to handle documents with no patches. Supported values are:
|
Returns | |
a fiftyone.core.labels.Detections instance, or None |