code-loader 0.2.86.dev4__py3-none-any.whl → 0.2.88__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.
@@ -43,9 +43,6 @@ class UnlabeledDataPreprocessHandler:
43
43
  data_length: int = 0
44
44
 
45
45
 
46
- VisualizerCallableReturnType = Union[LeapImage, LeapText, LeapGraph, LeapHorizontalBar,
47
- LeapImageMask, LeapTextMask, LeapImageWithBBox]
48
-
49
46
  VisualizerCallableInterface = Union[
50
47
  Callable[..., LeapImage],
51
48
  Callable[..., LeapText],
@@ -53,10 +50,12 @@ VisualizerCallableInterface = Union[
53
50
  Callable[..., LeapHorizontalBar],
54
51
  Callable[..., LeapImageMask],
55
52
  Callable[..., LeapTextMask],
56
- Callable[..., LeapImageWithBBox],
57
- Callable[..., Dict[str, VisualizerCallableReturnType]]
53
+ Callable[..., LeapImageWithBBox]
58
54
  ]
59
55
 
56
+ VisualizerCallableReturnType = Union[LeapImage, LeapText, LeapGraph, LeapHorizontalBar,
57
+ LeapImageMask, LeapTextMask, LeapImageWithBBox]
58
+
60
59
  CustomCallableInterface = Callable[..., tf.Tensor]
61
60
 
62
61
 
@@ -10,9 +10,9 @@ from code_loader.contract.datasetclasses import SectionCallableInterface, InputH
10
10
  GroundTruthHandler, MetadataHandler, DatasetIntegrationSetup, VisualizerHandler, PreprocessResponse, \
11
11
  PreprocessHandler, VisualizerCallableInterface, CustomLossHandler, CustomCallableInterface, PredictionTypeHandler, \
12
12
  MetadataSectionCallableInterface, UnlabeledDataPreprocessHandler, CustomLayerHandler, MetricHandler, \
13
- ConfusionMatrixCallableInterface, CustomCallableInterfaceMultiArgs, ConfusionMatrixCallableInterfaceMultiArgs, \
13
+ CustomCallableInterfaceMultiArgs, ConfusionMatrixCallableInterfaceMultiArgs, \
14
14
  CustomMultipleReturnCallableInterfaceMultiArgs
15
- from code_loader.contract.enums import DatasetMetadataType, LeapDataType, MetricEnum
15
+ from code_loader.contract.enums import LeapDataType
16
16
  from code_loader.metrics.default_metrics import metrics_names_to_functions
17
17
  from code_loader.utils import to_numpy_return_wrapper
18
18
  from code_loader.visualizers.default_visualizers import DefaultVisualizer, \
@@ -95,12 +95,7 @@ class LeapBinder:
95
95
  self.setup_container.metrics.append(MetricHandler(name, function, arg_names))
96
96
 
97
97
  @typechecked
98
- def add_prediction(self, name: str, labels: List[str], metrics: Optional[List[MetricEnum]] = None,
99
- custom_metrics: Optional[
100
- List[Union[CustomCallableInterface, ConfusionMatrixCallableInterface]]] = None) -> None:
101
- if metrics or custom_metrics:
102
- raise DeprecationWarning("Adding metrics on 'leap_binder.add_prediction' method is deprecated."
103
- "Please update the leap script and use metric block instead.")
98
+ def add_prediction(self, name: str, labels: List[str]) -> None:
104
99
  self.setup_container.prediction_types.append(PredictionTypeHandler(name, labels))
105
100
 
106
101
  @typechecked
code_loader/leaploader.py CHANGED
@@ -44,6 +44,12 @@ class LeapLoader:
44
44
  torch.cuda.is_available = lambda: False
45
45
 
46
46
  self.evaluate_module()
47
+ except TypeError as e:
48
+ import traceback
49
+ if "leap_binder.set_metadata(" in traceback.format_exc(5):
50
+ raise DeprecationWarning(
51
+ "Please remove the metadata_type on leap_binder.set_metadata in your dataset script")
52
+ raise DatasetScriptException(getattr(e, 'message', repr(e))) from e
47
53
  except Exception as e:
48
54
  raise DatasetScriptException(getattr(e, 'message', repr(e))) from e
49
55
 
@@ -280,8 +286,11 @@ class LeapLoader:
280
286
  dataset_metadata_type = DatasetMetadataType.string
281
287
  elif metadata_type == bool:
282
288
  dataset_metadata_type = DatasetMetadataType.boolean
289
+ elif metadata_type == float:
290
+ dataset_metadata_type = DatasetMetadataType.float
283
291
  else:
284
- dataset_metadata_type = DatasetMetadataType[metadata_type.__name__]
292
+ raise Exception(f"Unsupported return type of metadata {handler_test_payload.name}."
293
+ f"The return type should be one of [int, float, str, bool]. Got {metadata_type}")
285
294
  metadata_instances.append(DatasetMetadataInstance(name=handler_test_payload.name,
286
295
  type=dataset_metadata_type))
287
296
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: code-loader
3
- Version: 0.2.86.dev4
3
+ Version: 0.2.88
4
4
  Summary:
5
5
  Home-page: https://github.com/tensorleap/code-loader
6
6
  License: MIT
@@ -16,7 +16,7 @@ Requires-Dist: numpy (>=1.22.3,<2.0.0)
16
16
  Requires-Dist: psutil (>=5.9.5,<6.0.0)
17
17
  Requires-Dist: tensorflow (>=2.11.0,<3.0.0) ; platform_machine == "x86_64"
18
18
  Requires-Dist: tensorflow-macos (>=2.11.0,<3.0.0) ; platform_machine == "arm64"
19
- Requires-Dist: torch (==1.12.1)
19
+ Requires-Dist: torch (>=1.12,<3.0)
20
20
  Requires-Dist: typeguard (>=2.13.3,<3.0.0)
21
21
  Project-URL: Repository, https://github.com/tensorleap/code-loader
22
22
  Description-Content-Type: text/markdown
@@ -1,7 +1,7 @@
1
1
  LICENSE,sha256=qIwWjdspQeSMTtnFZBC8MuT-95L02FPvzRUdWFxrwJY,1067
2
2
  code_loader/__init__.py,sha256=ncXAeQmuP80Ml9wgSfusgLn_i6So8j1Hj7e3v4qqDdo,116
3
3
  code_loader/contract/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
- code_loader/contract/datasetclasses.py,sha256=gOvF-vpmK19s7rMcAovqLCkE_AbcOz9mVyMote3re-0,4614
4
+ code_loader/contract/datasetclasses.py,sha256=TlhPt5HC-Esbhrhe1cmvCSgnE7fnVOXJ-lkzOAspKZ0,4554
5
5
  code_loader/contract/enums.py,sha256=KDIeNl79e8rCp4ybJat7U03j50McrcBTWUxko5SXrug,1481
6
6
  code_loader/contract/exceptions.py,sha256=jWqu5i7t-0IG0jGRsKF4DjJdrsdpJjIYpUkN1F4RiyQ,51
7
7
  code_loader/contract/responsedataclasses.py,sha256=StFpWC5s2lBECZJrpespZ4Ic2iFiSVNgEsxjIHgwgSo,2623
@@ -19,9 +19,9 @@ code_loader/helpers/detection/yolo/utils.py,sha256=BAZmsMz5LrbMlJe5e2SSmrX25E4_C
19
19
  code_loader/helpers/instancesegmentation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
20
20
  code_loader/helpers/instancesegmentation/utils.py,sha256=bl4nlg7mV8CZyPl8grGAE5603TFVM7PTZyM3BRMbXBg,930
21
21
  code_loader/leap_binder/__init__.py,sha256=Oe7DNj6RmgX-tMruOrI7GYvf3SyAnzOxugF2e117_Z8,93
22
- code_loader/leap_binder/leapbinder.py,sha256=BEY33fwG-j2x8HHJj8Lph9fzhUusGwEV2aXQQ51_JNM,6806
22
+ code_loader/leap_binder/leapbinder.py,sha256=-Ny2YewT1jg36Q5AXK8F2Fmv34zxhbcXZp807jIcHws,6293
23
23
  code_loader/leap_loader_parallelized_base.py,sha256=_HNbjRK42wRM1V252ETVzibHW8bofFK8-Kq-It5fRks,4758
24
- code_loader/leaploader.py,sha256=goE3SoOexZ5B78BM0B7PLwfTuEvDNAPzVF6bt-oZFEA,17900
24
+ code_loader/leaploader.py,sha256=iHz5Hq7phFmjxsH1wr6d_Fajwg2JFEBwYzDoXdR46qo,18496
25
25
  code_loader/metric_calculator_parallelized.py,sha256=X1FHFlfPorjFVNbms19s_yItkKFja0b97wUJHNvvlxs,2233
26
26
  code_loader/metrics/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
27
27
  code_loader/metrics/default_metrics.py,sha256=xtvTskR7LC5pyKSlFcvlyBpFY9TSXNGVAi5taEPSI60,6727
@@ -29,7 +29,7 @@ code_loader/samples_generator_parallelized.py,sha256=_t0lmf11y1Tas4bdndOSk2b2QMj
29
29
  code_loader/utils.py,sha256=WUcM97OuxrhfLCRPoH9EbXrxajNpYgX1CTMc3_PXtYU,1736
30
30
  code_loader/visualizers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
31
31
  code_loader/visualizers/default_visualizers.py,sha256=HqWx2qfTrroGl2n8Fpmr_4X-rk7tE2oGapjO3gzz4WY,2226
32
- code_loader-0.2.86.dev4.dist-info/LICENSE,sha256=qIwWjdspQeSMTtnFZBC8MuT-95L02FPvzRUdWFxrwJY,1067
33
- code_loader-0.2.86.dev4.dist-info/METADATA,sha256=qRwT8e8w2QSCXoLuVrkTRdmHb5mXdGvsj4QY_9VaU68,952
34
- code_loader-0.2.86.dev4.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
35
- code_loader-0.2.86.dev4.dist-info/RECORD,,
32
+ code_loader-0.2.88.dist-info/LICENSE,sha256=qIwWjdspQeSMTtnFZBC8MuT-95L02FPvzRUdWFxrwJY,1067
33
+ code_loader-0.2.88.dist-info/METADATA,sha256=RVdQb6WajrbescPNX6lposmhOIa9dTkWLDOuPL0NS10,950
34
+ code_loader-0.2.88.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
35
+ code_loader-0.2.88.dist-info/RECORD,,