Skip to content

Constants

Shared type aliases and paths used throughout the framework, including DATA_FOLDER and CHECKPOINTS_FOLDER, which the example notebooks and the default checkpoint paths resolve against.

constants

Attributes

ARRAY_TYPE = numpy.typing.ArrayLike module-attribute

Any object numpy can interpret as an array, such as a numpy array, list, or tuple.

BOUNDARY_TYPE = Union[PATH_TYPE, shapely.Polygon, shapely.MultiPolygon, gpd.GeoDataFrame, gpd.GeoSeries] module-attribute

A spatial region, such as a region of interest to restrict processing to.

May be given as a path to a geospatial vector file, an in-memory shapely geometry, or a geopandas GeoDataFrame or GeoSeries.

CHECKPOINTS_FOLDER = Path(Path(__file__).parent, '..', 'checkpoints').resolve() module-attribute

The checkpoints folder at the top level of the project.

The default weights paths for Detectree2, SAM2, and SAM3 are resolved against this folder.

DATA_FOLDER = Path(Path(__file__).parent, '..', 'data').resolve() module-attribute

The data folder at the top level of the project.

The example notebooks read their inputs from here, and the example data should be extracted into this folder.

DEFAULT_DEVICE = torch.device('cuda') if torch.cuda.is_available() else torch.device('cpu') module-attribute

The device detectors run on by default: the GPU if one is available, otherwise the CPU.

PATH_TYPE = Union[str, Path] module-attribute

A path to a file or folder, given either as a string or a pathlib.Path.