Source code for rastervision.core.data.label_store.label_store
from typing import TYPE_CHECKING, Optional
from abc import ABC, abstractmethod, abstractproperty
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 dependant on the type
of pipeline.
"""
pass
@abstractproperty
def bbox(self) -> Optional['Box']:
pass
@abstractproperty
def crs_transformer(self) -> 'CRSTransformer':
pass
[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.
"""
pass