Skip to content

Commit e6a0b28

Browse files
authored
Merge pull request #268 from superannotateai/develop
Develop
2 parents 84c5786 + 54fb559 commit e6a0b28

File tree

63 files changed

+3254
-771
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+3254
-771
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/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@
158158
from superannotate.lib.app.interface.sdk_interface import (
159159
upload_videos_from_folder_to_project,
160160
)
161+
from superannotate.lib.app.interface.sdk_interface import validate_annotations
161162
from superannotate.version import __version__
162163

163164

@@ -166,6 +167,7 @@
166167
"controller",
167168
# Utils
168169
"AppException",
170+
"validate_annotations",
169171
#
170172
"init",
171173
"set_auth_token",

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 = [

src/superannotate/lib/app/helpers.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import boto3
1010
import pandas as pd
1111
from superannotate.lib.app.exceptions import PathError
12+
from superannotate.lib.core import ATTACHED_VIDEO_ANNOTATION_POSTFIX
1213
from superannotate.lib.core import PIXEL_ANNOTATION_POSTFIX
1314
from superannotate.lib.core import VECTOR_ANNOTATION_POSTFIX
1415

@@ -55,7 +56,13 @@ def get_local_annotation_paths(
5556
[
5657
str(i)
5758
for i in all_not_folders
58-
if i.name.endswith((VECTOR_ANNOTATION_POSTFIX, PIXEL_ANNOTATION_POSTFIX))
59+
if i.name.endswith(
60+
(
61+
VECTOR_ANNOTATION_POSTFIX,
62+
PIXEL_ANNOTATION_POSTFIX,
63+
ATTACHED_VIDEO_ANNOTATION_POSTFIX,
64+
)
65+
)
5966
]
6067
)
6168
if recursive:
@@ -82,8 +89,10 @@ def get_s3_annotation_paths(folder_path, s3_bucket, annotation_paths, recursive)
8289
for data in paginator.paginate(Bucket=s3_bucket, Prefix=folder_path):
8390
for annotation in data["Contents"]:
8491
key = annotation["Key"]
85-
if key.endswith(VECTOR_ANNOTATION_POSTFIX) or key.endswith(
86-
PIXEL_ANNOTATION_POSTFIX
92+
if (
93+
key.endswith(VECTOR_ANNOTATION_POSTFIX)
94+
or key.endswith(PIXEL_ANNOTATION_POSTFIX)
95+
or key.endswith(ATTACHED_VIDEO_ANNOTATION_POSTFIX)
8796
):
8897
if not recursive and "/" in key[len(folder_path) + 1 :]:
8998
continue

src/superannotate/lib/app/interface/cli_interface.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ def upload_videos(
268268
self,
269269
project,
270270
folder,
271-
target_fps=1,
271+
target_fps=None,
272272
recursive=False,
273273
extensions=constances.DEFAULT_VIDEO_EXTENSIONS,
274274
set_annotation_status=constances.AnnotationStatus.NOT_STARTED.name,

0 commit comments

Comments
 (0)