Labels#
- class Labels[source]#
Bases:
ABC
A source-agnostic, in-memory representation of labels in a scene.
This class can represent labels obtained via a
LabelSource
, aLabelStore
, or directly from model predictions.- __init__()#
Methods
__init__
()filter_by_aoi
(aoi_polygons)Returns a copy of these labels filtered by a given set of AOI polygons
from_predictions
(windows, predictions)Instantiate from windows and their corresponding predictions.
Instantiate an empty instance of this class.
save
(uri)Save to file.
- abstract filter_by_aoi(aoi_polygons)[source]#
Returns a copy of these labels filtered by a given set of AOI polygons
- Parameters
by (aoi_polygons - A list of AOI polygons to filter) –
coordinates. (in pixel) –
- classmethod from_predictions(windows: Iterable[Box], predictions: Iterable[Any]) Labels [source]#
Instantiate from windows and their corresponding predictions.
This makes no assumptions about the type or format of the predictions. Subclasses should implement the __setitem__ method to correctly handle the predictions.