supervisely 6.73.438__py3-none-any.whl → 6.73.513__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.
Files changed (203) hide show
  1. supervisely/__init__.py +137 -1
  2. supervisely/_utils.py +81 -0
  3. supervisely/annotation/annotation.py +8 -2
  4. supervisely/annotation/json_geometries_map.py +14 -11
  5. supervisely/annotation/label.py +80 -3
  6. supervisely/api/annotation_api.py +14 -11
  7. supervisely/api/api.py +59 -38
  8. supervisely/api/app_api.py +11 -2
  9. supervisely/api/dataset_api.py +74 -12
  10. supervisely/api/entities_collection_api.py +10 -0
  11. supervisely/api/entity_annotation/figure_api.py +52 -4
  12. supervisely/api/entity_annotation/object_api.py +3 -3
  13. supervisely/api/entity_annotation/tag_api.py +63 -12
  14. supervisely/api/guides_api.py +210 -0
  15. supervisely/api/image_api.py +72 -1
  16. supervisely/api/labeling_job_api.py +83 -1
  17. supervisely/api/labeling_queue_api.py +33 -7
  18. supervisely/api/module_api.py +9 -0
  19. supervisely/api/project_api.py +71 -26
  20. supervisely/api/storage_api.py +3 -1
  21. supervisely/api/task_api.py +13 -2
  22. supervisely/api/team_api.py +4 -3
  23. supervisely/api/video/video_annotation_api.py +119 -3
  24. supervisely/api/video/video_api.py +65 -14
  25. supervisely/api/video/video_figure_api.py +24 -11
  26. supervisely/app/__init__.py +1 -1
  27. supervisely/app/content.py +23 -7
  28. supervisely/app/development/development.py +18 -2
  29. supervisely/app/fastapi/__init__.py +1 -0
  30. supervisely/app/fastapi/custom_static_files.py +1 -1
  31. supervisely/app/fastapi/multi_user.py +105 -0
  32. supervisely/app/fastapi/subapp.py +88 -42
  33. supervisely/app/fastapi/websocket.py +77 -9
  34. supervisely/app/singleton.py +21 -0
  35. supervisely/app/v1/app_service.py +18 -2
  36. supervisely/app/v1/constants.py +7 -1
  37. supervisely/app/widgets/__init__.py +6 -0
  38. supervisely/app/widgets/activity_feed/__init__.py +0 -0
  39. supervisely/app/widgets/activity_feed/activity_feed.py +239 -0
  40. supervisely/app/widgets/activity_feed/style.css +78 -0
  41. supervisely/app/widgets/activity_feed/template.html +22 -0
  42. supervisely/app/widgets/card/card.py +20 -0
  43. supervisely/app/widgets/classes_list_selector/classes_list_selector.py +121 -9
  44. supervisely/app/widgets/classes_list_selector/template.html +60 -93
  45. supervisely/app/widgets/classes_mapping/classes_mapping.py +13 -12
  46. supervisely/app/widgets/classes_table/classes_table.py +1 -0
  47. supervisely/app/widgets/deploy_model/deploy_model.py +56 -35
  48. supervisely/app/widgets/dialog/dialog.py +12 -0
  49. supervisely/app/widgets/dialog/template.html +2 -1
  50. supervisely/app/widgets/ecosystem_model_selector/ecosystem_model_selector.py +1 -1
  51. supervisely/app/widgets/experiment_selector/experiment_selector.py +8 -0
  52. supervisely/app/widgets/fast_table/fast_table.py +184 -60
  53. supervisely/app/widgets/fast_table/template.html +1 -1
  54. supervisely/app/widgets/heatmap/__init__.py +0 -0
  55. supervisely/app/widgets/heatmap/heatmap.py +564 -0
  56. supervisely/app/widgets/heatmap/script.js +533 -0
  57. supervisely/app/widgets/heatmap/style.css +233 -0
  58. supervisely/app/widgets/heatmap/template.html +21 -0
  59. supervisely/app/widgets/modal/__init__.py +0 -0
  60. supervisely/app/widgets/modal/modal.py +198 -0
  61. supervisely/app/widgets/modal/template.html +10 -0
  62. supervisely/app/widgets/object_class_view/object_class_view.py +3 -0
  63. supervisely/app/widgets/radio_tabs/radio_tabs.py +18 -2
  64. supervisely/app/widgets/radio_tabs/template.html +1 -0
  65. supervisely/app/widgets/select/select.py +6 -3
  66. supervisely/app/widgets/select_class/__init__.py +0 -0
  67. supervisely/app/widgets/select_class/select_class.py +363 -0
  68. supervisely/app/widgets/select_class/template.html +50 -0
  69. supervisely/app/widgets/select_cuda/select_cuda.py +22 -0
  70. supervisely/app/widgets/select_dataset_tree/select_dataset_tree.py +65 -7
  71. supervisely/app/widgets/select_tag/__init__.py +0 -0
  72. supervisely/app/widgets/select_tag/select_tag.py +352 -0
  73. supervisely/app/widgets/select_tag/template.html +64 -0
  74. supervisely/app/widgets/select_team/select_team.py +37 -4
  75. supervisely/app/widgets/select_team/template.html +4 -5
  76. supervisely/app/widgets/select_user/__init__.py +0 -0
  77. supervisely/app/widgets/select_user/select_user.py +270 -0
  78. supervisely/app/widgets/select_user/template.html +13 -0
  79. supervisely/app/widgets/select_workspace/select_workspace.py +59 -10
  80. supervisely/app/widgets/select_workspace/template.html +9 -12
  81. supervisely/app/widgets/table/table.py +68 -13
  82. supervisely/app/widgets/tree_select/tree_select.py +2 -0
  83. supervisely/aug/aug.py +6 -2
  84. supervisely/convert/base_converter.py +1 -0
  85. supervisely/convert/converter.py +2 -2
  86. supervisely/convert/image/csv/csv_converter.py +24 -15
  87. supervisely/convert/image/image_converter.py +3 -1
  88. supervisely/convert/image/image_helper.py +48 -4
  89. supervisely/convert/image/label_studio/label_studio_converter.py +2 -0
  90. supervisely/convert/image/medical2d/medical2d_helper.py +2 -24
  91. supervisely/convert/image/multispectral/multispectral_converter.py +6 -0
  92. supervisely/convert/image/pascal_voc/pascal_voc_converter.py +8 -5
  93. supervisely/convert/image/pascal_voc/pascal_voc_helper.py +7 -0
  94. supervisely/convert/pointcloud/kitti_3d/kitti_3d_converter.py +33 -3
  95. supervisely/convert/pointcloud/kitti_3d/kitti_3d_helper.py +12 -5
  96. supervisely/convert/pointcloud/las/las_converter.py +13 -1
  97. supervisely/convert/pointcloud/las/las_helper.py +110 -11
  98. supervisely/convert/pointcloud/nuscenes_conv/nuscenes_converter.py +27 -16
  99. supervisely/convert/pointcloud/pointcloud_converter.py +91 -3
  100. supervisely/convert/pointcloud_episodes/nuscenes_conv/nuscenes_converter.py +58 -22
  101. supervisely/convert/pointcloud_episodes/nuscenes_conv/nuscenes_helper.py +21 -47
  102. supervisely/convert/video/__init__.py +1 -0
  103. supervisely/convert/video/multi_view/__init__.py +0 -0
  104. supervisely/convert/video/multi_view/multi_view.py +543 -0
  105. supervisely/convert/video/sly/sly_video_converter.py +359 -3
  106. supervisely/convert/video/video_converter.py +24 -4
  107. supervisely/convert/volume/dicom/dicom_converter.py +13 -5
  108. supervisely/convert/volume/dicom/dicom_helper.py +30 -18
  109. supervisely/geometry/constants.py +1 -0
  110. supervisely/geometry/geometry.py +4 -0
  111. supervisely/geometry/helpers.py +5 -1
  112. supervisely/geometry/oriented_bbox.py +676 -0
  113. supervisely/geometry/polyline_3d.py +110 -0
  114. supervisely/geometry/rectangle.py +2 -1
  115. supervisely/io/env.py +76 -1
  116. supervisely/io/fs.py +21 -0
  117. supervisely/nn/benchmark/base_evaluator.py +104 -11
  118. supervisely/nn/benchmark/instance_segmentation/evaluator.py +1 -8
  119. supervisely/nn/benchmark/object_detection/evaluator.py +20 -4
  120. supervisely/nn/benchmark/object_detection/vis_metrics/pr_curve.py +10 -5
  121. supervisely/nn/benchmark/semantic_segmentation/evaluator.py +34 -16
  122. supervisely/nn/benchmark/semantic_segmentation/vis_metrics/confusion_matrix.py +1 -1
  123. supervisely/nn/benchmark/semantic_segmentation/vis_metrics/frequently_confused.py +1 -1
  124. supervisely/nn/benchmark/semantic_segmentation/vis_metrics/overview.py +1 -1
  125. supervisely/nn/benchmark/visualization/evaluation_result.py +66 -4
  126. supervisely/nn/inference/cache.py +43 -18
  127. supervisely/nn/inference/gui/serving_gui_template.py +5 -2
  128. supervisely/nn/inference/inference.py +916 -222
  129. supervisely/nn/inference/inference_request.py +55 -10
  130. supervisely/nn/inference/predict_app/gui/classes_selector.py +83 -12
  131. supervisely/nn/inference/predict_app/gui/gui.py +676 -488
  132. supervisely/nn/inference/predict_app/gui/input_selector.py +205 -26
  133. supervisely/nn/inference/predict_app/gui/model_selector.py +2 -4
  134. supervisely/nn/inference/predict_app/gui/output_selector.py +46 -6
  135. supervisely/nn/inference/predict_app/gui/settings_selector.py +756 -59
  136. supervisely/nn/inference/predict_app/gui/tags_selector.py +1 -1
  137. supervisely/nn/inference/predict_app/gui/utils.py +236 -119
  138. supervisely/nn/inference/predict_app/predict_app.py +2 -2
  139. supervisely/nn/inference/session.py +43 -35
  140. supervisely/nn/inference/tracking/bbox_tracking.py +118 -35
  141. supervisely/nn/inference/tracking/point_tracking.py +5 -1
  142. supervisely/nn/inference/tracking/tracker_interface.py +10 -1
  143. supervisely/nn/inference/uploader.py +139 -12
  144. supervisely/nn/live_training/__init__.py +7 -0
  145. supervisely/nn/live_training/api_server.py +111 -0
  146. supervisely/nn/live_training/artifacts_utils.py +243 -0
  147. supervisely/nn/live_training/checkpoint_utils.py +229 -0
  148. supervisely/nn/live_training/dynamic_sampler.py +44 -0
  149. supervisely/nn/live_training/helpers.py +14 -0
  150. supervisely/nn/live_training/incremental_dataset.py +146 -0
  151. supervisely/nn/live_training/live_training.py +497 -0
  152. supervisely/nn/live_training/loss_plateau_detector.py +111 -0
  153. supervisely/nn/live_training/request_queue.py +52 -0
  154. supervisely/nn/model/model_api.py +9 -0
  155. supervisely/nn/model/prediction.py +2 -1
  156. supervisely/nn/model/prediction_session.py +26 -14
  157. supervisely/nn/prediction_dto.py +19 -1
  158. supervisely/nn/tracker/base_tracker.py +11 -1
  159. supervisely/nn/tracker/botsort/botsort_config.yaml +0 -1
  160. supervisely/nn/tracker/botsort/tracker/mc_bot_sort.py +7 -4
  161. supervisely/nn/tracker/botsort_tracker.py +94 -65
  162. supervisely/nn/tracker/utils.py +4 -5
  163. supervisely/nn/tracker/visualize.py +93 -93
  164. supervisely/nn/training/gui/classes_selector.py +16 -1
  165. supervisely/nn/training/gui/train_val_splits_selector.py +52 -31
  166. supervisely/nn/training/train_app.py +46 -31
  167. supervisely/project/data_version.py +115 -51
  168. supervisely/project/download.py +1 -1
  169. supervisely/project/pointcloud_episode_project.py +37 -8
  170. supervisely/project/pointcloud_project.py +30 -2
  171. supervisely/project/project.py +14 -2
  172. supervisely/project/project_meta.py +27 -1
  173. supervisely/project/project_settings.py +32 -18
  174. supervisely/project/versioning/__init__.py +1 -0
  175. supervisely/project/versioning/common.py +20 -0
  176. supervisely/project/versioning/schema_fields.py +35 -0
  177. supervisely/project/versioning/video_schema.py +221 -0
  178. supervisely/project/versioning/volume_schema.py +87 -0
  179. supervisely/project/video_project.py +717 -15
  180. supervisely/project/volume_project.py +623 -5
  181. supervisely/template/experiment/experiment.html.jinja +4 -4
  182. supervisely/template/experiment/experiment_generator.py +14 -21
  183. supervisely/template/live_training/__init__.py +0 -0
  184. supervisely/template/live_training/header.html.jinja +96 -0
  185. supervisely/template/live_training/live_training.html.jinja +51 -0
  186. supervisely/template/live_training/live_training_generator.py +464 -0
  187. supervisely/template/live_training/sly-style.css +402 -0
  188. supervisely/template/live_training/template.html.jinja +18 -0
  189. supervisely/versions.json +28 -26
  190. supervisely/video/sampling.py +39 -20
  191. supervisely/video/video.py +41 -12
  192. supervisely/video_annotation/video_figure.py +38 -4
  193. supervisely/video_annotation/video_object.py +29 -4
  194. supervisely/volume/stl_converter.py +2 -0
  195. supervisely/worker_api/agent_rpc.py +24 -1
  196. supervisely/worker_api/rpc_servicer.py +31 -7
  197. {supervisely-6.73.438.dist-info → supervisely-6.73.513.dist-info}/METADATA +58 -40
  198. {supervisely-6.73.438.dist-info → supervisely-6.73.513.dist-info}/RECORD +203 -155
  199. {supervisely-6.73.438.dist-info → supervisely-6.73.513.dist-info}/WHEEL +1 -1
  200. supervisely_lib/__init__.py +6 -1
  201. {supervisely-6.73.438.dist-info → supervisely-6.73.513.dist-info}/entry_points.txt +0 -0
  202. {supervisely-6.73.438.dist-info → supervisely-6.73.513.dist-info/licenses}/LICENSE +0 -0
  203. {supervisely-6.73.438.dist-info → supervisely-6.73.513.dist-info}/top_level.txt +0 -0
@@ -24,6 +24,8 @@ from supervisely.video_annotation.key_id_map import KeyIdMap
24
24
  from supervisely.video_annotation.video_object import VideoObject
25
25
  from supervisely.video_annotation.video_object_collection import VideoObjectCollection
26
26
 
27
+ from supervisely.annotation.label import LabelingStatus
28
+
27
29
 
28
30
  class OutOfImageBoundsException(Exception):
29
31
  pass
@@ -55,6 +57,8 @@ class VideoFigure:
55
57
  :type smart_tool_input: dict, optional
56
58
  :param priority: Priority of the figure (position of the figure relative to other overlapping or underlying figures).
57
59
  :type priority: int, optional
60
+ :param status: Sets labeling status. Shows how label was created and corrected.
61
+ :type status: LabelingStatus, optional
58
62
  :Usage example:
59
63
 
60
64
  .. code-block:: python
@@ -86,7 +90,9 @@ class VideoFigure:
86
90
  # ],
87
91
  # "interior": []
88
92
  # }
89
- # }
93
+ # },
94
+ # "nnCreated": false,
95
+ # "nnUpdated": false
90
96
  # }
91
97
  """
92
98
 
@@ -103,6 +109,7 @@ class VideoFigure:
103
109
  track_id: Optional[str] = None,
104
110
  smart_tool_input: Optional[Dict] = None,
105
111
  priority: Optional[int] = None,
112
+ status: Optional[LabelingStatus] = None,
106
113
  ):
107
114
  self._video_object = video_object
108
115
  self._set_geometry_inplace(geometry)
@@ -116,6 +123,11 @@ class VideoFigure:
116
123
  self._smart_tool_input = smart_tool_input
117
124
  self._priority = priority
118
125
 
126
+ if status is None:
127
+ status = LabelingStatus.MANUAL
128
+ self._status = status
129
+ self._nn_created, self._nn_updated = LabelingStatus.to_flags(self.status)
130
+
119
131
  def _add_creation_info(self, d):
120
132
  if self.labeler_login is not None:
121
133
  d[LABELER_LOGIN] = self.labeler_login
@@ -339,9 +351,9 @@ class VideoFigure:
339
351
  # "interior": []
340
352
  # }
341
353
  # },
342
- # "meta": {
343
- # "frame": 7
344
- # }
354
+ # "meta": {"frame": 7},
355
+ # "nnCreated": false,
356
+ # "nnUpdated": false
345
357
  # }
346
358
  """
347
359
  data_json = {
@@ -349,6 +361,8 @@ class VideoFigure:
349
361
  OBJECT_KEY: self.parent_object.key().hex,
350
362
  ApiField.GEOMETRY_TYPE: self.geometry.geometry_name(),
351
363
  ApiField.GEOMETRY: self.geometry.to_json(),
364
+ ApiField.NN_CREATED: self._nn_created,
365
+ ApiField.NN_UPDATED: self._nn_updated,
352
366
  }
353
367
 
354
368
  if key_id_map is not None:
@@ -473,6 +487,10 @@ class VideoFigure:
473
487
  smart_tool_input = data.get(ApiField.SMART_TOOL_INPUT, None)
474
488
  priority = data.get(ApiField.PRIORITY, None)
475
489
 
490
+ nn_created = data.get(ApiField.NN_CREATED, False)
491
+ nn_updated = data.get(ApiField.NN_UPDATED, False)
492
+ status = LabelingStatus.from_flags(nn_created, nn_updated)
493
+
476
494
  return cls(
477
495
  object,
478
496
  geometry,
@@ -485,6 +503,7 @@ class VideoFigure:
485
503
  track_id=track_id,
486
504
  smart_tool_input=smart_tool_input,
487
505
  priority=priority,
506
+ status=status,
488
507
  )
489
508
 
490
509
  def clone(
@@ -500,6 +519,7 @@ class VideoFigure:
500
519
  track_id: Optional[str] = None,
501
520
  smart_tool_input: Optional[Dict] = None,
502
521
  priority: Optional[int] = None,
522
+ status: Optional[LabelingStatus] = None,
503
523
  ) -> VideoFigure:
504
524
  """
505
525
  Makes a copy of VideoFigure with new fields, if fields are given, otherwise it will use fields of the original VideoFigure.
@@ -526,6 +546,8 @@ class VideoFigure:
526
546
  :type smart_tool_input: dict, optional
527
547
  :param priority: Priority of the figure (position of the figure relative to other overlapping or underlying figures).
528
548
  :type priority: int, optional
549
+ :param status: Sets labeling status. Specifies if the VideoFigure was created by NN model, manually or created by NN and then manually corrected.
550
+ :type status: LabelingStatus, optional
529
551
  :return: VideoFigure object
530
552
  :rtype: :class:`VideoFigure`
531
553
 
@@ -582,8 +604,20 @@ class VideoFigure:
582
604
  track_id=take_with_default(track_id, self.track_id),
583
605
  smart_tool_input=take_with_default(smart_tool_input, self._smart_tool_input),
584
606
  priority=take_with_default(priority, self._priority),
607
+ status=take_with_default(status, self.status),
585
608
  )
586
609
 
610
+ @property
611
+ def status(self) -> LabelingStatus:
612
+ """Labeling status. Specifies if the VideoFigure was created by NN model, manually or created by NN and then manually corrected."""
613
+ return self._status
614
+
615
+ @status.setter
616
+ def status(self, status: LabelingStatus):
617
+ """Set labeling status."""
618
+ self._status = status
619
+ self._nn_created, self._nn_updated = LabelingStatus.to_flags(self.status)
620
+
587
621
  def validate_bounds(
588
622
  self, img_size: Tuple[int, int], _auto_correct: Optional[bool] = False
589
623
  ) -> None:
@@ -18,6 +18,7 @@ from supervisely.geometry.constants import (
18
18
  UPDATED_AT,
19
19
  )
20
20
  from supervisely.project.project_meta import ProjectMeta
21
+ from supervisely.project.project_settings import LabelingInterface
21
22
  from supervisely.video_annotation.constants import ID, KEY, OBJECTS_MAP
22
23
  from supervisely.video_annotation.key_id_map import KeyIdMap
23
24
  from supervisely.video_annotation.video_tag import VideoTag
@@ -362,10 +363,34 @@ class VideoObject(KeyObject):
362
363
  f"was not found in the given project meta."
363
364
  )
364
365
 
365
- key = uuid.UUID(data[KEY]) if KEY in data else uuid.uuid4()
366
-
367
- if key_id_map is not None:
368
- key_id_map.add_object(key, data.get(ID, None))
366
+ is_multiview = False
367
+ try:
368
+ if project_meta.labeling_interface == LabelingInterface.MULTIVIEW:
369
+ is_multiview = True
370
+ except AttributeError:
371
+ is_multiview = False
372
+
373
+ raw_id = data.get(ID, None)
374
+
375
+ if not is_multiview:
376
+ key = uuid.UUID(data[KEY]) if KEY in data else uuid.uuid4()
377
+ if key_id_map is not None:
378
+ key_id_map.add_object(key, raw_id)
379
+ else:
380
+ if KEY in data:
381
+ key = uuid.UUID(data[KEY])
382
+ elif key_id_map is not None and isinstance(raw_id, int):
383
+ existing_key = key_id_map.get_object_key(raw_id)
384
+ if isinstance(existing_key, uuid.UUID):
385
+ key = existing_key
386
+ else:
387
+ key = uuid.uuid4()
388
+ else:
389
+ key = uuid.uuid4()
390
+
391
+ if key_id_map is not None and isinstance(raw_id, int):
392
+ if key_id_map.get_object_id(key) is None:
393
+ key_id_map.add_object(key, raw_id)
369
394
 
370
395
  class_id = data.get(CLASS_ID, None)
371
396
  labeler_login = data.get(LABELER_LOGIN, None)
@@ -15,6 +15,8 @@ from supervisely.io.fs import (
15
15
  change_directory_at_index,
16
16
  )
17
17
 
18
+ if not hasattr(np, "bool"):
19
+ np.bool = np.bool_
18
20
 
19
21
  def matrix_from_nrrd_header(header: Dict) -> np.ndarray:
20
22
  """
@@ -1,10 +1,12 @@
1
1
  # coding: utf-8
2
+ # isort: skip_file
2
3
 
3
4
  import cv2
4
5
  import numpy as np
5
6
 
6
7
  from .chunking import load_to_memory_chunked_image, load_to_memory_chunked
7
- from ..worker_proto import worker_api_pb2 as api_proto
8
+
9
+ # from ..worker_proto import worker_api_pb2 as api_proto # Import moved to methods where needed
8
10
 
9
11
 
10
12
  class SimpleCache:
@@ -22,6 +24,13 @@ class SimpleCache:
22
24
 
23
25
 
24
26
  def download_image_from_remote(agent_api, image_hash, src_node_token, logger):
27
+ try:
28
+ from ..worker_proto import worker_api_pb2 as api_proto
29
+ except Exception as e:
30
+ from supervisely.app.v1.constants import PROTOBUF_REQUIRED_ERROR
31
+
32
+ raise ImportError(PROTOBUF_REQUIRED_ERROR) from e
33
+
25
34
  resp = agent_api.get_stream_with_data(
26
35
  'DownloadImages',
27
36
  api_proto.ChunkImage,
@@ -34,6 +43,13 @@ def download_image_from_remote(agent_api, image_hash, src_node_token, logger):
34
43
 
35
44
 
36
45
  def download_data_from_remote(agent_api, req_id, logger):
46
+ try:
47
+ from ..worker_proto import worker_api_pb2 as api_proto
48
+ except Exception as e:
49
+ from supervisely.app.v1.constants import PROTOBUF_REQUIRED_ERROR
50
+
51
+ raise ImportError(PROTOBUF_REQUIRED_ERROR) from e
52
+
37
53
  resp = agent_api.get_stream_with_data('GetGeneralEventData', api_proto.Chunk, api_proto.Empty(),
38
54
  addit_headers={'x-request-id': req_id})
39
55
  b_data = load_to_memory_chunked(resp)
@@ -47,6 +63,13 @@ def batched(seq, batch_size):
47
63
 
48
64
 
49
65
  def send_from_memory_generator(out_bytes, chunk_size):
66
+ try:
67
+ from ..worker_proto import worker_api_pb2 as api_proto
68
+ except Exception as e:
69
+ from supervisely.app.v1.constants import PROTOBUF_REQUIRED_ERROR
70
+
71
+ raise ImportError(PROTOBUF_REQUIRED_ERROR) from e
72
+
50
73
  for bytes_chunk in batched(out_bytes, chunk_size):
51
74
  yield api_proto.Chunk(buffer=bytes_chunk, total_size=len(out_bytes))
52
75
 
@@ -1,4 +1,5 @@
1
1
  # coding: utf-8
2
+ # isort: skip_file
2
3
 
3
4
  import os
4
5
  import concurrent.futures
@@ -11,18 +12,27 @@ import threading
11
12
  from supervisely.annotation.annotation import Annotation
12
13
  from supervisely.function_wrapper import function_wrapper, function_wrapper_nofail
13
14
  from supervisely.imaging.image import drop_image_alpha_channel
14
- from supervisely.nn.legacy.hosted.inference_modes import InferenceModeFactory, InfModeFullImage, \
15
- MODE, NAME, get_effective_inference_mode_config
15
+ from supervisely.nn.legacy.hosted.inference_modes import (
16
+ InferenceModeFactory,
17
+ InfModeFullImage,
18
+ MODE,
19
+ NAME,
20
+ get_effective_inference_mode_config,
21
+ )
16
22
  from supervisely.project.project_meta import ProjectMeta
17
23
  from supervisely.worker_api.agent_api import AgentAPI
18
- from supervisely.worker_api.agent_rpc import decode_image, download_image_from_remote, download_data_from_remote, \
19
- send_from_memory_generator
24
+ from supervisely.worker_api.agent_rpc import (
25
+ decode_image,
26
+ download_image_from_remote,
27
+ download_data_from_remote,
28
+ send_from_memory_generator,
29
+ )
20
30
  from supervisely.worker_api.interfaces import SingleImageInferenceInterface
21
- from supervisely.worker_proto import worker_api_pb2 as api_proto
31
+
32
+ # from supervisely.worker_proto import worker_api_pb2 as api_proto # Import moved to methods where needed
22
33
  from supervisely.task.progress import report_agent_rpc_ready
23
34
  from supervisely.api.api import Api
24
35
 
25
-
26
36
  REQUEST_TYPE = 'request_type'
27
37
  GET_OUT_META = 'get_out_meta'
28
38
  INFERENCE = 'inference'
@@ -123,6 +133,13 @@ class AgentRPCServicerBase:
123
133
  self.thread_pool.submit(function_wrapper_nofail, self._send_data, res_msg, req_id) # skip errors
124
134
 
125
135
  def _send_data(self, out_msg, req_id):
136
+ try:
137
+ from supervisely.worker_proto import worker_api_pb2 as api_proto
138
+ except Exception as e:
139
+ from supervisely.app.v1.constants import PROTOBUF_REQUIRED_ERROR
140
+
141
+ raise ImportError(PROTOBUF_REQUIRED_ERROR) from e
142
+
126
143
  self.logger.trace('Will send output data.', extra={REQUEST_ID: req_id})
127
144
  out_bytes = json.dumps(out_msg).encode('utf-8')
128
145
 
@@ -173,6 +190,13 @@ class AgentRPCServicerBase:
173
190
  self._load_data_if_required(event_obj)
174
191
 
175
192
  def run_inf_loop(self):
193
+ try:
194
+ from supervisely.worker_proto import worker_api_pb2 as api_proto
195
+ except Exception as e:
196
+ from supervisely.app.v1.constants import PROTOBUF_REQUIRED_ERROR
197
+
198
+ raise ImportError(PROTOBUF_REQUIRED_ERROR) from e
199
+
176
200
  def seq_inf_wrapped():
177
201
  function_wrapper(self._sequential_final_processing) # exit if raised
178
202
 
@@ -252,4 +276,4 @@ class InactiveRPCServicer(AgentRPCServicer):
252
276
  self.logger.info('Created InactiveRPCServicer for internal usage', extra=conn_config)
253
277
 
254
278
  def run_inf_loop(self):
255
- raise RuntimeError("Method is not accessible")
279
+ raise RuntimeError("Method is not accessible")
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: supervisely
3
- Version: 6.73.438
3
+ Version: 6.73.513
4
4
  Summary: Supervisely Python SDK.
5
5
  Home-page: https://github.com/supervisely/supervisely
6
6
  Author: Supervisely
@@ -21,15 +21,14 @@ Requires-Python: >=3.8
21
21
  Description-Content-Type: text/markdown
22
22
  License-File: LICENSE
23
23
  Requires-Dist: cachetools<=5.5.0,>=4.2.3
24
- Requires-Dist: numpy<2.0.0,>=1.19
24
+ Requires-Dist: numpy<=2.3.3,>=1.19
25
25
  Requires-Dist: opencv-python<5.0.0.0,>=4.6.0.66
26
26
  Requires-Dist: PTable<1.0.0,>=0.9.2
27
- Requires-Dist: pillow<=10.2.0,>=5.4.1
28
- Requires-Dist: protobuf<=3.20.3,>=3.19.5
29
- Requires-Dist: python-json-logger<3.0.0,>=0.1.11
27
+ Requires-Dist: pillow<=10.4.0,>=5.4.1
28
+ Requires-Dist: python-json-logger<=3.0.1,>=0.1.11
30
29
  Requires-Dist: requests<3.0.0,>=2.27.1
31
30
  Requires-Dist: requests-toolbelt>=0.9.1
32
- Requires-Dist: Shapely<=2.0.2,>=1.7.1
31
+ Requires-Dist: Shapely<=2.1.2,>=1.7.1
33
32
  Requires-Dist: bidict<1.0.0,>=0.21.2
34
33
  Requires-Dist: varname<1.0.0,>=0.8.1
35
34
  Requires-Dist: python-dotenv<=1.0.1,>=0.19.2
@@ -40,18 +39,18 @@ Requires-Dist: stringcase<2.0.0,>=1.2.0
40
39
  Requires-Dist: python-magic<1.0.0,>=0.4.25
41
40
  Requires-Dist: trimesh<=4.5.0,>=3.11.2
42
41
  Requires-Dist: uvicorn[standard]<1.0.0,>=0.18.2
43
- Requires-Dist: pydantic<=2.11.3,>=1.7.4
44
- Requires-Dist: anyio<=4.2.0,>=3.7.1
45
- Requires-Dist: fastapi<=0.109.0,>=0.79.0
42
+ Requires-Dist: starlette<=0.47.3
43
+ Requires-Dist: pydantic<=2.12.3,>=1.7.4
44
+ Requires-Dist: fastapi<=0.119.1,>=0.103.1
46
45
  Requires-Dist: websockets<=13.1,>=10.3
47
46
  Requires-Dist: jinja2<4.0.0,>=3.0.3
48
- Requires-Dist: psutil<6.0.0,>=5.9.0
47
+ Requires-Dist: psutil<=7.2.0,>=5.9.0
49
48
  Requires-Dist: jsonpatch<2.0,>=1.32
50
49
  Requires-Dist: MarkupSafe<3.0.0,>=2.1.1
51
50
  Requires-Dist: arel<1.0.0,>=0.2.0
52
51
  Requires-Dist: tqdm<5.0.0,>=4.62.3
53
- Requires-Dist: pandas<=2.1.4,>=1.1.3
54
- Requires-Dist: async-asgi-testclient
52
+ Requires-Dist: pandas<=2.3.3,>=1.1.3
53
+ Requires-Dist: async_asgi_testclient
55
54
  Requires-Dist: PyYAML>=5.4.0
56
55
  Requires-Dist: distinctipy
57
56
  Requires-Dist: beautifulsoup4
@@ -71,6 +70,16 @@ Requires-Dist: zstd
71
70
  Requires-Dist: aiofiles
72
71
  Requires-Dist: httpx[http2]==0.27.2
73
72
  Requires-Dist: debugpy
73
+ Requires-Dist: setuptools<81.0.0
74
+ Provides-Extra: extras
75
+ Requires-Dist: docker<6.0.0,>=5.0.3; extra == "extras"
76
+ Requires-Dist: imagecorruptions<2.0.0,>=1.1.2; extra == "extras"
77
+ Requires-Dist: scikit-image<1.0.0,>=0.17.1; extra == "extras"
78
+ Requires-Dist: matplotlib<4.0.0,>=3.3.2; extra == "extras"
79
+ Requires-Dist: pascal-voc-writer<1.0.0,>=0.1.4; extra == "extras"
80
+ Requires-Dist: scipy<2.0.0,>=1.8.0; extra == "extras"
81
+ Requires-Dist: pandas<=2.3.3,>=1.1.3; extra == "extras"
82
+ Requires-Dist: ruamel.yaml==0.17.21; extra == "extras"
74
83
  Provides-Extra: apps
75
84
  Requires-Dist: uvicorn[standard]<1.0.0,>=0.18.2; extra == "apps"
76
85
  Requires-Dist: fastapi<1.0.0,>=0.79.0; extra == "apps"
@@ -81,10 +90,7 @@ Requires-Dist: jsonpatch<2.0,>=1.32; extra == "apps"
81
90
  Requires-Dist: MarkupSafe<3.0.0,>=2.1.1; extra == "apps"
82
91
  Requires-Dist: arel<1.0.0,>=0.2.0; extra == "apps"
83
92
  Requires-Dist: tqdm<5.0.0,>=4.62.3; extra == "apps"
84
- Requires-Dist: pandas<1.4.0,>=1.1.3; extra == "apps"
85
- Provides-Extra: aug
86
- Requires-Dist: imgaug<1.0.0,>=0.4.0; extra == "aug"
87
- Requires-Dist: imagecorruptions<2.0.0,>=1.1.2; extra == "aug"
93
+ Requires-Dist: pandas<=2.3.3,>=1.1.3; extra == "apps"
88
94
  Provides-Extra: docs
89
95
  Requires-Dist: sphinx==4.4.0; extra == "docs"
90
96
  Requires-Dist: jinja2==3.0.3; extra == "docs"
@@ -93,26 +99,6 @@ Requires-Dist: sphinx-copybutton==0.4.0; extra == "docs"
93
99
  Requires-Dist: sphinx-autodoc-typehints==1.15.3; extra == "docs"
94
100
  Requires-Dist: sphinxcontrib-details-directive==0.1.0; extra == "docs"
95
101
  Requires-Dist: myst-parser==0.18.0; extra == "docs"
96
- Provides-Extra: extras
97
- Requires-Dist: docker<6.0.0,>=5.0.3; extra == "extras"
98
- Requires-Dist: imagecorruptions<2.0.0,>=1.1.2; extra == "extras"
99
- Requires-Dist: scikit-image<1.0.0,>=0.17.1; extra == "extras"
100
- Requires-Dist: matplotlib<4.0.0,>=3.3.2; extra == "extras"
101
- Requires-Dist: pascal-voc-writer<1.0.0,>=0.1.4; extra == "extras"
102
- Requires-Dist: scipy<2.0.0,>=1.8.0; extra == "extras"
103
- Requires-Dist: pandas<1.4.0,>=1.1.3; extra == "extras"
104
- Requires-Dist: ruamel.yaml==0.17.21; extra == "extras"
105
- Provides-Extra: model-benchmark
106
- Requires-Dist: pycocotools; extra == "model-benchmark"
107
- Requires-Dist: scikit-learn; extra == "model-benchmark"
108
- Requires-Dist: plotly==5.22.0; extra == "model-benchmark"
109
- Requires-Dist: torch; extra == "model-benchmark"
110
- Requires-Dist: torchvision; extra == "model-benchmark"
111
- Provides-Extra: plugins
112
- Requires-Dist: jsonschema<3.0.0,>=2.6.0; extra == "plugins"
113
- Provides-Extra: sdk-nn-plugins
114
- Requires-Dist: flask-restful<1.0.0,>=0.3.7; extra == "sdk-nn-plugins"
115
- Requires-Dist: Werkzeug<3.0.0,>=1.0.1; extra == "sdk-nn-plugins"
116
102
  Provides-Extra: sdk-no-usages
117
103
  Requires-Dist: grpcio<2.0.0,>=1.53.2; extra == "sdk-no-usages"
118
104
  Requires-Dist: plotly<6.0.0,>=4.11.0; extra == "sdk-no-usages"
@@ -122,7 +108,7 @@ Requires-Dist: yacs; extra == "tracking"
122
108
  Requires-Dist: matplotlib<4.0.0,>=3.3.2; extra == "tracking"
123
109
  Requires-Dist: scipy<2.0.0,>=1.8.0; extra == "tracking"
124
110
  Requires-Dist: lap; extra == "tracking"
125
- Requires-Dist: cython-bbox; extra == "tracking"
111
+ Requires-Dist: cython_bbox; extra == "tracking"
126
112
  Requires-Dist: termcolor; extra == "tracking"
127
113
  Requires-Dist: scikit-learn; extra == "tracking"
128
114
  Requires-Dist: faiss-gpu; extra == "tracking"
@@ -131,6 +117,13 @@ Requires-Dist: tensorboard; extra == "tracking"
131
117
  Requires-Dist: decord; extra == "tracking"
132
118
  Requires-Dist: gdown; extra == "tracking"
133
119
  Requires-Dist: torch; extra == "tracking"
120
+ Requires-Dist: motmetrics; extra == "tracking"
121
+ Provides-Extra: model-benchmark
122
+ Requires-Dist: pycocotools; extra == "model-benchmark"
123
+ Requires-Dist: scikit-learn; extra == "model-benchmark"
124
+ Requires-Dist: plotly==5.22.0; extra == "model-benchmark"
125
+ Requires-Dist: torch; extra == "model-benchmark"
126
+ Requires-Dist: torchvision; extra == "model-benchmark"
134
127
  Provides-Extra: training
135
128
  Requires-Dist: pycocotools; extra == "training"
136
129
  Requires-Dist: scikit-learn; extra == "training"
@@ -142,6 +135,31 @@ Requires-Dist: markdown; extra == "training"
142
135
  Requires-Dist: pymdown-extensions; extra == "training"
143
136
  Requires-Dist: tbparse; extra == "training"
144
137
  Requires-Dist: kaleido==0.2.1; extra == "training"
138
+ Provides-Extra: plugins
139
+ Requires-Dist: jsonschema<3.0.0,>=2.6.0; extra == "plugins"
140
+ Provides-Extra: sdk-nn-plugins
141
+ Requires-Dist: flask-restful<1.0.0,>=0.3.7; extra == "sdk-nn-plugins"
142
+ Requires-Dist: Werkzeug<3.0.0,>=1.0.1; extra == "sdk-nn-plugins"
143
+ Provides-Extra: aug
144
+ Requires-Dist: imgaug<1.0.0,>=0.4.0; extra == "aug"
145
+ Requires-Dist: imagecorruptions<2.0.0,>=1.1.2; extra == "aug"
146
+ Requires-Dist: numpy<2.0.0,>=1.19; extra == "aug"
147
+ Provides-Extra: agent
148
+ Requires-Dist: protobuf<=3.20.3,>=3.19.5; extra == "agent"
149
+ Provides-Extra: versioning
150
+ Requires-Dist: pyarrow<=22.0.0,>=17.0.0; extra == "versioning"
151
+ Dynamic: author
152
+ Dynamic: author-email
153
+ Dynamic: classifier
154
+ Dynamic: description
155
+ Dynamic: description-content-type
156
+ Dynamic: home-page
157
+ Dynamic: license-file
158
+ Dynamic: maintainer
159
+ Dynamic: provides-extra
160
+ Dynamic: requires-dist
161
+ Dynamic: requires-python
162
+ Dynamic: summary
145
163
 
146
164
  <h1 align="center">
147
165
  <a href="https://supervisely.com"><img alt="Supervisely" title="Supervisely" src="https://i.imgur.com/B276eMS.png"></a>
@@ -263,7 +281,7 @@ More concretely, Supervisely includes the following functionality:
263
281
 
264
282
  The simplicity of creating Supervisely Apps has already led to the development of [hundreds of applications](https://ecosystem.supervisely.com/), ready to be run within a single click in a web browser and get the job done.
265
283
 
266
- Label your data, perform quality assurance, inspect every aspect of your data, collaborate easily, train and apply state-of-the-art neural networks, integrate custom models, automate routine tasks and more like in a real AppStore, there should be an app for everything.
284
+ Label your data, perform quality assurance, inspect every aspect of your data, collaborate easily, train and apply state-of-the-art neural networks, integrate custom models, automate routine tasks and more - like in a real AppStore, there should be an app for everything.
267
285
 
268
286
  ## [Development](https://developer.supervisely.com/) 🧑‍💻
269
287
 
@@ -425,7 +443,7 @@ Development for Supervisely builds upon these five principles:
425
443
 
426
444
  ### Start in a minute
427
445
 
428
- Supervisely's open-source SDK and app framework are straightforward to get started with. Its just a matter of:
446
+ Supervisely's open-source SDK and app framework are straightforward to get started with. It's just a matter of:
429
447
 
430
448
  ```
431
449
  pip install supervisely