supervisely 6.73.289__py3-none-any.whl → 6.73.290__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.
Potentially problematic release.
This version of supervisely might be problematic. Click here for more details.
- supervisely/api/image_api.py +23 -5
- {supervisely-6.73.289.dist-info → supervisely-6.73.290.dist-info}/METADATA +1 -1
- {supervisely-6.73.289.dist-info → supervisely-6.73.290.dist-info}/RECORD +7 -7
- {supervisely-6.73.289.dist-info → supervisely-6.73.290.dist-info}/LICENSE +0 -0
- {supervisely-6.73.289.dist-info → supervisely-6.73.290.dist-info}/WHEEL +0 -0
- {supervisely-6.73.289.dist-info → supervisely-6.73.290.dist-info}/entry_points.txt +0 -0
- {supervisely-6.73.289.dist-info → supervisely-6.73.290.dist-info}/top_level.txt +0 -0
supervisely/api/image_api.py
CHANGED
|
@@ -78,6 +78,7 @@ from supervisely.project.project_type import (
|
|
|
78
78
|
from supervisely.sly_logger import logger
|
|
79
79
|
|
|
80
80
|
SUPPORTED_CONFLICT_RESOLUTIONS = ["skip", "rename", "replace"]
|
|
81
|
+
API_DEFAULT_PER_PAGE = 500
|
|
81
82
|
|
|
82
83
|
|
|
83
84
|
class ImageInfo(NamedTuple):
|
|
@@ -4486,7 +4487,7 @@ class ImageApi(RemoveableBulkModuleApi):
|
|
|
4486
4487
|
force_metadata_for_links: Optional[bool] = True,
|
|
4487
4488
|
only_labelled: Optional[bool] = False,
|
|
4488
4489
|
fields: Optional[List[str]] = None,
|
|
4489
|
-
per_page: Optional[int] =
|
|
4490
|
+
per_page: Optional[int] = None,
|
|
4490
4491
|
semaphore: Optional[List[asyncio.Semaphore]] = None,
|
|
4491
4492
|
**kwargs,
|
|
4492
4493
|
) -> AsyncGenerator[List[ImageInfo]]:
|
|
@@ -4529,13 +4530,33 @@ class ImageApi(RemoveableBulkModuleApi):
|
|
|
4529
4530
|
loop = sly.utils.get_or_create_event_loop()
|
|
4530
4531
|
images = loop.run_until_complete(api.image.get_list_async(123456, per_page=600))
|
|
4531
4532
|
"""
|
|
4532
|
-
|
|
4533
|
+
|
|
4533
4534
|
method = "images.list"
|
|
4534
4535
|
dataset_info = kwargs.get("dataset_info", None)
|
|
4535
4536
|
|
|
4536
4537
|
if dataset_info is None:
|
|
4537
4538
|
dataset_info = self._api.dataset.get_info_by_id(dataset_id, raise_error=True)
|
|
4538
4539
|
|
|
4540
|
+
if semaphore is None:
|
|
4541
|
+
semaphore = self._api.get_default_semaphore()
|
|
4542
|
+
|
|
4543
|
+
if per_page is None:
|
|
4544
|
+
async with semaphore:
|
|
4545
|
+
# optimized request to get perPage value that predefined on Supervisely instance
|
|
4546
|
+
response = await self._api.post_async(
|
|
4547
|
+
method,
|
|
4548
|
+
{
|
|
4549
|
+
ApiField.DATASET_ID: dataset_info.id,
|
|
4550
|
+
ApiField.FIELDS: [ApiField.ID, ApiField.PATH_ORIGINAL],
|
|
4551
|
+
ApiField.FILTER: [
|
|
4552
|
+
{ApiField.FIELD: ApiField.ID, ApiField.OPERATOR: "=", ApiField.VALUE: 1}
|
|
4553
|
+
],
|
|
4554
|
+
ApiField.FORCE_METADATA_FOR_LINKS: False,
|
|
4555
|
+
},
|
|
4556
|
+
)
|
|
4557
|
+
response_json = response.json()
|
|
4558
|
+
per_page = response_json.get("perPage", API_DEFAULT_PER_PAGE)
|
|
4559
|
+
|
|
4539
4560
|
total_pages = ceil(dataset_info.items_count / per_page)
|
|
4540
4561
|
|
|
4541
4562
|
data = {
|
|
@@ -4562,9 +4583,6 @@ class ImageApi(RemoveableBulkModuleApi):
|
|
|
4562
4583
|
}
|
|
4563
4584
|
]
|
|
4564
4585
|
|
|
4565
|
-
if semaphore is None:
|
|
4566
|
-
semaphore = self._api.get_default_semaphore()
|
|
4567
|
-
|
|
4568
4586
|
async for page in self.get_list_page_generator_async(method, data, total_pages, semaphore):
|
|
4569
4587
|
yield page
|
|
4570
4588
|
|
|
@@ -28,7 +28,7 @@ supervisely/api/dataset_api.py,sha256=GH7prDRJKyJlTv_7_Y-RkTwJN7ED4EkXNqqmi3iIdI
|
|
|
28
28
|
supervisely/api/file_api.py,sha256=v2FsD3oljwNPqcDgEJRe8Bu5k0PYKzVhqmRb5QFaHAQ,83422
|
|
29
29
|
supervisely/api/github_api.py,sha256=NIexNjEer9H5rf5sw2LEZd7C1WR-tK4t6IZzsgeAAwQ,623
|
|
30
30
|
supervisely/api/image_annotation_tool_api.py,sha256=YcUo78jRDBJYvIjrd-Y6FJAasLta54nnxhyaGyanovA,5237
|
|
31
|
-
supervisely/api/image_api.py,sha256=
|
|
31
|
+
supervisely/api/image_api.py,sha256=_hoFKsJpvHxrjoLronFNg348TGUn-OC0f5Nuq7IyFIk,191905
|
|
32
32
|
supervisely/api/import_storage_api.py,sha256=BDCgmR0Hv6OoiRHLCVPKt3iDxSVlQp1WrnKhAK_Zl84,460
|
|
33
33
|
supervisely/api/issues_api.py,sha256=BqDJXmNoTzwc3xe6_-mA7FDFC5QQ-ahGbXk_HmpkSeQ,17925
|
|
34
34
|
supervisely/api/labeling_job_api.py,sha256=odnzZjp29yM16Gq-FYkv-OA4WFMNJCLFo4qSikW2A7c,56280
|
|
@@ -1071,9 +1071,9 @@ supervisely/worker_proto/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZ
|
|
|
1071
1071
|
supervisely/worker_proto/worker_api_pb2.py,sha256=VQfi5JRBHs2pFCK1snec3JECgGnua3Xjqw_-b3aFxuM,59142
|
|
1072
1072
|
supervisely/worker_proto/worker_api_pb2_grpc.py,sha256=3BwQXOaP9qpdi0Dt9EKG--Lm8KGN0C5AgmUfRv77_Jk,28940
|
|
1073
1073
|
supervisely_lib/__init__.py,sha256=7-3QnN8Zf0wj8NCr2oJmqoQWMKKPKTECvjH9pd2S5vY,159
|
|
1074
|
-
supervisely-6.73.
|
|
1075
|
-
supervisely-6.73.
|
|
1076
|
-
supervisely-6.73.
|
|
1077
|
-
supervisely-6.73.
|
|
1078
|
-
supervisely-6.73.
|
|
1079
|
-
supervisely-6.73.
|
|
1074
|
+
supervisely-6.73.290.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
1075
|
+
supervisely-6.73.290.dist-info/METADATA,sha256=B9crK8mR_VqKArU2r9540M7jiO3aypWHsKAcdeU0YKs,33573
|
|
1076
|
+
supervisely-6.73.290.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
|
|
1077
|
+
supervisely-6.73.290.dist-info/entry_points.txt,sha256=U96-5Hxrp2ApRjnCoUiUhWMqijqh8zLR03sEhWtAcms,102
|
|
1078
|
+
supervisely-6.73.290.dist-info/top_level.txt,sha256=kcFVwb7SXtfqZifrZaSE3owHExX4gcNYe7Q2uoby084,28
|
|
1079
|
+
supervisely-6.73.290.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|