From 7753395d5c63d8389f2bbc30925cbca9cff999e0 Mon Sep 17 00:00:00 2001 From: Ball JGC Date: Sun, 1 Oct 2023 17:13:10 +0000 Subject: [PATCH] tidy formatting --- detectree2/models/outputs.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/detectree2/models/outputs.py b/detectree2/models/outputs.py index 690c04dc..6a9f7f60 100644 --- a/detectree2/models/outputs.py +++ b/detectree2/models/outputs.py @@ -9,7 +9,7 @@ import re from http.client import REQUEST_URI_TOO_LONG # noqa: F401 from pathlib import Path -from typing import Optional, Dict, Union, List, Any +from typing import Optional, Dict, Union, List, Any, TypedDict import cv2 import geopandas as gpd @@ -24,7 +24,9 @@ # Type aliases definitions Feature = Dict[str, Any] -GeoFile = Dict[str, Union[str, Dict[str, str], List[Feature]]] +CRSType = TypedDict("CRSType", {"type": str, "properties": Dict[str, str]}) +GeoFile = TypedDict("GeoFile", {"type": str, "crs": CRSType, "features": List[Feature]}) + def polygon_from_mask(masked_arr): """Convert RLE data from the output instances into Polygons.