Skip to content

Commit 032fcfb

Browse files
committed
Add depricated funcs
1 parent 299988f commit 032fcfb

File tree

4 files changed

+20
-6
lines changed

4 files changed

+20
-6
lines changed

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@ google-cloud-storage>=1.33.0
1818
azure-storage-blob>=12.6.0
1919
fire==0.4.0
2020
Shapely>=1.7.1
21+
mixpanel>=4.8.3

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import pandas as pd
55
import plotly.express as px
66
from superannotate.lib.app.mixp.decorators import Trackable
7+
from superannotate.lib.app.exceptions import AppException
78

89
from .common import aggregate_annotations_as_df
910

@@ -24,6 +25,12 @@ def class_distribution(export_root, project_names, visualize=False):
2425
:rtype: pandas DataFrame
2526
"""
2627

28+
json_paths = list(Path(str(export_root)).glob("*.json"))
29+
if json_paths and "___pixel.json" not in json_paths[0].name and "___objects.json" not in json_paths[0].name:
30+
raise AppException(
31+
"The function does not support projects containing videos attached with URLs"
32+
)
33+
2734
logger.info(
2835
"Aggregating class distribution accross projects: {}.".format(
2936
" ".join(project_names)

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,12 @@ def aggregate_annotations_as_df(
172172
:rtype: pandas DataFrame
173173
"""
174174

175+
json_paths = list(Path(str(project_root)).glob("*.json"))
176+
if json_paths and "___pixel.json" not in json_paths[0].name and "___objects.json" not in json_paths[0].name:
177+
raise AppException(
178+
"The function does not support projects containing videos attached with URLs"
179+
)
180+
175181
if verbose:
176182
logger.info("Aggregating annotations from %s as pandas DataFrame", project_root)
177183

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1180,7 +1180,7 @@ def upload_images_from_google_cloud_to_project(
11801180
failed_images = []
11811181
duplicated_images = []
11821182
project_name, folder_name = extract_project_folder(project)
1183-
project = controller.get_project_metadata(project_name)
1183+
project = controller.get_project_metadata(project_name).data
11841184
if project["project"].project_type == constances.ProjectType.VIDEO.value:
11851185
raise AppValidationException(
11861186
"The function does not support projects containing videos attached with URLs"
@@ -1281,7 +1281,7 @@ def upload_images_from_azure_blob_to_project(
12811281
failed_images = []
12821282
duplicated_images = []
12831283
project_name, folder_name = extract_project_folder(project)
1284-
project = controller.get_project_metadata(project_name)
1284+
project = controller.get_project_metadata(project_name).data
12851285
if project["project"].project_type == constances.ProjectType.VIDEO.value:
12861286
raise AppValidationException(
12871287
"The function does not support projects containing videos attached with URLs"
@@ -1782,7 +1782,7 @@ def upload_videos_from_folder_to_project(
17821782
"""
17831783

17841784
project_name, folder_name = extract_project_folder(project)
1785-
project = controller.get_project_metadata(project_name)
1785+
project = controller.get_project_metadata(project_name).data
17861786
if project["project"].project_type == constances.ProjectType.VIDEO.value:
17871787
raise AppValidationException(
17881788
"The function does not support projects containing videos attached with URLs"
@@ -1892,7 +1892,7 @@ def upload_video_to_project(
18921892
"""
18931893

18941894
project_name, folder_name = extract_project_folder(project)
1895-
project = controller.get_project_metadata(project_name)
1895+
project = controller.get_project_metadata(project_name).data
18961896
if project["project"].project_type == constances.ProjectType.VIDEO.value:
18971897
raise AppValidationException(
18981898
"The function does not support projects containing videos attached with URLs"
@@ -2421,7 +2421,7 @@ def upload_annotations_from_folder_to_project(
24212421
"""
24222422

24232423
project_name, folder_name = extract_project_folder(project)
2424-
project = controller.get_project_metadata(project_name)
2424+
project = controller.get_project_metadata(project_name).data
24252425
if project["project"].project_type == constances.ProjectType.VIDEO.value:
24262426
raise AppValidationException(
24272427
"The function does not support projects containing videos attached with URLs"
@@ -2481,7 +2481,7 @@ def upload_preannotations_from_folder_to_project(
24812481
:rtype: tuple of list of strs
24822482
"""
24832483
project_name, folder_name = extract_project_folder(project)
2484-
project = controller.get_project_metadata(project_name)
2484+
project = controller.get_project_metadata(project_name).data
24852485
if project["project"].project_type == constances.ProjectType.VIDEO.value:
24862486
raise AppValidationException(
24872487
"The function does not support projects containing videos attached with URLs"

0 commit comments

Comments
 (0)