supervisely 6.73.312__py3-none-any.whl → 6.73.314__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.

@@ -45,6 +45,7 @@ from supervisely.geometry.polygon import Polygon
45
45
  from supervisely.geometry.polyline import Polyline
46
46
  from supervisely.geometry.rectangle import Rectangle
47
47
  from supervisely.project.project_meta import ProjectMeta
48
+ from supervisely.project.project_type import ProjectType
48
49
  from supervisely.sly_logger import logger
49
50
 
50
51
 
@@ -333,6 +334,7 @@ class LabelingJobApi(RemoveableBulkModuleApi, ModuleWithStatus):
333
334
  dynamic_tags: Optional[bool] = False,
334
335
  disable_confirm: Optional[bool] = None,
335
336
  disable_submit: Optional[bool] = None,
337
+ toolbox_settings: Optional[Dict] = None,
336
338
  ) -> List[LabelingJobInfo]:
337
339
  """
338
340
  Creates Labeling Job and assigns given Users to it.
@@ -373,6 +375,8 @@ class LabelingJobApi(RemoveableBulkModuleApi, ModuleWithStatus):
373
375
  :type disable_confirm: bool, optional
374
376
  :param disable_submit: If True, the Submit button will be disabled in the labeling tool. It will remain disabled until the next API call sets the parameter to False, re-enabling the button.
375
377
  :type disable_submit: bool, optional
378
+ :param toolbox_settings: Settings for the labeling tool. Only video projects are supported.
379
+ :type toolbox_settings: Dict, optional
376
380
  :return: List of information about new Labeling Job. See :class:`info_sequence<info_sequence>`
377
381
  :rtype: :class:`List[LabelingJobInfo]`
378
382
  :Usage example:
@@ -387,125 +391,40 @@ class LabelingJobApi(RemoveableBulkModuleApi, ModuleWithStatus):
387
391
 
388
392
  user_name = 'alex'
389
393
  dataset_id = 602
390
- new_label_jobs = api.labeling_job.create(user_name, dataset_id, user_ids=[111, 222], readme='Readmy text',
391
- description='Work for labelers', objects_limit_per_image=5, tags_limit_per_image=3)
392
- print(new_label_jobs)
393
- # Output: [
394
- # [
395
- # 92,
396
- # "alex (#1) (#3)",
397
- # "Readmy text",
398
- # "Work for labelers",
399
- # 13,
400
- # 29,
401
- # "Labelling Workspace",
402
- # 494,
403
- # "Test Dataset",
404
- # 602,
405
- # "ds1",
406
- # 8,
407
- # "alex",
408
- # 111,
409
- # "quantigo273",
410
- # 8,
411
- # "alex",
412
- # "2021-03-25T11:04:34.031Z",
413
- # null,
414
- # null,
415
- # "pending",
416
- # false,
417
- # 3,
418
- # 0,
419
- # 0,
420
- # 0,
421
- # 0,
422
- # [],
423
- # [],
424
- # [
425
- # null,
426
- # null
427
- # ],
428
- # 5,
429
- # 3,
430
- # [],
431
- # [],
432
- # [],
433
- # [
434
- # {
435
- # "reviewStatus": "none",
436
- # "id": 287244,
437
- # "name": "IMG_0813"
438
- # },
439
- # {
440
- # "reviewStatus": "none",
441
- # "id": 287246,
442
- # "name": "IMG_0432"
443
- # },
444
- # {
445
- # "reviewStatus": "none",
446
- # "id": 287245,
447
- # "name": "IMG_0315"
448
- # }
449
- # ]
450
- # ],
451
- # [
452
- # 93,
453
- # "alex (#2) (#3)",
454
- # "Readmy text",
455
- # "Work for labelers",
456
- # 13,
457
- # 29,
458
- # "Labelling Workspace",
459
- # 494,
460
- # "Test Dataset",
461
- # 602,
462
- # "ds1",
463
- # 8,
464
- # "alex",
465
- # 222,
466
- # "quantigo19",
467
- # 8,
468
- # "alex",
469
- # "2021-03-25T11:04:34.031Z",
470
- # null,
471
- # null,
472
- # "pending",
473
- # false,
474
- # 3,
475
- # 0,
476
- # 0,
477
- # 0,
478
- # 0,
479
- # [],
480
- # [],
481
- # [
482
- # null,
483
- # null
484
- # ],
485
- # 5,
486
- # 3,
487
- # [],
488
- # [],
489
- # [],
490
- # [
491
- # {
492
- # "reviewStatus": "none",
493
- # "id": 287248,
494
- # "name": "IMG_8454"
495
- # },
496
- # {
497
- # "reviewStatus": "none",
498
- # "id": 287249,
499
- # "name": "IMG_6896"
500
- # },
501
- # {
502
- # "reviewStatus": "none",
503
- # "id": 287247,
504
- # "name": "IMG_1942"
505
- # }
506
- # ]
507
- # ]
508
- # ]
394
+ new_labeling_jobs = api.labeling_job.create(
395
+ user_name,
396
+ dataset_id,
397
+ user_ids=[111, 222],
398
+ readme='Readmy text',
399
+ description='Work for labelers',
400
+ objects_limit_per_image=5,
401
+ tags_limit_per_image=3
402
+ )
403
+ print(new_labeling_jobs)
404
+
405
+ # >>> List[LabelingJobInfo(id=2,...)]
406
+
407
+ # Create video labeling job with toolbox settings
408
+
409
+ user_id = 4
410
+ dataset_id = 277
411
+ video_id = 24897
412
+ toolbox_settings = {"playbackRate": 32, "skipFramesSize": 15, "showVideoTime": True}
413
+
414
+ new_labeling_jobs = api.labeling_job.create(
415
+ name="Labeling Job name",
416
+ dataset_id=dataset_id,
417
+ user_ids=[user_id],
418
+ readme="Labeling Job readme",
419
+ description="Some description",
420
+ classes_to_label=["car", "animal"],
421
+ tags_to_label=["animal_age_group"],
422
+ images_ids=[video_id],
423
+ toolbox_settings=toolbox_settings,
424
+ )
425
+ print(new_labeling_jobs)
426
+
427
+ # >>> List[LabelingJobInfo(id=3,...)]
509
428
  """
510
429
  if classes_to_label is None:
511
430
  classes_to_label = []
@@ -538,6 +457,39 @@ class LabelingJobApi(RemoveableBulkModuleApi, ModuleWithStatus):
538
457
  "dynamicTags": dynamic_tags,
539
458
  }
540
459
 
460
+ if toolbox_settings is not None:
461
+ dataset_info = self._api.dataset.get_info_by_id(dataset_id)
462
+ project_id = dataset_info.project_id
463
+ project_info = self._api.project.get_info_by_id(project_id)
464
+ project_type = project_info.type
465
+ if project_type == ProjectType.VIDEOS.value:
466
+ playback_rate_possible_values = [
467
+ 0.1,
468
+ 0.3,
469
+ 0.5,
470
+ 0.6,
471
+ 0.7,
472
+ 0.8,
473
+ 0.9,
474
+ 1,
475
+ 1.1,
476
+ 1.2,
477
+ 1.3,
478
+ 1.5,
479
+ 2,
480
+ 4,
481
+ 8,
482
+ 16,
483
+ 32,
484
+ ]
485
+ playback_rate = toolbox_settings.get("playbackRate", None)
486
+ if playback_rate is not None:
487
+ if playback_rate not in playback_rate_possible_values:
488
+ raise ValueError(
489
+ f"'playbackRate' must be one of: '{','.join(playback_rate_possible_values)}'"
490
+ )
491
+ meta["toolboxSettings"] = toolbox_settings
492
+
541
493
  if disable_confirm is not None:
542
494
  meta.update({"disableConfirm": disable_confirm})
543
495
  if disable_submit is not None:
@@ -10,7 +10,10 @@ from uuid import uuid4
10
10
  from fastapi.responses import HTMLResponse
11
11
  from pydantic import BaseModel
12
12
 
13
+ from supervisely._utils import is_production
14
+ from supervisely.api.api import Api
13
15
  from supervisely.app.widgets import Widget
16
+ from supervisely.io.env import task_id as env_task_id
14
17
 
15
18
 
16
19
  class DebouncedEventHandler:
@@ -241,6 +244,12 @@ class Bokeh(Widget):
241
244
  from bokeh.models import CustomJS # pylint: disable=import-error
242
245
 
243
246
  route_path = self.get_route_path(Bokeh.Routes.VALUE_CHANGED)
247
+
248
+ if is_production():
249
+ api = Api()
250
+ task_info = api.task.get_info_by_id(env_task_id())
251
+ if task_info is not None:
252
+ route_path = f"/net/{task_info['meta']['sessionToken']}{route_path}"
244
253
  callback = CustomJS(
245
254
  args=dict(source=self._source),
246
255
  code=f"""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: supervisely
3
- Version: 6.73.312
3
+ Version: 6.73.314
4
4
  Summary: Supervisely Python SDK.
5
5
  Home-page: https://github.com/supervisely/supervisely
6
6
  Author: Supervisely
@@ -31,7 +31,7 @@ supervisely/api/image_annotation_tool_api.py,sha256=YcUo78jRDBJYvIjrd-Y6FJAasLta
31
31
  supervisely/api/image_api.py,sha256=WIML_6N1qgOWBm3acexmGSWz4hAaSxlYmUtbytROaP8,192375
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
- supervisely/api/labeling_job_api.py,sha256=odnzZjp29yM16Gq-FYkv-OA4WFMNJCLFo4qSikW2A7c,56280
34
+ supervisely/api/labeling_job_api.py,sha256=EWJh3TGauAOUWuAlK-Ey8s_S4FDMwa6I0snHX6dnhH8,55036
35
35
  supervisely/api/module_api.py,sha256=NkDU9gZ0hAHFVnbF26fOOx56QGizyQO23E2kMjKrBWM,44513
36
36
  supervisely/api/neural_network_api.py,sha256=ktPVRO4Jeulougio8F0mioJJHwRJcX250Djp1wBoQ9c,7620
37
37
  supervisely/api/object_class_api.py,sha256=-rQcKwhBw3iL9KNH9c1ROgoimgWM1ls6Wi_tb1R-MzY,7683
@@ -129,7 +129,7 @@ supervisely/app/widgets/binded_input_number/__init__.py,sha256=47DEQpj8HBSa-_TIm
129
129
  supervisely/app/widgets/binded_input_number/binded_input_number.py,sha256=RXTAGaMXtGOl4pprVLyQosr61t2rI_U_U8VNHhSyBhA,6251
130
130
  supervisely/app/widgets/binded_input_number/template.html,sha256=uCEZ54BNC2itr39wxxThXw62WlJ9659cuz8osCm0WZE,162
131
131
  supervisely/app/widgets/bokeh/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
132
- supervisely/app/widgets/bokeh/bokeh.py,sha256=H53AqKc3sGJU3aoYeIdFfJoeIquyxbIHCDV8CRBjrUs,13262
132
+ supervisely/app/widgets/bokeh/bokeh.py,sha256=ta1LtmfzJNs0D62Zx30SwDMtmdrRumzotkRiVbBKeWk,13636
133
133
  supervisely/app/widgets/bokeh/template.html,sha256=ntsh7xx4q9OHG62sa_r3INDxsXgvdPFIWTtYaWn_0t8,12
134
134
  supervisely/app/widgets/button/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
135
135
  supervisely/app/widgets/button/button.py,sha256=ddAXJqnotoeqgbmi_ewNE9jQqxjdu-NFdqpSsYu8a4Q,10561
@@ -1075,9 +1075,9 @@ supervisely/worker_proto/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZ
1075
1075
  supervisely/worker_proto/worker_api_pb2.py,sha256=VQfi5JRBHs2pFCK1snec3JECgGnua3Xjqw_-b3aFxuM,59142
1076
1076
  supervisely/worker_proto/worker_api_pb2_grpc.py,sha256=3BwQXOaP9qpdi0Dt9EKG--Lm8KGN0C5AgmUfRv77_Jk,28940
1077
1077
  supervisely_lib/__init__.py,sha256=7-3QnN8Zf0wj8NCr2oJmqoQWMKKPKTECvjH9pd2S5vY,159
1078
- supervisely-6.73.312.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
1079
- supervisely-6.73.312.dist-info/METADATA,sha256=PPqHYBNXFQ0EUVs242nEG-VAEBDVk7pwq033pSKWZ68,33596
1080
- supervisely-6.73.312.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
1081
- supervisely-6.73.312.dist-info/entry_points.txt,sha256=U96-5Hxrp2ApRjnCoUiUhWMqijqh8zLR03sEhWtAcms,102
1082
- supervisely-6.73.312.dist-info/top_level.txt,sha256=kcFVwb7SXtfqZifrZaSE3owHExX4gcNYe7Q2uoby084,28
1083
- supervisely-6.73.312.dist-info/RECORD,,
1078
+ supervisely-6.73.314.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
1079
+ supervisely-6.73.314.dist-info/METADATA,sha256=tkFe5LFrkVUYUTeEIxFSOeaMTKdD2Yd5d5ELJNV7ONo,33596
1080
+ supervisely-6.73.314.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
1081
+ supervisely-6.73.314.dist-info/entry_points.txt,sha256=U96-5Hxrp2ApRjnCoUiUhWMqijqh8zLR03sEhWtAcms,102
1082
+ supervisely-6.73.314.dist-info/top_level.txt,sha256=kcFVwb7SXtfqZifrZaSE3owHExX4gcNYe7Q2uoby084,28
1083
+ supervisely-6.73.314.dist-info/RECORD,,