File tree 1 file changed +21
-0
lines changed
1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change
1
+ import sys
2
+
1
3
from .base import Metric , MetricResult
2
4
from .polygon_metrics import (
3
5
PolygonIOU ,
4
6
PolygonMetric ,
5
7
PolygonPrecision ,
6
8
PolygonRecall ,
7
9
)
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