supervisely 6.73.385__py3-none-any.whl → 6.73.387__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.
@@ -3,6 +3,7 @@
3
3
 
4
4
  from __future__ import annotations
5
5
 
6
+ import os
6
7
  import time
7
8
  from dataclasses import asdict
8
9
  from pathlib import Path
@@ -708,16 +709,12 @@ class DeployApi:
708
709
  )
709
710
 
710
711
  runtime = get_runtime(runtime)
711
- experiment_task_id = experiment_info.task_id
712
- experiment_task_info = self._api.task.get_info_by_id(experiment_task_id)
713
- if experiment_task_info is None:
714
- raise ValueError(f"Task with ID '{experiment_task_id}' not found")
715
-
712
+ module = None
716
713
  module_id = None
717
714
  serve_app_name = None
718
715
  if with_module:
719
- train_module_id = experiment_task_info["meta"]["app"]["moduleId"]
720
- module = self.get_serving_app_by_train_app(module_id=train_module_id)
716
+ framework_name = experiment_info.framework_name
717
+ module = self.find_serving_app_by_framework(framework_name)
721
718
  serve_app_name = module["name"]
722
719
  module_id = module["id"]
723
720
  logger.debug(f"Serving app detected: '{serve_app_name}'. Module ID: '{module_id}'")
@@ -768,10 +765,15 @@ class DeployApi:
768
765
  "runtime": runtime,
769
766
  }
770
767
 
771
- config = experiment_info.model_files.get("config")
772
- if config is not None:
773
- deploy_params["model_files"]["config"] = f"{experiment_info.artifacts_dir}{config}"
774
- logger.debug(f"Config file added: {experiment_info.artifacts_dir}{config}")
768
+ for file_key, file_path in experiment_info.model_files.items():
769
+ full_file_path = os.path.join(experiment_info.artifacts_dir, file_path)
770
+ if not self._api.file.exists(team_id, full_file_path):
771
+ logger.debug(f"Model file not found: '{full_file_path}'. Trying to find it by checkpoint path.")
772
+ full_file_path = os.path.join(artifacts_dir, file_path)
773
+ if not self._api.file.exists(team_id, full_file_path):
774
+ raise ValueError(f"Model file not found: '{full_file_path}'. Make sure that the file exists in the artifacts directory.")
775
+ deploy_params["model_files"][file_key] = full_file_path
776
+ logger.debug(f"Model file added: {full_file_path}")
775
777
  return module_id, serve_app_name, deploy_params
776
778
 
777
779
  def _set_auto_runtime_by_checkpoint(self, checkpoint_path: str) -> str:
@@ -705,8 +705,16 @@ class ObjectDetectionVisualizer(BaseVisualizer):
705
705
  return False
706
706
 
707
707
  def _get_sample_data_for_gallery(self):
708
- # get sample images with annotations for visualization (Prediction project)
709
- pred_ds = random.choice(self.eval_result.pred_dataset_infos)
710
- self.eval_result.sample_images = self.api.image.get_list(pred_ds.id, limit=9)
711
- image_ids = [x.id for x in self.eval_result.sample_images]
712
- self.eval_result.sample_anns = self.api.annotation.download_batch(pred_ds.id, image_ids)
708
+ """Get sample images with annotations for visualization (preview gallery)"""
709
+ sample_images = []
710
+ limit = 9
711
+ for ds_info in self.eval_result.pred_dataset_infos:
712
+ images = self.api.image.get_list(
713
+ ds_info.id, limit=limit, force_metadata_for_links=False
714
+ )
715
+ sample_images.extend(images)
716
+ if len(sample_images) > limit:
717
+ sample_images = random.sample(sample_images, limit)
718
+ self.eval_result.sample_images = sample_images
719
+ ids = [img.id for img in sample_images]
720
+ self.eval_result.sample_anns = self.api.annotation.download_batch(ds_info.id, ids)
@@ -280,15 +280,19 @@ class SemanticSegmentationVisualizer(BaseVisualizer):
280
280
  raise RuntimeError(f"Match data was not created properly. {e}")
281
281
 
282
282
  def _get_sample_data_for_gallery(self):
283
- # get sample images with annotations for visualization
284
- pred_ds = random.choice(self.eval_result.pred_dataset_infos)
285
- imgs = self.api.image.get_list(pred_ds.id, limit=9, force_metadata_for_links=False)
286
- anns = self.api.annotation.download_batch(
287
- pred_ds.id, [x.id for x in imgs], force_metadata_for_links=False
288
- )
289
-
290
- self.eval_result.sample_images = imgs
291
- self.eval_result.sample_anns = anns
283
+ """Get sample images with annotations for visualization (preview gallery)"""
284
+ sample_images = []
285
+ limit = 9
286
+ for ds_info in self.eval_result.pred_dataset_infos:
287
+ images = self.api.image.get_list(
288
+ ds_info.id, limit=limit, force_metadata_for_links=False
289
+ )
290
+ sample_images.extend(images)
291
+ if len(sample_images) > limit:
292
+ sample_images = random.sample(sample_images, limit)
293
+ self.eval_result.sample_images = sample_images
294
+ ids = [img.id for img in sample_images]
295
+ self.eval_result.sample_anns = self.api.annotation.download_batch(ds_info.id, ids)
292
296
 
293
297
  def _create_clickable_label(self):
294
298
  return MarkdownWidget(name="clickable_label", title="", text=self.vis_texts.clickable_label)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: supervisely
3
- Version: 6.73.385
3
+ Version: 6.73.387
4
4
  Summary: Supervisely Python SDK.
5
5
  Home-page: https://github.com/supervisely/supervisely
6
6
  Author: Supervisely
@@ -55,7 +55,7 @@ supervisely/api/entity_annotation/figure_api.py,sha256=rmsE3L_JfqN94sLN637pQ0syi
55
55
  supervisely/api/entity_annotation/object_api.py,sha256=gbcNvN_KY6G80Me8fHKQgryc2Co7VU_kfFd1GYILZ4E,8875
56
56
  supervisely/api/entity_annotation/tag_api.py,sha256=IapvSZmakjdOn0yvqP2tQRY8gkZg0bcvIZBwWRcafrg,18996
57
57
  supervisely/api/nn/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
58
- supervisely/api/nn/deploy_api.py,sha256=fA5yk3-Q66BL821iu68HpsGWWO2qHXCcWTmrXoHE4gE,37008
58
+ supervisely/api/nn/deploy_api.py,sha256=yxTfi_B8KfKFxv410n4nt4OJiy18lJoZVScXnVCRYgA,37236
59
59
  supervisely/api/nn/neural_network_api.py,sha256=VYqpHb6xqCeEUofTNfOGUhvjI_5Di3T26qwVp5Z-0hE,10643
60
60
  supervisely/api/pointcloud/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
61
61
  supervisely/api/pointcloud/pointcloud_annotation_api.py,sha256=xIXqCu0rKYsGt5ezh2EFT2utwsVrr2Xo-MOWUCnbvXc,11259
@@ -809,7 +809,7 @@ supervisely/nn/benchmark/object_detection/evaluation_params.yaml,sha256=fEYA-Exm
809
809
  supervisely/nn/benchmark/object_detection/evaluator.py,sha256=s-hPBm5BmoCgwoozVyDacum4kVLNtYK6I6NCt_L_LSA,7278
810
810
  supervisely/nn/benchmark/object_detection/metric_provider.py,sha256=_fxS24Q8KhE2n2HknMnt86xVPYEDFw5atxsvXRnCl4w,23855
811
811
  supervisely/nn/benchmark/object_detection/text_templates.py,sha256=4BgTIX1Co4WK9_VSUa1qWCmh5OJzo3_opVU6LOjKSjc,25842
812
- supervisely/nn/benchmark/object_detection/visualizer.py,sha256=0eJ-ATDVMyjMRInoEK604vL3vJPN5Ge1HjarS11CS0A,32365
812
+ supervisely/nn/benchmark/object_detection/visualizer.py,sha256=4BOkSYl8rlvOKO87ZlmZuZCsAM9QTqDqAgNMoiwE8eI,32622
813
813
  supervisely/nn/benchmark/object_detection/vis_metrics/__init__.py,sha256=AXCLHEySEdR-B-5sfDoWBmmOLBVlyW2U_xr8Ta42sQI,2096
814
814
  supervisely/nn/benchmark/object_detection/vis_metrics/confidence_distribution.py,sha256=J6l9Vc8TGsvkTyH5u7Ry4P2jgJC2GYmcgOeMALftZBw,4254
815
815
  supervisely/nn/benchmark/object_detection/vis_metrics/confidence_score.py,sha256=pmxnF_UJk0WhqEdL7O_yIjIBtxPipLQZVJwCr6XB3zc,4751
@@ -838,7 +838,7 @@ supervisely/nn/benchmark/semantic_segmentation/evaluation_params.yaml,sha256=47D
838
838
  supervisely/nn/benchmark/semantic_segmentation/evaluator.py,sha256=XafPMpGL6v0ZQ-m7DkEjoY7W6fGCJNKolql5BA3M8V0,7261
839
839
  supervisely/nn/benchmark/semantic_segmentation/metric_provider.py,sha256=478l7w2n-yueBMVABsakfIQEo3MksbCYmKNrwMFOl6w,6546
840
840
  supervisely/nn/benchmark/semantic_segmentation/text_templates.py,sha256=7yRRD2FAdJHGSRqBVIjNjzCduKzaepA1OWtggi7B0Dg,8580
841
- supervisely/nn/benchmark/semantic_segmentation/visualizer.py,sha256=T7WTjnyFLL3BAyH7yQIqI6R5VNj1M3guamwhDglOegE,13293
841
+ supervisely/nn/benchmark/semantic_segmentation/visualizer.py,sha256=ny7S9cYdYeRL5je5eGpJOneVSz7MxZdykImPdNQ8uPY,13500
842
842
  supervisely/nn/benchmark/semantic_segmentation/vis_metrics/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
843
843
  supervisely/nn/benchmark/semantic_segmentation/vis_metrics/acknowledgement.py,sha256=Lm82x8AIMKv1WqmqA0W9fugSlQ_JrP9dwYYYReZmhvI,440
844
844
  supervisely/nn/benchmark/semantic_segmentation/vis_metrics/classwise_error_analysis.py,sha256=0bmL43a4cqw3grFoG68NN8Y1fkRpHBIRJptcxMor-78,1884
@@ -1103,9 +1103,9 @@ supervisely/worker_proto/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZ
1103
1103
  supervisely/worker_proto/worker_api_pb2.py,sha256=VQfi5JRBHs2pFCK1snec3JECgGnua3Xjqw_-b3aFxuM,59142
1104
1104
  supervisely/worker_proto/worker_api_pb2_grpc.py,sha256=3BwQXOaP9qpdi0Dt9EKG--Lm8KGN0C5AgmUfRv77_Jk,28940
1105
1105
  supervisely_lib/__init__.py,sha256=7-3QnN8Zf0wj8NCr2oJmqoQWMKKPKTECvjH9pd2S5vY,159
1106
- supervisely-6.73.385.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
1107
- supervisely-6.73.385.dist-info/METADATA,sha256=38qHHIiRGEYffwGVbazc2eXQ4_fNNjlxROUqPhBgH-4,35154
1108
- supervisely-6.73.385.dist-info/WHEEL,sha256=iAkIy5fosb7FzIOwONchHf19Qu7_1wCWyFNR5gu9nU0,91
1109
- supervisely-6.73.385.dist-info/entry_points.txt,sha256=U96-5Hxrp2ApRjnCoUiUhWMqijqh8zLR03sEhWtAcms,102
1110
- supervisely-6.73.385.dist-info/top_level.txt,sha256=kcFVwb7SXtfqZifrZaSE3owHExX4gcNYe7Q2uoby084,28
1111
- supervisely-6.73.385.dist-info/RECORD,,
1106
+ supervisely-6.73.387.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
1107
+ supervisely-6.73.387.dist-info/METADATA,sha256=6bZcP704iqdDpgH802O7uWemj3baQXCsDcmb5-hsDIE,35154
1108
+ supervisely-6.73.387.dist-info/WHEEL,sha256=iAkIy5fosb7FzIOwONchHf19Qu7_1wCWyFNR5gu9nU0,91
1109
+ supervisely-6.73.387.dist-info/entry_points.txt,sha256=U96-5Hxrp2ApRjnCoUiUhWMqijqh8zLR03sEhWtAcms,102
1110
+ supervisely-6.73.387.dist-info/top_level.txt,sha256=kcFVwb7SXtfqZifrZaSE3owHExX4gcNYe7Q2uoby084,28
1111
+ supervisely-6.73.387.dist-info/RECORD,,