Source code for rastervision.core.data.label_store.label_store

from typing import TYPE_CHECKING, Optional
from abc import ABC, abstractmethod

if TYPE_CHECKING:
    from rastervision.core.box import Box
    from rastervision.core.data import CRSTransformer


[docs]class LabelStore(ABC): """This defines how to store prediction labels for a scene."""
[docs] @abstractmethod def save(self, labels): """Save. Args: labels - Labels to be saved, the type of which will be dependent on the type of pipeline. """
[docs] @abstractmethod def get_labels(self): """Loads Labels from this label store."""
@property @abstractmethod def bbox(self) -> Optional['Box']: """Bounding box applied to the source.""" @property @abstractmethod def crs_transformer(self) -> 'CRSTransformer': """Associated :class:`.CRSTransformer`."""
[docs] @abstractmethod def set_bbox(self, extent: 'Box') -> None: """Set self.extent to the given value. .. note:: This method is idempotent. Args: extent (Box): User-specified extent in pixel coordinates. """