Skip to content

Commit 87eb887

Browse files
committed
fix shapely import
1 parent 644e676 commit 87eb887

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

src/superannotate/lib/app/analytics/common.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@
66
import plotly.express as px
77
from lib.app.exceptions import AppException
88
from lib.core import DEPRICATED_DOCUMENT_VIDEO_MESSAGE
9-
from shapely.geometry import box
10-
from shapely.geometry import Point
11-
from shapely.geometry import Polygon
12-
139

1410
logger = logging.getLogger()
1511

@@ -542,6 +538,17 @@ def image_consensus(df, image_name, annot_type):
542538
:type dataset_format: str
543539
544540
"""
541+
542+
try:
543+
from shapely.geometry import box
544+
from shapely.geometry import Point
545+
from shapely.geometry import Polygon
546+
except ImportError:
547+
raise ImportError(
548+
"To use superannotate.benchmark or superannotate.consensus functions please install "
549+
"shapely package in Anaconda enviornment with # conda install shapely"
550+
)
551+
545552
image_df = df[df["imageName"] == image_name]
546553
all_projects = list(set(df["folderName"]))
547554
column_names = [

0 commit comments

Comments
 (0)