Skip to content

Commit cb33fba

Browse files
authored
Merge pull request #267 from superannotateai/friday
fix shapely import
2 parents 09d3eb0 + ef8bfc6 commit cb33fba

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ pandas>=1.1.4
1414
plotly==4.1.0
1515
ffmpeg-python>=0.2.0
1616
fire==0.4.0
17-
Shapely==1.7.1
1817
mixpanel==4.8.3
1918
pydantic>=1.8.2
2019
pydantic[email]

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)