supervisely 6.73.360__py3-none-any.whl → 6.73.361__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/nn/inference/inference.py +1 -2
- supervisely/project/download.py +24 -6
- supervisely/project/video_project.py +35 -6
- {supervisely-6.73.360.dist-info → supervisely-6.73.361.dist-info}/METADATA +1 -1
- {supervisely-6.73.360.dist-info → supervisely-6.73.361.dist-info}/RECORD +9 -9
- {supervisely-6.73.360.dist-info → supervisely-6.73.361.dist-info}/LICENSE +0 -0
- {supervisely-6.73.360.dist-info → supervisely-6.73.361.dist-info}/WHEEL +0 -0
- {supervisely-6.73.360.dist-info → supervisely-6.73.361.dist-info}/entry_points.txt +0 -0
- {supervisely-6.73.360.dist-info → supervisely-6.73.361.dist-info}/top_level.txt +0 -0
|
@@ -1519,7 +1519,7 @@ class Inference:
|
|
|
1519
1519
|
if frames_count is not None:
|
|
1520
1520
|
n_frames = frames_count
|
|
1521
1521
|
elif end_frame_index is not None:
|
|
1522
|
-
n_frames = end_frame_index - start_frame_index
|
|
1522
|
+
n_frames = end_frame_index - start_frame_index + 1
|
|
1523
1523
|
elif duration is not None:
|
|
1524
1524
|
fps = frames_reader.fps()
|
|
1525
1525
|
n_frames = int(duration * fps)
|
|
@@ -1729,7 +1729,6 @@ class Inference:
|
|
|
1729
1729
|
inference_settings = self._get_inference_settings(state)
|
|
1730
1730
|
logger.debug(f"Inference settings:", extra=inference_settings)
|
|
1731
1731
|
batch_size = self._get_batch_size_from_state(state)
|
|
1732
|
-
video_id = state["videoId"]
|
|
1733
1732
|
video_id = get_value_for_keys(state, ["videoId", "video_id"], ignore_none=True)
|
|
1734
1733
|
if video_id is None:
|
|
1735
1734
|
raise ValueError("Video id is not provided")
|
supervisely/project/download.py
CHANGED
|
@@ -409,12 +409,22 @@ def _project_meta_changed(meta1: ProjectMeta, meta2: ProjectMeta) -> bool:
|
|
|
409
409
|
return False
|
|
410
410
|
|
|
411
411
|
|
|
412
|
+
def _get_ds_full_name(
|
|
413
|
+
dataset_info: DatasetInfo, all_ds_infos: List[DatasetInfo], suffix: str = ""
|
|
414
|
+
) -> str:
|
|
415
|
+
if dataset_info.parent_id is None:
|
|
416
|
+
return dataset_info.name + suffix
|
|
417
|
+
parent = next((ds_info for ds_info in all_ds_infos if ds_info.id == dataset_info.parent_id))
|
|
418
|
+
return _get_ds_full_name(parent, all_ds_infos, "/" + dataset_info.name)
|
|
419
|
+
|
|
420
|
+
|
|
412
421
|
def _validate_dataset(
|
|
413
422
|
api: Api,
|
|
414
423
|
project_id: int,
|
|
415
424
|
project_type: str,
|
|
416
425
|
project_meta: ProjectMeta,
|
|
417
426
|
dataset_info: DatasetInfo,
|
|
427
|
+
all_ds_infos: List[DatasetInfo] = None,
|
|
418
428
|
):
|
|
419
429
|
try:
|
|
420
430
|
project_class = get_project_class(project_type)
|
|
@@ -430,10 +440,12 @@ def _validate_dataset(
|
|
|
430
440
|
except:
|
|
431
441
|
logger.debug("Validating dataset failed. Unable to download items infos.", exc_info=True)
|
|
432
442
|
return False
|
|
443
|
+
if all_ds_infos is None:
|
|
444
|
+
all_ds_infos = api.dataset.get_list(project_id, recursive=True)
|
|
433
445
|
project_meta_changed = _project_meta_changed(project_meta, project.meta)
|
|
434
446
|
for dataset in project.datasets:
|
|
435
447
|
dataset: Dataset
|
|
436
|
-
if dataset.name
|
|
448
|
+
if dataset.name == _get_ds_full_name(dataset_info, all_ds_infos):
|
|
437
449
|
diff = set(items_infos_dict.keys()).difference(set(dataset.get_items_names()))
|
|
438
450
|
if diff:
|
|
439
451
|
logger.debug(
|
|
@@ -481,7 +493,11 @@ def _validate_dataset(
|
|
|
481
493
|
|
|
482
494
|
|
|
483
495
|
def _validate(
|
|
484
|
-
api: Api,
|
|
496
|
+
api: Api,
|
|
497
|
+
project_info: ProjectInfo,
|
|
498
|
+
project_meta: ProjectMeta,
|
|
499
|
+
dataset_infos: List[DatasetInfo],
|
|
500
|
+
all_ds_infos: List[DatasetInfo] = None,
|
|
485
501
|
):
|
|
486
502
|
project_id = project_info.id
|
|
487
503
|
to_download, cached = _split_by_cache(
|
|
@@ -498,6 +514,7 @@ def _validate(
|
|
|
498
514
|
project_info.type,
|
|
499
515
|
project_meta,
|
|
500
516
|
dataset_info,
|
|
517
|
+
all_ds_infos,
|
|
501
518
|
):
|
|
502
519
|
to_download.add(ds_path)
|
|
503
520
|
cached.remove(ds_path)
|
|
@@ -520,7 +537,7 @@ def _add_save_items_infos_to_kwargs(kwargs: dict, project_type: str):
|
|
|
520
537
|
|
|
521
538
|
|
|
522
539
|
def _add_resume_download_to_kwargs(kwargs: dict, project_type: str):
|
|
523
|
-
supported_force_projects = (str(ProjectType.IMAGES),)
|
|
540
|
+
supported_force_projects = (str(ProjectType.IMAGES), (str(ProjectType.VIDEOS)))
|
|
524
541
|
if project_type in supported_force_projects:
|
|
525
542
|
kwargs["resume_download"] = True
|
|
526
543
|
return kwargs
|
|
@@ -592,13 +609,14 @@ def download_to_cache(
|
|
|
592
609
|
project_meta = ProjectMeta.from_json(api.project.get_meta(project_id))
|
|
593
610
|
if dataset_infos is not None and dataset_ids is not None:
|
|
594
611
|
raise ValueError("dataset_infos and dataset_ids cannot be specified at the same time")
|
|
612
|
+
all_ds_infos = api.dataset.get_list(project_id, recursive=True)
|
|
595
613
|
if dataset_infos is None:
|
|
596
614
|
if dataset_ids is None:
|
|
597
|
-
dataset_infos =
|
|
615
|
+
dataset_infos = all_ds_infos
|
|
598
616
|
else:
|
|
599
|
-
dataset_infos = [
|
|
617
|
+
dataset_infos = [ds_info for ds_info in all_ds_infos if ds_info.id in dataset_ids]
|
|
600
618
|
path_to_info = {_get_dataset_path(api, dataset_infos, info.id): info for info in dataset_infos}
|
|
601
|
-
to_download, cached = _validate(api, project_info, project_meta, dataset_infos)
|
|
619
|
+
to_download, cached = _validate(api, project_info, project_meta, dataset_infos, all_ds_infos)
|
|
602
620
|
if progress_cb is not None:
|
|
603
621
|
cached_items_n = sum(path_to_info[ds_path].items_count for ds_path in cached)
|
|
604
622
|
progress_cb(cached_items_n)
|
|
@@ -16,7 +16,7 @@ from supervisely.api.dataset_api import DatasetInfo
|
|
|
16
16
|
from supervisely.api.module_api import ApiField
|
|
17
17
|
from supervisely.api.video.video_api import VideoInfo
|
|
18
18
|
from supervisely.collection.key_indexed_collection import KeyIndexedCollection
|
|
19
|
-
from supervisely.io.fs import mkdir, touch, touch_async
|
|
19
|
+
from supervisely.io.fs import clean_dir, mkdir, touch, touch_async
|
|
20
20
|
from supervisely.io.json import dump_json_file, dump_json_file_async, load_json_file
|
|
21
21
|
from supervisely.project.project import Dataset, OpenMode, Project
|
|
22
22
|
from supervisely.project.project import read_single_project as read_project_wrapper
|
|
@@ -1056,6 +1056,7 @@ class VideoProject(Project):
|
|
|
1056
1056
|
save_video_info: bool = False,
|
|
1057
1057
|
log_progress: bool = True,
|
|
1058
1058
|
progress_cb: Optional[Union[tqdm, Callable]] = None,
|
|
1059
|
+
resume_download: Optional[bool] = False,
|
|
1059
1060
|
) -> None:
|
|
1060
1061
|
"""
|
|
1061
1062
|
Download video project from Supervisely to the given directory.
|
|
@@ -1109,6 +1110,7 @@ class VideoProject(Project):
|
|
|
1109
1110
|
save_video_info=save_video_info,
|
|
1110
1111
|
log_progress=log_progress,
|
|
1111
1112
|
progress_cb=progress_cb,
|
|
1113
|
+
resume_download=resume_download,
|
|
1112
1114
|
)
|
|
1113
1115
|
|
|
1114
1116
|
@staticmethod
|
|
@@ -1182,6 +1184,7 @@ class VideoProject(Project):
|
|
|
1182
1184
|
log_progress: bool = True,
|
|
1183
1185
|
progress_cb: Optional[Union[tqdm, Callable]] = None,
|
|
1184
1186
|
include_custom_data: bool = False,
|
|
1187
|
+
resume_download: Optional[bool] = False,
|
|
1185
1188
|
**kwargs,
|
|
1186
1189
|
) -> None:
|
|
1187
1190
|
"""
|
|
@@ -1238,6 +1241,7 @@ class VideoProject(Project):
|
|
|
1238
1241
|
log_progress=log_progress,
|
|
1239
1242
|
progress_cb=progress_cb,
|
|
1240
1243
|
include_custom_data=include_custom_data,
|
|
1244
|
+
resume_download=resume_download,
|
|
1241
1245
|
**kwargs,
|
|
1242
1246
|
)
|
|
1243
1247
|
|
|
@@ -1252,6 +1256,7 @@ def download_video_project(
|
|
|
1252
1256
|
log_progress: bool = True,
|
|
1253
1257
|
progress_cb: Optional[Union[tqdm, Callable]] = None,
|
|
1254
1258
|
include_custom_data: Optional[bool] = False,
|
|
1259
|
+
resume_download: Optional[bool] = False,
|
|
1255
1260
|
) -> None:
|
|
1256
1261
|
"""
|
|
1257
1262
|
Download video project to the local directory.
|
|
@@ -1312,9 +1317,22 @@ def download_video_project(
|
|
|
1312
1317
|
LOG_BATCH_SIZE = 1
|
|
1313
1318
|
|
|
1314
1319
|
key_id_map = KeyIdMap()
|
|
1315
|
-
|
|
1316
|
-
meta = ProjectMeta.from_json(api.project.get_meta(project_id))
|
|
1320
|
+
|
|
1321
|
+
meta = ProjectMeta.from_json(api.project.get_meta(project_id, with_settings=True))
|
|
1322
|
+
if os.path.exists(dest_dir) and resume_download:
|
|
1323
|
+
dump_json_file(meta.to_json(), os.path.join(dest_dir, "meta.json"))
|
|
1324
|
+
try:
|
|
1325
|
+
project_fs = VideoProject(dest_dir, OpenMode.READ)
|
|
1326
|
+
except RuntimeError as e:
|
|
1327
|
+
if "Project is empty" in str(e):
|
|
1328
|
+
clean_dir(dest_dir)
|
|
1329
|
+
project_fs = None
|
|
1330
|
+
else:
|
|
1331
|
+
raise
|
|
1332
|
+
if project_fs is None:
|
|
1333
|
+
project_fs = VideoProject(dest_dir, OpenMode.CREATE)
|
|
1317
1334
|
project_fs.set_meta(meta)
|
|
1335
|
+
|
|
1318
1336
|
if progress_cb is not None:
|
|
1319
1337
|
log_progress = False
|
|
1320
1338
|
|
|
@@ -1549,6 +1567,7 @@ async def download_video_project_async(
|
|
|
1549
1567
|
log_progress: bool = True,
|
|
1550
1568
|
progress_cb: Optional[Union[tqdm, Callable]] = None,
|
|
1551
1569
|
include_custom_data: Optional[bool] = False,
|
|
1570
|
+
resume_download: Optional[bool] = False,
|
|
1552
1571
|
**kwargs,
|
|
1553
1572
|
) -> None:
|
|
1554
1573
|
"""
|
|
@@ -1603,9 +1622,19 @@ async def download_video_project_async(
|
|
|
1603
1622
|
|
|
1604
1623
|
key_id_map = KeyIdMap()
|
|
1605
1624
|
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1625
|
+
meta = ProjectMeta.from_json(api.project.get_meta(project_id, with_settings=True))
|
|
1626
|
+
if os.path.exists(dest_dir) and resume_download:
|
|
1627
|
+
dump_json_file(meta.to_json(), os.path.join(dest_dir, "meta.json"))
|
|
1628
|
+
try:
|
|
1629
|
+
project_fs = VideoProject(dest_dir, OpenMode.READ)
|
|
1630
|
+
except RuntimeError as e:
|
|
1631
|
+
if "Project is empty" in str(e):
|
|
1632
|
+
clean_dir(dest_dir)
|
|
1633
|
+
project_fs = None
|
|
1634
|
+
else:
|
|
1635
|
+
raise
|
|
1636
|
+
if project_fs is None:
|
|
1637
|
+
project_fs = VideoProject(dest_dir, OpenMode.CREATE)
|
|
1609
1638
|
project_fs.set_meta(meta)
|
|
1610
1639
|
|
|
1611
1640
|
if progress_cb is not None:
|
|
@@ -888,7 +888,7 @@ supervisely/nn/benchmark/visualization/widgets/table/__init__.py,sha256=47DEQpj8
|
|
|
888
888
|
supervisely/nn/benchmark/visualization/widgets/table/table.py,sha256=atmDnF1Af6qLQBUjLhK18RMDKAYlxnsuVHMSEa5a-e8,4319
|
|
889
889
|
supervisely/nn/inference/__init__.py,sha256=QFukX2ip-U7263aEPCF_UCFwj6EujbMnsgrXp5Bbt8I,1623
|
|
890
890
|
supervisely/nn/inference/cache.py,sha256=rc_CRlCuTCzLDtcl1paTJib7ALTer0ge9o32WtoUMkY,34795
|
|
891
|
-
supervisely/nn/inference/inference.py,sha256=
|
|
891
|
+
supervisely/nn/inference/inference.py,sha256=OoslbS1Rog8PgvxBCrdkyxwMQw8ITlot1mQSxxSCd0c,177297
|
|
892
892
|
supervisely/nn/inference/inference_request.py,sha256=y6yw0vbaRRcEBS27nq3y0sL6Gmq2qLA_Bm0GrnJGegE,14267
|
|
893
893
|
supervisely/nn/inference/session.py,sha256=dIg2F-OBl68pUzcmtmcI0YQIp1WWNnrJTVMjwFN91Q4,35824
|
|
894
894
|
supervisely/nn/inference/uploader.py,sha256=21a9coOimCHhEqAbV-llZWcp12847DEMoQp3N16bpK0,5425
|
|
@@ -1032,7 +1032,7 @@ supervisely/pointcloud_episodes/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm
|
|
|
1032
1032
|
supervisely/pointcloud_episodes/pointcloud_episodes.py,sha256=cRXdtw7bMsbsdVQjxfWxFSESrO-LGiqqsZyyExl2Mbg,3430
|
|
1033
1033
|
supervisely/project/__init__.py,sha256=hlzdj9Pgy53Q3qdP8LMtGTChvZHQuuShdtui2eRUQeE,2601
|
|
1034
1034
|
supervisely/project/data_version.py,sha256=P5Lui6i64pYeJWmAdGJDv8GRXxjfpSSZ8zT_MxIrynE,19553
|
|
1035
|
-
supervisely/project/download.py,sha256=
|
|
1035
|
+
supervisely/project/download.py,sha256=nhxID-kbsNTgIY9l1lnRuUlzKrsJw80X07jEElyl3sE,28466
|
|
1036
1036
|
supervisely/project/pointcloud_episode_project.py,sha256=yiWdNBQiI6f1O9sr1pg8JHW6O-w3XUB1rikJNn3Oung,41866
|
|
1037
1037
|
supervisely/project/pointcloud_project.py,sha256=Kx1Vaes-krwG3BiRRtHRLQxb9G5m5bTHPN9IzRqmNWo,49399
|
|
1038
1038
|
supervisely/project/project.py,sha256=k0eE6Jy9eDYO-WUbDK0a-IVA34VVWYRzMBVkPY9XdGw,235812
|
|
@@ -1041,7 +1041,7 @@ supervisely/project/project_settings.py,sha256=NLThzU_DCynOK6hkHhVdFyezwprn9Uqln
|
|
|
1041
1041
|
supervisely/project/project_type.py,sha256=7mQ7zg6r7Bm2oFn5aR8n_PeLqMmOaPZd6ph7Z8ZISTw,608
|
|
1042
1042
|
supervisely/project/readme_template.md,sha256=NKYEoJubNWLV_HmhVmdB6L4dneLqDkvl2b71xy5fc54,9150
|
|
1043
1043
|
supervisely/project/upload.py,sha256=AjgHYgVZwUE25ygC5pqvFjdAladbyB8T78mlet5Qpho,3750
|
|
1044
|
-
supervisely/project/video_project.py,sha256=
|
|
1044
|
+
supervisely/project/video_project.py,sha256=zAtB3YpW9tC9Tc3qfapbQ9O2nhAWU2wDjMuS5sepXqc,65297
|
|
1045
1045
|
supervisely/project/volume_project.py,sha256=Kn9VEvWuKKZvL2nx6B6bjSvHuoZhAOxEc6DvPRexUco,22666
|
|
1046
1046
|
supervisely/pyscripts_utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
1047
1047
|
supervisely/pyscripts_utils/utils.py,sha256=scEwHJvHRQa8NHIOn2eTwH6-Zc8CGdLoxM-WzH9jcRo,314
|
|
@@ -1097,9 +1097,9 @@ supervisely/worker_proto/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZ
|
|
|
1097
1097
|
supervisely/worker_proto/worker_api_pb2.py,sha256=VQfi5JRBHs2pFCK1snec3JECgGnua3Xjqw_-b3aFxuM,59142
|
|
1098
1098
|
supervisely/worker_proto/worker_api_pb2_grpc.py,sha256=3BwQXOaP9qpdi0Dt9EKG--Lm8KGN0C5AgmUfRv77_Jk,28940
|
|
1099
1099
|
supervisely_lib/__init__.py,sha256=7-3QnN8Zf0wj8NCr2oJmqoQWMKKPKTECvjH9pd2S5vY,159
|
|
1100
|
-
supervisely-6.73.
|
|
1101
|
-
supervisely-6.73.
|
|
1102
|
-
supervisely-6.73.
|
|
1103
|
-
supervisely-6.73.
|
|
1104
|
-
supervisely-6.73.
|
|
1105
|
-
supervisely-6.73.
|
|
1100
|
+
supervisely-6.73.361.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
1101
|
+
supervisely-6.73.361.dist-info/METADATA,sha256=ZGEe4t9l88XpSPZES9bz3rmND8dJK-rMzlsXosDmXBU,35151
|
|
1102
|
+
supervisely-6.73.361.dist-info/WHEEL,sha256=iAkIy5fosb7FzIOwONchHf19Qu7_1wCWyFNR5gu9nU0,91
|
|
1103
|
+
supervisely-6.73.361.dist-info/entry_points.txt,sha256=U96-5Hxrp2ApRjnCoUiUhWMqijqh8zLR03sEhWtAcms,102
|
|
1104
|
+
supervisely-6.73.361.dist-info/top_level.txt,sha256=kcFVwb7SXtfqZifrZaSE3owHExX4gcNYe7Q2uoby084,28
|
|
1105
|
+
supervisely-6.73.361.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|