From 23f0acc9bb5d64ea14a72e0448258a51f2745cfe Mon Sep 17 00:00:00 2001 From: Matthias Schaub Date: Tue, 12 Dec 2023 13:57:49 +0100 Subject: [PATCH] style: add type hints for marking detection workflow --- sketch_map_tool/tasks.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/sketch_map_tool/tasks.py b/sketch_map_tool/tasks.py index 2c1e913f..dbf9b697 100644 --- a/sketch_map_tool/tasks.py +++ b/sketch_map_tool/tasks.py @@ -140,20 +140,20 @@ def process( name: str, uuid: str, bbox: Bbox, - sam_predictor, - yolo_model, + sam_predictor: SamPredictor, + yolo_model: YOLO, ) -> FeatureCollection: """Process a Sketch Map.""" # r = interim result - r = db_client_celery.select_file(sketch_map_id) - r = to_array(r) - r = clip(r, map_frames[uuid]) - r = detect_markings(r, yolo_model, sam_predictor) - r = georeference(r, bbox, bgr=False) - r = polygonize(r, name) - r = geojson.load(r) - r = clean(r) - r = enrich(r, {"name": name}) + r: BytesIO = db_client_celery.select_file(sketch_map_id) # type: ignore + r: NDArray = to_array(r) # type: ignore + r: NDArray = clip(r, map_frames[uuid]) # type: ignore + r: NDArray = detect_markings(r, yolo_model, sam_predictor) # type: ignore + r: BytesIO = georeference(r, bbox, bgr=False) # type: ignore + r: BytesIO = polygonize(r, name) # type: ignore + r: FeatureCollection = geojson.load(r) # type: ignore + r: FeatureCollection = clean(r) # type: ignore + r: FeatureCollection = enrich(r, {"name": name}) # type: ignore return r return merge(