File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change 1+ import sys
2+
13from .base import Metric , MetricResult
24from .polygon_metrics import (
35 PolygonIOU ,
46 PolygonMetric ,
57 PolygonPrecision ,
68 PolygonRecall ,
79)
10+
11+ try :
12+ import shapely
13+ except ModuleNotFoundError as e :
14+ if sys .platform .startswith ("darwin" ):
15+ platform_specific_msg = (
16+ "Depending on Python environment used GEOS might need to be installed via "
17+ "`brew install geos`."
18+ )
19+ elif sys .platform .startswith ("linux" ):
20+ platform_specific_msg = (
21+ "Depending on Python environment used GEOS might need to be installed via "
22+ "system package `libgeos-dev`."
23+ )
24+ else :
25+ platform_specific_msg = "GEOS package will need to be installed see (https://trac.osgeo.org/geos/)"
26+ raise ModuleNotFoundError (
27+ f"Module 'shapely' not found. Install optionally with `scale-nucleus[metrics]`. { platform_specific_msg } "
28+ ) from e
You can’t perform that action at this time.
0 commit comments