supervisely 6.73.366__py3-none-any.whl → 6.73.368__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- supervisely/annotation/annotation.py +21 -21
- supervisely/annotation/label.py +4 -4
- supervisely/annotation/obj_class.py +9 -5
- supervisely/annotation/obj_class_collection.py +2 -2
- supervisely/annotation/tag.py +2 -2
- supervisely/annotation/tag_collection.py +3 -3
- supervisely/annotation/tag_meta.py +2 -2
- supervisely/annotation/tag_meta_collection.py +2 -2
- supervisely/api/agent_api.py +1 -1
- supervisely/api/annotation_api.py +1 -1
- supervisely/api/dataset_api.py +4 -4
- supervisely/api/entities_collection_api.py +1 -1
- supervisely/api/file_api.py +10 -10
- supervisely/api/image_api.py +9 -9
- supervisely/api/labeling_job_api.py +1 -1
- supervisely/api/labeling_queue_api.py +1 -1
- supervisely/api/module_api.py +6 -6
- supervisely/api/object_class_api.py +1 -1
- supervisely/api/plugin_api.py +1 -1
- supervisely/api/pointcloud/pointcloud_annotation_api.py +1 -1
- supervisely/api/pointcloud/pointcloud_api.py +1 -1
- supervisely/api/pointcloud/pointcloud_episode_annotation_api.py +1 -1
- supervisely/api/pointcloud/pointcloud_episode_api.py +1 -1
- supervisely/api/project_api.py +4 -4
- supervisely/api/remote_storage_api.py +6 -6
- supervisely/api/role_api.py +1 -1
- supervisely/api/storage_api.py +3 -3
- supervisely/api/task_api.py +1 -1
- supervisely/api/team_api.py +1 -1
- supervisely/api/user_api.py +1 -1
- supervisely/api/video/video_annotation_api.py +1 -1
- supervisely/api/video/video_api.py +4 -4
- supervisely/api/volume/volume_annotation_api.py +1 -1
- supervisely/api/volume/volume_api.py +1 -1
- supervisely/api/workspace_api.py +1 -2
- supervisely/app/development/sly-net.sh +2 -2
- supervisely/app/fastapi/index.html +3 -3
- supervisely/app/fastapi/subapp.py +1 -1
- supervisely/aug/aug.py +10 -10
- supervisely/cli/__init__.py +15 -10
- supervisely/geometry/alpha_mask.py +2 -2
- supervisely/geometry/bitmap.py +8 -6
- supervisely/geometry/bitmap_base.py +63 -24
- supervisely/geometry/cuboid.py +97 -50
- supervisely/geometry/cuboid_2d.py +2 -2
- supervisely/geometry/graph.py +4 -4
- supervisely/geometry/mask_3d.py +1 -1
- supervisely/geometry/point.py +63 -24
- supervisely/geometry/point_location.py +2 -2
- supervisely/geometry/polygon.py +2 -2
- supervisely/geometry/polyline.py +32 -40
- supervisely/geometry/rectangle.py +2 -2
- supervisely/geometry/vector_geometry.py +27 -39
- supervisely/io/env.py +3 -2
- supervisely/labeling_jobs/utils.py +5 -5
- supervisely/nn/model/prediction_session.py +50 -19
- supervisely/pointcloud/pointcloud.py +2 -2
- supervisely/pointcloud_annotation/pointcloud_annotation.py +19 -17
- supervisely/pointcloud_annotation/pointcloud_episode_annotation.py +23 -20
- supervisely/pointcloud_annotation/pointcloud_episode_frame.py +18 -12
- supervisely/pointcloud_annotation/pointcloud_episode_frame_collection.py +9 -6
- supervisely/pointcloud_annotation/pointcloud_episode_object_collection.py +7 -3
- supervisely/pointcloud_annotation/pointcloud_episode_tag.py +1 -1
- supervisely/pointcloud_annotation/pointcloud_episode_tag_collection.py +2 -2
- supervisely/pointcloud_annotation/pointcloud_figure.py +1 -1
- supervisely/pointcloud_annotation/pointcloud_object_collection.py +11 -10
- supervisely/pointcloud_annotation/pointcloud_tag.py +5 -4
- supervisely/pointcloud_annotation/pointcloud_tag_collection.py +7 -6
- supervisely/pointcloud_episodes/pointcloud_episodes.py +2 -2
- supervisely/project/download.py +1 -1
- supervisely/project/pointcloud_episode_project.py +1 -2
- supervisely/project/pointcloud_project.py +1 -1
- supervisely/project/project.py +8 -7
- supervisely/project/project_meta.py +2 -2
- supervisely/project/readme_template.md +1 -1
- supervisely/project/upload.py +1 -1
- supervisely/project/video_project.py +1 -1
- supervisely/project/volume_project.py +1 -1
- supervisely/task/progress.py +1 -1
- supervisely/video_annotation/frame.py +2 -2
- supervisely/video_annotation/frame_collection.py +3 -3
- supervisely/video_annotation/video_annotation.py +7 -5
- supervisely/video_annotation/video_figure.py +2 -2
- supervisely/video_annotation/video_object.py +47 -28
- supervisely/video_annotation/video_object_collection.py +15 -8
- supervisely/video_annotation/video_tag.py +2 -2
- supervisely/video_annotation/video_tag_collection.py +5 -5
- supervisely/volume_annotation/volume_figure.py +2 -2
- supervisely/volume_annotation/volume_tag.py +6 -5
- {supervisely-6.73.366.dist-info → supervisely-6.73.368.dist-info}/METADATA +2 -2
- {supervisely-6.73.366.dist-info → supervisely-6.73.368.dist-info}/RECORD +95 -95
- {supervisely-6.73.366.dist-info → supervisely-6.73.368.dist-info}/LICENSE +0 -0
- {supervisely-6.73.366.dist-info → supervisely-6.73.368.dist-info}/WHEEL +0 -0
- {supervisely-6.73.366.dist-info → supervisely-6.73.368.dist-info}/entry_points.txt +0 -0
- {supervisely-6.73.366.dist-info → supervisely-6.73.368.dist-info}/top_level.txt +0 -0
supervisely/project/download.py
CHANGED
|
@@ -71,7 +71,7 @@ def download(
|
|
|
71
71
|
api = sly.Api.from_env()
|
|
72
72
|
|
|
73
73
|
# Pass values into the API constructor (optional, not recommended)
|
|
74
|
-
# api = sly.Api(server_address="https://app.
|
|
74
|
+
# api = sly.Api(server_address="https://app.supervisely.com", token="4r47N...xaTatb")
|
|
75
75
|
|
|
76
76
|
dest_dir = 'your/local/dest/dir'
|
|
77
77
|
|
|
@@ -30,7 +30,6 @@ from supervisely.task.progress import Progress, tqdm_sly
|
|
|
30
30
|
from supervisely.video_annotation.frame import Frame
|
|
31
31
|
from supervisely.video_annotation.key_id_map import KeyIdMap
|
|
32
32
|
|
|
33
|
-
|
|
34
33
|
KITTI_ITEM_DIR_NAME = "velodyne"
|
|
35
34
|
|
|
36
35
|
|
|
@@ -696,7 +695,7 @@ def download_pointcloud_episode_project(
|
|
|
696
695
|
api = sly.Api.from_env()
|
|
697
696
|
|
|
698
697
|
# Pass values into the API constructor (optional, not recommended)
|
|
699
|
-
# api = sly.Api(server_address="https://app.
|
|
698
|
+
# api = sly.Api(server_address="https://app.supervisely.com", token="4r47N...xaTatb")
|
|
700
699
|
|
|
701
700
|
dest_dir = 'your/local/dest/dir'
|
|
702
701
|
|
|
@@ -921,7 +921,7 @@ def download_pointcloud_project(
|
|
|
921
921
|
api = sly.Api.from_env()
|
|
922
922
|
|
|
923
923
|
# Pass values into the API constructor (optional, not recommended)
|
|
924
|
-
# api = sly.Api(server_address="https://app.
|
|
924
|
+
# api = sly.Api(server_address="https://app.supervisely.com", token="4r47N...xaTatb")
|
|
925
925
|
|
|
926
926
|
dest_dir = 'your/local/dest/dir'
|
|
927
927
|
|
supervisely/project/project.py
CHANGED
|
@@ -947,7 +947,7 @@ class Dataset(KeyObject):
|
|
|
947
947
|
# updated_at='2021-03-02T10:04:33.973Z',
|
|
948
948
|
# meta={},
|
|
949
949
|
# path_original='/h5un6l2bnaz1vj8a9qgms4-public/images/original/7/h/Vo/...jpeg',
|
|
950
|
-
# full_storage_url='http://app.
|
|
950
|
+
# full_storage_url='http://app.supervisely.com/h5un6l2bnaz1vj8a9qgms4-public/images/original/7/h/Vo/...jpeg'),
|
|
951
951
|
# tags=[]
|
|
952
952
|
# )
|
|
953
953
|
"""
|
|
@@ -987,7 +987,7 @@ class Dataset(KeyObject):
|
|
|
987
987
|
# updated_at='2021-03-02T10:04:33.973Z',
|
|
988
988
|
# meta={},
|
|
989
989
|
# path_original='/h5un6l2bnaz1vj8a9qgms4-public/images/original/7/h/Vo/...jpeg',
|
|
990
|
-
# full_storage_url='http://app.
|
|
990
|
+
# full_storage_url='http://app.supervisely.com/h5un6l2bnaz1vj8a9qgms4-public/images/original/7/h/Vo/...jpeg'),
|
|
991
991
|
# tags=[]
|
|
992
992
|
# )
|
|
993
993
|
"""
|
|
@@ -3392,7 +3392,7 @@ class Project:
|
|
|
3392
3392
|
- Dict of AlphaGeometries
|
|
3393
3393
|
|
|
3394
3394
|
:param api: Supervisely API address and token.
|
|
3395
|
-
:type api: :class:`Api<
|
|
3395
|
+
:type api: :class:`Api<supervisely.api.api.Api>`
|
|
3396
3396
|
:param project_id: Project ID to download.
|
|
3397
3397
|
:type project_id: :class:`int`
|
|
3398
3398
|
:param dest_dir: Destination path to local directory.
|
|
@@ -4750,7 +4750,7 @@ def download_project(
|
|
|
4750
4750
|
api = sly.Api.from_env()
|
|
4751
4751
|
|
|
4752
4752
|
# Pass values into the API constructor (optional, not recommended)
|
|
4753
|
-
# api = sly.Api(server_address="https://app.
|
|
4753
|
+
# api = sly.Api(server_address="https://app.supervisely.com", token="4r47N...xaTatb")
|
|
4754
4754
|
|
|
4755
4755
|
dest_dir = 'your/local/dest/dir'
|
|
4756
4756
|
|
|
@@ -5438,6 +5438,7 @@ def _dataset_structure_md(
|
|
|
5438
5438
|
|
|
5439
5439
|
return "".join(result_md)
|
|
5440
5440
|
|
|
5441
|
+
|
|
5441
5442
|
def _dataset_descriptions_md(project_info: sly.ProjectInfo, api: sly.Api) -> str:
|
|
5442
5443
|
"""Creates a markdown string with dictionary of descriptions and custom data of datasets.
|
|
5443
5444
|
:param project_info: Project information.
|
|
@@ -5456,13 +5457,13 @@ def _dataset_descriptions_md(project_info: sly.ProjectInfo, api: sly.Api) -> str
|
|
|
5456
5457
|
full_ds_name = "/".join(parents + [dataset_info.name])
|
|
5457
5458
|
if dataset_info.description or dataset_info.custom_data:
|
|
5458
5459
|
data_found = True
|
|
5459
|
-
result_md += f
|
|
5460
|
+
result_md += f' "{full_ds_name}": {{\n'
|
|
5460
5461
|
if dataset_info.description:
|
|
5461
|
-
result_md += f
|
|
5462
|
+
result_md += f' "description": "{dataset_info.description}",\n'
|
|
5462
5463
|
if dataset_info.custom_data:
|
|
5463
5464
|
formated_custom_data = json.dumps(dataset_info.custom_data, indent=4)
|
|
5464
5465
|
formated_custom_data = formated_custom_data.replace("\n", "\n ")
|
|
5465
|
-
result_md += f
|
|
5466
|
+
result_md += f' "custom_data": {formated_custom_data}\n'
|
|
5466
5467
|
result_md += " },\n"
|
|
5467
5468
|
result_md += "}\n```"
|
|
5468
5469
|
if not data_found:
|
|
@@ -291,7 +291,7 @@ class ProjectMeta(JsonSerializable):
|
|
|
291
291
|
|
|
292
292
|
def to_json(self) -> Dict:
|
|
293
293
|
"""
|
|
294
|
-
Convert the ProjectMeta to a json dict. Read more about `Supervisely format <https://docs.
|
|
294
|
+
Convert the ProjectMeta to a json dict. Read more about `Supervisely format <https://docs.supervisely.com/data-organization/00_ann_format_navi>`_.
|
|
295
295
|
|
|
296
296
|
:return: Json format as a dict
|
|
297
297
|
:rtype: :class:`dict`
|
|
@@ -344,7 +344,7 @@ class ProjectMeta(JsonSerializable):
|
|
|
344
344
|
@classmethod
|
|
345
345
|
def from_json(cls, data: Dict) -> ProjectMeta:
|
|
346
346
|
"""
|
|
347
|
-
Convert a json dict to ProjectMeta. Read more about `Supervisely format <https://docs.
|
|
347
|
+
Convert a json dict to ProjectMeta. Read more about `Supervisely format <https://docs.supervisely.com/data-organization/00_ann_format_navi>`_.
|
|
348
348
|
|
|
349
349
|
:param data: ProjectMeta in json format as a dict.
|
|
350
350
|
:type data: dict
|
|
@@ -19,7 +19,7 @@ In this section, you can find information about the dataset structure. Dataset n
|
|
|
19
19
|
Please, visit the [Supervisely blog](https://supervisely.com/blog) to keep up with the latest news, updates, and tutorials and subscribe to [our YouTube channel](https://www.youtube.com/c/Supervisely) to watch video tutorials.<br>
|
|
20
20
|
|
|
21
21
|
- [Supervisely Developer Portal](https://developer.supervisely.com/)
|
|
22
|
-
- [Supervisely JSON format](https://docs.
|
|
22
|
+
- [Supervisely JSON format](https://docs.supervisely.com/data-organization/00_ann_format_navi)
|
|
23
23
|
- [Intro to Python SDK](https://developer.supervisely.com/getting-started/intro-to-python-sdk)
|
|
24
24
|
- [Python SDK reference](https://supervisely.readthedocs.io/en/latest/sdk_packages.html)
|
|
25
25
|
- [API documentnation](https://api.docs.supervisely.com/)
|
supervisely/project/upload.py
CHANGED
|
@@ -53,7 +53,7 @@ def upload(
|
|
|
53
53
|
api = sly.Api.from_env()
|
|
54
54
|
|
|
55
55
|
# Pass values into the API constructor (optional, not recommended)
|
|
56
|
-
# api = sly.Api(server_address="https://app.
|
|
56
|
+
# api = sly.Api(server_address="https://app.supervisely.com", token="4r47N...xaTatb")
|
|
57
57
|
|
|
58
58
|
src_dir = '/your/local/source/dir'
|
|
59
59
|
|
|
@@ -1297,7 +1297,7 @@ def download_video_project(
|
|
|
1297
1297
|
api = sly.Api.from_env()
|
|
1298
1298
|
|
|
1299
1299
|
# Pass values into the API constructor (optional, not recommended)
|
|
1300
|
-
# api = sly.Api(server_address="https://app.
|
|
1300
|
+
# api = sly.Api(server_address="https://app.supervisely.com", token="4r47N...xaTatb")
|
|
1301
1301
|
|
|
1302
1302
|
dest_dir = 'your/local/dest/dir'
|
|
1303
1303
|
|
|
@@ -353,7 +353,7 @@ def download_volume_project(
|
|
|
353
353
|
api = sly.Api.from_env()
|
|
354
354
|
|
|
355
355
|
# Pass values into the API constructor (optional, not recommended)
|
|
356
|
-
# api = sly.Api(server_address="https://app.
|
|
356
|
+
# api = sly.Api(server_address="https://app.supervisely.com", token="4r47N...xaTatb")
|
|
357
357
|
|
|
358
358
|
dest_dir = 'your/local/dest/dir'
|
|
359
359
|
|
supervisely/task/progress.py
CHANGED
|
@@ -157,7 +157,7 @@ class Frame(KeyObject):
|
|
|
157
157
|
|
|
158
158
|
def to_json(self, key_id_map: KeyIdMap = None) -> Dict:
|
|
159
159
|
"""
|
|
160
|
-
Convert the Frame to a json dict. Read more about `Supervisely format <https://docs.
|
|
160
|
+
Convert the Frame to a json dict. Read more about `Supervisely format <https://docs.supervisely.com/data-organization/00_ann_format_navi>`_.
|
|
161
161
|
|
|
162
162
|
:param key_id_map: KeyIdMap object.
|
|
163
163
|
:type key_id_map: KeyIdMap, optional
|
|
@@ -221,7 +221,7 @@ class Frame(KeyObject):
|
|
|
221
221
|
key_id_map: Optional[KeyIdMap] = None,
|
|
222
222
|
) -> Frame:
|
|
223
223
|
"""
|
|
224
|
-
Convert a json dict to Frame. Read more about `Supervisely format <https://docs.
|
|
224
|
+
Convert a json dict to Frame. Read more about `Supervisely format <https://docs.supervisely.com/data-organization/00_ann_format_navi>`_.
|
|
225
225
|
|
|
226
226
|
:param data: Dict in json format.
|
|
227
227
|
:type data: dict
|
|
@@ -5,9 +5,9 @@ from __future__ import annotations
|
|
|
5
5
|
|
|
6
6
|
from typing import Any, Dict, List, Optional, Tuple
|
|
7
7
|
|
|
8
|
-
from supervisely.sly_logger import logger
|
|
9
8
|
from supervisely.api.module_api import ApiField
|
|
10
9
|
from supervisely.collection.key_indexed_collection import KeyIndexedCollection
|
|
10
|
+
from supervisely.sly_logger import logger
|
|
11
11
|
from supervisely.video_annotation.frame import Frame
|
|
12
12
|
from supervisely.video_annotation.key_id_map import KeyIdMap
|
|
13
13
|
from supervisely.video_annotation.video_figure import VideoFigure
|
|
@@ -207,7 +207,7 @@ class FrameCollection(KeyIndexedCollection):
|
|
|
207
207
|
|
|
208
208
|
def to_json(self, key_id_map: KeyIdMap = None) -> List[Dict]:
|
|
209
209
|
"""
|
|
210
|
-
Convert the FrameCollection to a list of json dicts. Read more about `Supervisely format <https://docs.
|
|
210
|
+
Convert the FrameCollection to a list of json dicts. Read more about `Supervisely format <https://docs.supervisely.com/data-organization/00_ann_format_navi>`_.
|
|
211
211
|
|
|
212
212
|
:param key_id_map: KeyIdMap object.
|
|
213
213
|
:type key_id_map: KeyIdMap, optional
|
|
@@ -248,7 +248,7 @@ class FrameCollection(KeyIndexedCollection):
|
|
|
248
248
|
skip_corrupted: Optional[bool] = False,
|
|
249
249
|
) -> FrameCollection:
|
|
250
250
|
"""
|
|
251
|
-
Convert a list of json dicts to FrameCollection. Read more about `Supervisely format <https://docs.
|
|
251
|
+
Convert a list of json dicts to FrameCollection. Read more about `Supervisely format <https://docs.supervisely.com/data-organization/00_ann_format_navi>`_.
|
|
252
252
|
|
|
253
253
|
:param data: List with dicts in json format.
|
|
254
254
|
:type data: List[dict]
|
|
@@ -536,7 +536,7 @@ class VideoAnnotation:
|
|
|
536
536
|
|
|
537
537
|
def to_json(self, key_id_map: Optional[KeyIdMap] = None) -> Dict:
|
|
538
538
|
"""
|
|
539
|
-
Convert the VideoAnnotation to a json dict. Read more about `Supervisely format <https://docs.
|
|
539
|
+
Convert the VideoAnnotation to a json dict. Read more about `Supervisely format <https://docs.supervisely.com/data-organization/00_ann_format_navi>`_.
|
|
540
540
|
|
|
541
541
|
:param key_id_map: KeyIdMap object.
|
|
542
542
|
:type key_id_map: KeyIdMap, optional
|
|
@@ -594,7 +594,7 @@ class VideoAnnotation:
|
|
|
594
594
|
skip_corrupted: Optional[bool] = False,
|
|
595
595
|
) -> VideoAnnotation:
|
|
596
596
|
"""
|
|
597
|
-
Convert a json dict to VideoAnnotation. Read more about `Supervisely format <https://docs.
|
|
597
|
+
Convert a json dict to VideoAnnotation. Read more about `Supervisely format <https://docs.supervisely.com/data-organization/00_ann_format_navi>`_.
|
|
598
598
|
|
|
599
599
|
:param data: Dict in json format.
|
|
600
600
|
:type data: dict
|
|
@@ -644,7 +644,9 @@ class VideoAnnotation:
|
|
|
644
644
|
|
|
645
645
|
tags = VideoTagCollection.from_json(data[TAGS], project_meta.tag_metas, key_id_map)
|
|
646
646
|
objects = VideoObjectCollection.from_json(data[OBJECTS], project_meta, key_id_map)
|
|
647
|
-
frames = FrameCollection.from_json(
|
|
647
|
+
frames = FrameCollection.from_json(
|
|
648
|
+
data[FRAMES], objects, frames_count, key_id_map, skip_corrupted
|
|
649
|
+
)
|
|
648
650
|
|
|
649
651
|
return cls(
|
|
650
652
|
img_size=img_size,
|
|
@@ -677,7 +679,7 @@ class VideoAnnotation:
|
|
|
677
679
|
|
|
678
680
|
import supervisely as sly
|
|
679
681
|
|
|
680
|
-
address = 'https://app.
|
|
682
|
+
address = 'https://app.supervisely.com/'
|
|
681
683
|
token = 'Your Supervisely API Token'
|
|
682
684
|
api = sly.Api(address, token)
|
|
683
685
|
|
|
@@ -782,7 +784,7 @@ class VideoAnnotation:
|
|
|
782
784
|
import supervisely as sly
|
|
783
785
|
from supervisely.video_annotation.key_id_map import KeyIdMap
|
|
784
786
|
|
|
785
|
-
address = 'https://app.
|
|
787
|
+
address = 'https://app.supervisely.com/'
|
|
786
788
|
token = 'Your Supervisely API Token'
|
|
787
789
|
api = sly.Api(address, token)
|
|
788
790
|
|
|
@@ -298,7 +298,7 @@ class VideoFigure:
|
|
|
298
298
|
self, key_id_map: Optional[KeyIdMap] = None, save_meta: Optional[bool] = False
|
|
299
299
|
) -> Dict:
|
|
300
300
|
"""
|
|
301
|
-
Convert the VideoFigure to a json dict. Read more about `Supervisely format <https://docs.
|
|
301
|
+
Convert the VideoFigure to a json dict. Read more about `Supervisely format <https://docs.supervisely.com/data-organization/00_ann_format_navi>`_.
|
|
302
302
|
|
|
303
303
|
:param key_id_map: KeyIdMap object.
|
|
304
304
|
:type key_id_map: KeyIdMap, optional
|
|
@@ -406,7 +406,7 @@ class VideoFigure:
|
|
|
406
406
|
key_id_map: Optional[KeyIdMap] = None,
|
|
407
407
|
) -> VideoFigure:
|
|
408
408
|
"""
|
|
409
|
-
Convert a json dict to VideoFigure. Read more about `Supervisely format <https://docs.
|
|
409
|
+
Convert a json dict to VideoFigure. Read more about `Supervisely format <https://docs.supervisely.com/data-organization/00_ann_format_navi>`_.
|
|
410
410
|
|
|
411
411
|
:param data: Dict in json format.
|
|
412
412
|
:type data: :class:`dict`
|
|
@@ -1,25 +1,27 @@
|
|
|
1
1
|
# coding: utf-8
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
|
-
|
|
4
|
+
|
|
5
5
|
import uuid
|
|
6
|
+
from typing import Dict, List, Optional
|
|
7
|
+
|
|
6
8
|
from bidict import bidict
|
|
7
9
|
|
|
10
|
+
from supervisely._utils import take_with_default
|
|
8
11
|
from supervisely.annotation.label import LabelJsonFields
|
|
9
12
|
from supervisely.annotation.obj_class import ObjClass
|
|
10
|
-
from supervisely.project.project_meta import ProjectMeta
|
|
11
|
-
from supervisely._utils import take_with_default
|
|
12
|
-
from supervisely.video_annotation.constants import KEY, ID, OBJECTS_MAP
|
|
13
|
-
from supervisely.video_annotation.video_tag_collection import VideoTagCollection
|
|
14
|
-
from supervisely.video_annotation.video_tag import VideoTag
|
|
15
13
|
from supervisely.collection.key_indexed_collection import KeyObject
|
|
16
|
-
from supervisely.video_annotation.key_id_map import KeyIdMap
|
|
17
14
|
from supervisely.geometry.constants import (
|
|
15
|
+
CLASS_ID,
|
|
16
|
+
CREATED_AT,
|
|
18
17
|
LABELER_LOGIN,
|
|
19
18
|
UPDATED_AT,
|
|
20
|
-
CREATED_AT,
|
|
21
|
-
CLASS_ID,
|
|
22
19
|
)
|
|
20
|
+
from supervisely.project.project_meta import ProjectMeta
|
|
21
|
+
from supervisely.video_annotation.constants import ID, KEY, OBJECTS_MAP
|
|
22
|
+
from supervisely.video_annotation.key_id_map import KeyIdMap
|
|
23
|
+
from supervisely.video_annotation.video_tag import VideoTag
|
|
24
|
+
from supervisely.video_annotation.video_tag_collection import VideoTagCollection
|
|
23
25
|
|
|
24
26
|
|
|
25
27
|
class VideoObject(KeyObject):
|
|
@@ -56,9 +58,17 @@ class VideoObject(KeyObject):
|
|
|
56
58
|
# "tags": []
|
|
57
59
|
# }
|
|
58
60
|
"""
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
61
|
+
|
|
62
|
+
def __init__(
|
|
63
|
+
self,
|
|
64
|
+
obj_class: ObjClass,
|
|
65
|
+
tags: Optional[VideoTagCollection] = None,
|
|
66
|
+
key: Optional[uuid.UUID] = None,
|
|
67
|
+
class_id: Optional[int] = None,
|
|
68
|
+
labeler_login: Optional[str] = None,
|
|
69
|
+
updated_at: Optional[str] = None,
|
|
70
|
+
created_at: Optional[str] = None,
|
|
71
|
+
):
|
|
62
72
|
self.labeler_login = labeler_login
|
|
63
73
|
self.updated_at = updated_at
|
|
64
74
|
self.created_at = created_at
|
|
@@ -273,7 +283,7 @@ class VideoObject(KeyObject):
|
|
|
273
283
|
|
|
274
284
|
def to_json(self, key_id_map: Optional[KeyIdMap] = None) -> Dict:
|
|
275
285
|
"""
|
|
276
|
-
Convert the VideoObject to a json dict. Read more about `Supervisely format <https://docs.
|
|
286
|
+
Convert the VideoObject to a json dict. Read more about `Supervisely format <https://docs.supervisely.com/data-organization/00_ann_format_navi>`_.
|
|
277
287
|
|
|
278
288
|
:param key_id_map: KeyIdMap object.
|
|
279
289
|
:type key_id_map: KeyIdMap, optional
|
|
@@ -312,9 +322,11 @@ class VideoObject(KeyObject):
|
|
|
312
322
|
return data_json
|
|
313
323
|
|
|
314
324
|
@classmethod
|
|
315
|
-
def from_json(
|
|
325
|
+
def from_json(
|
|
326
|
+
cls, data: Dict, project_meta: ProjectMeta, key_id_map: Optional[KeyIdMap] = None
|
|
327
|
+
) -> VideoObject:
|
|
316
328
|
"""
|
|
317
|
-
Convert a json dict to VideoObject. Read more about `Supervisely format <https://docs.
|
|
329
|
+
Convert a json dict to VideoObject. Read more about `Supervisely format <https://docs.supervisely.com/data-organization/00_ann_format_navi>`_.
|
|
318
330
|
|
|
319
331
|
:param data: Dict in json format.
|
|
320
332
|
:type data: dict
|
|
@@ -363,17 +375,23 @@ class VideoObject(KeyObject):
|
|
|
363
375
|
return cls(
|
|
364
376
|
obj_class=obj_class,
|
|
365
377
|
key=key,
|
|
366
|
-
tags=VideoTagCollection.from_json(
|
|
367
|
-
data[LabelJsonFields.TAGS], project_meta.tag_metas
|
|
368
|
-
),
|
|
378
|
+
tags=VideoTagCollection.from_json(data[LabelJsonFields.TAGS], project_meta.tag_metas),
|
|
369
379
|
class_id=class_id,
|
|
370
380
|
labeler_login=labeler_login,
|
|
371
381
|
updated_at=updated_at,
|
|
372
382
|
created_at=created_at,
|
|
373
383
|
)
|
|
374
384
|
|
|
375
|
-
def clone(
|
|
376
|
-
|
|
385
|
+
def clone(
|
|
386
|
+
self,
|
|
387
|
+
obj_class: Optional[ObjClass] = None,
|
|
388
|
+
tags: Optional[VideoTagCollection] = None,
|
|
389
|
+
key: Optional[KeyIdMap] = None,
|
|
390
|
+
class_id: Optional[int] = None,
|
|
391
|
+
labeler_login: Optional[str] = None,
|
|
392
|
+
updated_at: Optional[str] = None,
|
|
393
|
+
created_at: Optional[str] = None,
|
|
394
|
+
) -> VideoObject:
|
|
377
395
|
"""
|
|
378
396
|
Makes a copy of VideoObject with new fields, if fields are given, otherwise it will use fields of the original VideoObject.
|
|
379
397
|
|
|
@@ -428,11 +446,12 @@ class VideoObject(KeyObject):
|
|
|
428
446
|
# ]
|
|
429
447
|
# }
|
|
430
448
|
"""
|
|
431
|
-
return self.__class__(
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
449
|
+
return self.__class__(
|
|
450
|
+
obj_class=take_with_default(obj_class, self.obj_class),
|
|
451
|
+
key=take_with_default(key, self._key),
|
|
452
|
+
tags=take_with_default(tags, self.tags),
|
|
453
|
+
class_id=take_with_default(class_id, self.class_id),
|
|
454
|
+
labeler_login=take_with_default(labeler_login, self.labeler_login),
|
|
455
|
+
updated_at=take_with_default(updated_at, self.updated_at),
|
|
456
|
+
created_at=take_with_default(created_at, self.created_at),
|
|
457
|
+
)
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
# coding: utf-8
|
|
2
2
|
from __future__ import annotations
|
|
3
|
-
from typing import List, Dict, Optional, Any, Iterator
|
|
4
3
|
|
|
5
|
-
from
|
|
4
|
+
from typing import Any, Dict, Iterator, List, Optional
|
|
5
|
+
|
|
6
6
|
from supervisely.collection.key_indexed_collection import KeyIndexedCollection
|
|
7
7
|
from supervisely.project.project_meta import ProjectMeta
|
|
8
8
|
from supervisely.video_annotation.key_id_map import KeyIdMap
|
|
9
|
+
from supervisely.video_annotation.video_object import VideoObject
|
|
9
10
|
|
|
10
11
|
|
|
11
12
|
class VideoObjectCollection(KeyIndexedCollection):
|
|
@@ -158,14 +159,15 @@ class VideoObjectCollection(KeyIndexedCollection):
|
|
|
158
159
|
# }
|
|
159
160
|
# ]
|
|
160
161
|
"""
|
|
162
|
+
|
|
161
163
|
item_type = VideoObject
|
|
162
164
|
|
|
163
165
|
def __iter__(self) -> Iterator[VideoObject]:
|
|
164
166
|
return next(self)
|
|
165
167
|
|
|
166
|
-
def to_json(self, key_id_map: Optional[KeyIdMap]=None) -> List[Dict]:
|
|
168
|
+
def to_json(self, key_id_map: Optional[KeyIdMap] = None) -> List[Dict]:
|
|
167
169
|
"""
|
|
168
|
-
Convert the VideoObjectCollection to a list of json dicts. Read more about `Supervisely format <https://docs.
|
|
170
|
+
Convert the VideoObjectCollection to a list of json dicts. Read more about `Supervisely format <https://docs.supervisely.com/data-organization/00_ann_format_navi>`_.
|
|
169
171
|
|
|
170
172
|
:param key_id_map: KeyIdMap object.
|
|
171
173
|
:type key_id_map: KeyIdMap, optional
|
|
@@ -200,9 +202,11 @@ class VideoObjectCollection(KeyIndexedCollection):
|
|
|
200
202
|
return [item.to_json(key_id_map) for item in self]
|
|
201
203
|
|
|
202
204
|
@classmethod
|
|
203
|
-
def from_json(
|
|
205
|
+
def from_json(
|
|
206
|
+
cls, data: List[Dict], project_meta: ProjectMeta, key_id_map: Optional[KeyIdMap] = None
|
|
207
|
+
) -> VideoObjectCollection:
|
|
204
208
|
"""
|
|
205
|
-
Convert a list of json dicts to VideoObjectCollection. Read more about `Supervisely format <https://docs.
|
|
209
|
+
Convert a list of json dicts to VideoObjectCollection. Read more about `Supervisely format <https://docs.supervisely.com/data-organization/00_ann_format_navi>`_.
|
|
206
210
|
|
|
207
211
|
:param data: List with dicts in json format.
|
|
208
212
|
:type data: List[dict]
|
|
@@ -237,8 +241,11 @@ class VideoObjectCollection(KeyIndexedCollection):
|
|
|
237
241
|
|
|
238
242
|
video_obj_collection = sly.VideoObjectCollection.from_json(obj_collection_json, meta)
|
|
239
243
|
"""
|
|
240
|
-
objects = [
|
|
244
|
+
objects = [
|
|
245
|
+
cls.item_type.from_json(video_object_json, project_meta, key_id_map)
|
|
246
|
+
for video_object_json in data
|
|
247
|
+
]
|
|
241
248
|
return cls(objects)
|
|
242
249
|
|
|
243
250
|
def __str__(self):
|
|
244
|
-
return
|
|
251
|
+
return "Objects:\n" + super(VideoObjectCollection, self).__str__()
|
|
@@ -180,7 +180,7 @@ class VideoTag(Tag):
|
|
|
180
180
|
|
|
181
181
|
def to_json(self, key_id_map: Optional[KeyIdMap] = None) -> Dict:
|
|
182
182
|
"""
|
|
183
|
-
Convert the VideoTag to a json dict. Read more about `Supervisely format <https://docs.
|
|
183
|
+
Convert the VideoTag to a json dict. Read more about `Supervisely format <https://docs.supervisely.com/data-organization/00_ann_format_navi>`_.
|
|
184
184
|
|
|
185
185
|
:param key_id_map: Key ID Map object.
|
|
186
186
|
:type key_id_map: KeyIdMap, optional
|
|
@@ -229,7 +229,7 @@ class VideoTag(Tag):
|
|
|
229
229
|
key_id_map: Optional[KeyIdMap] = None,
|
|
230
230
|
) -> VideoTag:
|
|
231
231
|
"""
|
|
232
|
-
Convert a json dict to VideoTag. Read more about `Supervisely format <https://docs.
|
|
232
|
+
Convert a json dict to VideoTag. Read more about `Supervisely format <https://docs.supervisely.com/data-organization/00_ann_format_navi>`_.
|
|
233
233
|
|
|
234
234
|
:param data: VideoTag in json format as a dict.
|
|
235
235
|
:type data: dict
|
|
@@ -163,7 +163,7 @@ class VideoTagCollection(TagCollection):
|
|
|
163
163
|
|
|
164
164
|
def to_json(self, key_id_map: Optional[KeyIdMap] = None) -> List[Dict]:
|
|
165
165
|
"""
|
|
166
|
-
Convert the VideoTagCollection to a list of json dicts. Read more about `Supervisely format <https://docs.
|
|
166
|
+
Convert the VideoTagCollection to a list of json dicts. Read more about `Supervisely format <https://docs.supervisely.com/data-organization/00_ann_format_navi>`_.
|
|
167
167
|
|
|
168
168
|
:param key_id_map: KeyIdMap object.
|
|
169
169
|
:type key_id_map: KeyIdMap, optional
|
|
@@ -207,7 +207,7 @@ class VideoTagCollection(TagCollection):
|
|
|
207
207
|
key_id_map: Optional[KeyIdMap] = None,
|
|
208
208
|
) -> VideoTagCollection:
|
|
209
209
|
"""
|
|
210
|
-
Convert a list of json dicts to VideoTagCollection. Read more about `Supervisely format <https://docs.
|
|
210
|
+
Convert a list of json dicts to VideoTagCollection. Read more about `Supervisely format <https://docs.supervisely.com/data-organization/00_ann_format_navi>`_.
|
|
211
211
|
|
|
212
212
|
:param data: List with dicts in json format.
|
|
213
213
|
:type data: List[dict]
|
|
@@ -274,7 +274,7 @@ class VideoTagCollection(TagCollection):
|
|
|
274
274
|
import supervisely as sly
|
|
275
275
|
|
|
276
276
|
# You can connect to API directly
|
|
277
|
-
address = 'https://app.
|
|
277
|
+
address = 'https://app.supervisely.com/'
|
|
278
278
|
token = 'Your Supervisely API Token'
|
|
279
279
|
api = sly.Api(address, token)
|
|
280
280
|
|
|
@@ -306,7 +306,7 @@ class VideoTagCollection(TagCollection):
|
|
|
306
306
|
import supervisely as sly
|
|
307
307
|
|
|
308
308
|
# You can connect to API directly
|
|
309
|
-
address = 'https://app.
|
|
309
|
+
address = 'https://app.supervisely.com/'
|
|
310
310
|
token = 'Your Supervisely API Token'
|
|
311
311
|
api = sly.Api(address, token)
|
|
312
312
|
|
|
@@ -344,7 +344,7 @@ class VideoTagCollection(TagCollection):
|
|
|
344
344
|
import supervisely as sly
|
|
345
345
|
|
|
346
346
|
# You can connect to API directly
|
|
347
|
-
address = 'https://app.
|
|
347
|
+
address = 'https://app.supervisely.com/'
|
|
348
348
|
token = 'Your Supervisely API Token'
|
|
349
349
|
api = sly.Api(address, token)
|
|
350
350
|
|
|
@@ -465,7 +465,7 @@ class VolumeFigure(VideoFigure):
|
|
|
465
465
|
key_id_map: KeyIdMap = None,
|
|
466
466
|
):
|
|
467
467
|
"""
|
|
468
|
-
Convert a json dict to VolumeFigure. Read more about `Supervisely format <https://docs.
|
|
468
|
+
Convert a json dict to VolumeFigure. Read more about `Supervisely format <https://docs.supervisely.com/data-organization/00_ann_format_navi>`_.
|
|
469
469
|
|
|
470
470
|
:param data: Dict in json format.
|
|
471
471
|
:type data: dict
|
|
@@ -557,7 +557,7 @@ class VolumeFigure(VideoFigure):
|
|
|
557
557
|
|
|
558
558
|
def to_json(self, key_id_map=None, save_meta=True):
|
|
559
559
|
"""
|
|
560
|
-
Convert the VolumeFigure to a json dict. Read more about `Supervisely format <https://docs.
|
|
560
|
+
Convert the VolumeFigure to a json dict. Read more about `Supervisely format <https://docs.supervisely.com/data-organization/00_ann_format_navi>`_.
|
|
561
561
|
|
|
562
562
|
:param key_id_map: KeyIdMap object.
|
|
563
563
|
:type key_id_map: KeyIdMap, optional
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
# coding: utf-8
|
|
2
2
|
|
|
3
3
|
import uuid
|
|
4
|
-
|
|
4
|
+
|
|
5
5
|
from supervisely._utils import take_with_default
|
|
6
|
-
from supervisely.
|
|
6
|
+
from supervisely.annotation.tag import Tag, TagJsonFields
|
|
7
7
|
from supervisely.video_annotation.key_id_map import KeyIdMap
|
|
8
|
+
from supervisely.volume_annotation.constants import ID, KEY
|
|
8
9
|
|
|
9
10
|
|
|
10
11
|
class VolumeTag(Tag):
|
|
@@ -92,14 +93,14 @@ class VolumeTag(Tag):
|
|
|
92
93
|
meta_heart = sly.TagMeta('heart', sly.TagValueType.NONE)
|
|
93
94
|
tag_heart = VolumeTag(meta_heart)
|
|
94
95
|
|
|
95
|
-
print(tag_heart.key())
|
|
96
|
+
print(tag_heart.key())
|
|
96
97
|
# Output: 2d9cd2cd-f89c-40a9-8675-1b0773fa250d
|
|
97
98
|
"""
|
|
98
99
|
return self._key
|
|
99
100
|
|
|
100
101
|
def to_json(self, key_id_map: KeyIdMap = None):
|
|
101
102
|
"""
|
|
102
|
-
Convert the VolumeTag to a json dict. Read more about `Supervisely format <https://docs.
|
|
103
|
+
Convert the VolumeTag to a json dict. Read more about `Supervisely format <https://docs.supervisely.com/data-organization/00_ann_format_navi>`_.
|
|
103
104
|
|
|
104
105
|
:param key_id_map: Key ID Map object.
|
|
105
106
|
:type key_id_map: KeyIdMap, optional
|
|
@@ -140,7 +141,7 @@ class VolumeTag(Tag):
|
|
|
140
141
|
@classmethod
|
|
141
142
|
def from_json(cls, data: dict, tag_meta_collection, key_id_map: KeyIdMap = None):
|
|
142
143
|
"""
|
|
143
|
-
Convert a json dict to VolumeTag. Read more about `Supervisely format <https://docs.
|
|
144
|
+
Convert a json dict to VolumeTag. Read more about `Supervisely format <https://docs.supervisely.com/data-organization/00_ann_format_navi>`_.
|
|
144
145
|
|
|
145
146
|
:param data: VolumeTag in json format as a dict.
|
|
146
147
|
:type data: dict
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: supervisely
|
|
3
|
-
Version: 6.73.
|
|
3
|
+
Version: 6.73.368
|
|
4
4
|
Summary: Supervisely Python SDK.
|
|
5
5
|
Home-page: https://github.com/supervisely/supervisely
|
|
6
6
|
Author: Supervisely
|
|
7
|
-
Author-email: support@
|
|
7
|
+
Author-email: support@supervisely.com
|
|
8
8
|
Maintainer: Max Kolomeychenko
|
|
9
9
|
Classifier: Development Status :: 5 - Production/Stable
|
|
10
10
|
Classifier: Intended Audience :: Developers
|