Skip to content

Commit

Permalink
style: add type hints for marking detection workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiasschaub committed Dec 12, 2023
1 parent fe5b288 commit 23f0acc
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions sketch_map_tool/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 23f0acc

Please sign in to comment.