supervisely 6.73.317__py3-none-any.whl → 6.73.319__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.
@@ -65,6 +65,27 @@ class PersistentImageTTLCache(TTLCache):
65
65
  def __init__(self, maxsize: int, ttl: int, filepath: Path):
66
66
  super().__init__(maxsize, ttl)
67
67
  self._base_dir = filepath
68
+
69
+ def pop(self, *args, **kwargs):
70
+ try:
71
+ super().pop(*args, **kwargs)
72
+ except Exception:
73
+ sly.logger.warn("Cache data corrupted. Cleaning the cache...", exc_info=True)
74
+
75
+ def _delitem(self, key):
76
+ try:
77
+ size = self._Cache__size.pop(key)
78
+ except:
79
+ size = 0
80
+ self._Cache__data.pop(key, None)
81
+ self._Cache__currsize -= size
82
+
83
+ shutil.rmtree(self._base_dir, ignore_errors=True)
84
+ for key in self.keys():
85
+ try:
86
+ super().__delitem__(key, cache_delitem=_delitem)
87
+ except:
88
+ pass
68
89
 
69
90
  def __delitem__(self, key: Any) -> None:
70
91
  self.__del_file(key)
@@ -2935,7 +2935,7 @@ class Inference:
2935
2935
  parser = argparse.ArgumentParser(description="Run Inference Serving")
2936
2936
 
2937
2937
  # Positional args
2938
- parser.add_argument("mode", choices=["deploy", "predict"], help="Mode of operation")
2938
+ parser.add_argument("mode", nargs="?", type=str, help="Mode of operation: 'deploy' or 'predict'")
2939
2939
  parser.add_argument("input", nargs="?", type=str, help="Local path to input data")
2940
2940
 
2941
2941
  # Deploy args
@@ -3018,6 +3018,11 @@ class Inference:
3018
3018
 
3019
3019
  # Parse arguments
3020
3020
  args, _ = parser.parse_known_args()
3021
+ if args.mode is None:
3022
+ return None, False
3023
+ elif args.mode not in ["predict", "deploy"]:
3024
+ return None, False
3025
+
3021
3026
  if args.model is None:
3022
3027
  if len(self.pretrained_models) == 0:
3023
3028
  raise ValueError("No pretrained models found.")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: supervisely
3
- Version: 6.73.317
3
+ Version: 6.73.319
4
4
  Summary: Supervisely Python SDK.
5
5
  Home-page: https://github.com/supervisely/supervisely
6
6
  Author: Supervisely
@@ -875,8 +875,8 @@ supervisely/nn/benchmark/visualization/widgets/sidebar/sidebar.py,sha256=tKPURRS
875
875
  supervisely/nn/benchmark/visualization/widgets/table/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
876
876
  supervisely/nn/benchmark/visualization/widgets/table/table.py,sha256=atmDnF1Af6qLQBUjLhK18RMDKAYlxnsuVHMSEa5a-e8,4319
877
877
  supervisely/nn/inference/__init__.py,sha256=QFukX2ip-U7263aEPCF_UCFwj6EujbMnsgrXp5Bbt8I,1623
878
- supervisely/nn/inference/cache.py,sha256=h-pP_7th0ana3oJ75sFfTbead3hdKUvYA8Iq2OXDx3I,31317
879
- supervisely/nn/inference/inference.py,sha256=Fq2aMKIxLZwiFXW8a2mfbvW3KXd8O31fccKoKYDvqvQ,158506
878
+ supervisely/nn/inference/cache.py,sha256=q4F7ZRzZghNWSVFClXEIHNMNW4PK6xddYckCFUgyhCo,32027
879
+ supervisely/nn/inference/inference.py,sha256=RJPTCd-y5FtQ234Zdbj7D6stsR3ZpVo8GLpiXXAr2Bg,158665
880
880
  supervisely/nn/inference/session.py,sha256=jmkkxbe2kH-lEgUU6Afh62jP68dxfhF5v6OGDfLU62E,35757
881
881
  supervisely/nn/inference/video_inference.py,sha256=8Bshjr6rDyLay5Za8IB8Dr6FURMO2R_v7aELasO8pR4,5746
882
882
  supervisely/nn/inference/gui/__init__.py,sha256=wCxd-lF5Zhcwsis-wScDA8n1Gk_1O00PKgDviUZ3F1U,221
@@ -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.317.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
1079
- supervisely-6.73.317.dist-info/METADATA,sha256=fJwJdL1m7GVDWVzkb9Rz9Bqmwzeuis-JwYwvo-ZFZqk,33596
1080
- supervisely-6.73.317.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
1081
- supervisely-6.73.317.dist-info/entry_points.txt,sha256=U96-5Hxrp2ApRjnCoUiUhWMqijqh8zLR03sEhWtAcms,102
1082
- supervisely-6.73.317.dist-info/top_level.txt,sha256=kcFVwb7SXtfqZifrZaSE3owHExX4gcNYe7Q2uoby084,28
1083
- supervisely-6.73.317.dist-info/RECORD,,
1078
+ supervisely-6.73.319.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
1079
+ supervisely-6.73.319.dist-info/METADATA,sha256=WUoELTCne2bnj7Dh4zB0DXeDtgoEl1BCmxN0jRtjxCo,33596
1080
+ supervisely-6.73.319.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
1081
+ supervisely-6.73.319.dist-info/entry_points.txt,sha256=U96-5Hxrp2ApRjnCoUiUhWMqijqh8zLR03sEhWtAcms,102
1082
+ supervisely-6.73.319.dist-info/top_level.txt,sha256=kcFVwb7SXtfqZifrZaSE3owHExX4gcNYe7Q2uoby084,28
1083
+ supervisely-6.73.319.dist-info/RECORD,,