code-loader 1.0.91.dev11__py3-none-any.whl → 1.0.91.dev13__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.
@@ -5,7 +5,7 @@ import numpy as np
5
5
  import numpy.typing as npt
6
6
 
7
7
  from code_loader.contract.enums import DataStateType, DataStateEnum, LeapDataType, ConfusionMatrixValue, \
8
- MetricDirection, DatasetMetadataType
8
+ MetricDirection, DatasetMetadataType, InstanceFillingType
9
9
  from code_loader.contract.visualizer_classes import LeapImage, LeapText, LeapGraph, LeapHorizontalBar, \
10
10
  LeapTextMask, LeapImageMask, LeapImageWithBBox, LeapImageWithHeatmap, LeapVideo
11
11
 
@@ -72,6 +72,7 @@ class PreprocessResponse:
72
72
  class ElementInstance:
73
73
  name: str
74
74
  mask: npt.NDArray[np.float32]
75
+ # instance_filling_type: InstanceFillingType # TODO: implement InstanceFillingType
75
76
 
76
77
  SectionCallableInterface = Callable[[Union[int, str], PreprocessResponse], npt.NDArray[np.float32]]
77
78
  InstanceCallableInterface = Callable[[int, PreprocessResponse], List[ElementInstance]]
@@ -17,6 +17,10 @@ class MetricEnum(Enum):
17
17
  # should not be copied to engine contracts
18
18
  Metric = MetricEnum
19
19
 
20
+ # class InstanceFillingType(Enum): # TODO: implement InstanceFillingType
21
+ # Zeros = 'Zeros'
22
+ # Blur = 'Blur'
23
+ # Learnable = 'Learnable'
20
24
 
21
25
  class LeapDataType(Enum):
22
26
  Image = 'Image'
@@ -279,9 +279,8 @@ def tensorleap_element_instance_preprocess(instance_mask_encoder: Callable[[int,
279
279
  instance_to_sample_ids_mappings = {}
280
280
  all_sample_ids = preprocess_response.sample_ids.copy()
281
281
  for sample_id in preprocess_response.sample_ids:
282
- data_length = len(all_sample_ids)
283
282
  instances_masks = instance_mask_encoder(sample_id, preprocess_response)
284
- instances_ids = list(range(data_length, data_length + len(instances_masks)))
283
+ instances_ids = [f'{sample_id}_{instance_id}' for instance_id in range(len(instances_masks))]
285
284
  sample_ids_to_instance_mappings[sample_id] = instances_ids
286
285
  instance_to_sample_ids_mappings[sample_id] = sample_id
287
286
  for instance_id in instances_ids:
@@ -294,6 +293,9 @@ def tensorleap_element_instance_preprocess(instance_mask_encoder: Callable[[int,
294
293
 
295
294
  leap_binder.set_preprocess(user_function_instance)
296
295
 
296
+ def metadata_sample_index(idx: str, preprocess: PreprocessResponse) -> bool:
297
+ return False
298
+ leap_binder.set_metadata(metadata_sample_index, "is_instance")
297
299
 
298
300
  def _validate_input_args(*args, **kwargs):
299
301
  assert len(args) == 0 and len(kwargs) == 0, \
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: code-loader
3
- Version: 1.0.91.dev11
3
+ Version: 1.0.91.dev13
4
4
  Summary:
5
5
  Home-page: https://github.com/tensorleap/code-loader
6
6
  License: MIT
@@ -1,8 +1,8 @@
1
1
  LICENSE,sha256=qIwWjdspQeSMTtnFZBC8MuT-95L02FPvzRUdWFxrwJY,1067
2
2
  code_loader/__init__.py,sha256=6MMWr0ObOU7hkqQKgOqp4Zp3I28L7joGC9iCbQYtAJg,241
3
3
  code_loader/contract/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
- code_loader/contract/datasetclasses.py,sha256=RWXBIPE35N5dWpgvCYPym3t7h__-9JkUJ9Kj7v8vFr0,8657
5
- code_loader/contract/enums.py,sha256=GEFkvUMXnCNt-GOoz7NJ9ecQZ2PPDettJNOsxsiM0wk,1622
4
+ code_loader/contract/datasetclasses.py,sha256=3q_5eWZZEWatcZdz01JoSqc3evn4XS12Ulm_18mVtPk,8765
5
+ code_loader/contract/enums.py,sha256=uFNMqi_-_0aPZHX9_f7W9ceDD7qATSxO4WuC9MY9QUI,1767
6
6
  code_loader/contract/exceptions.py,sha256=jWqu5i7t-0IG0jGRsKF4DjJdrsdpJjIYpUkN1F4RiyQ,51
7
7
  code_loader/contract/mapping.py,sha256=e11h_sprwOyE32PcqgRq9JvyahQrPzwqgkhmbQLKLQY,1165
8
8
  code_loader/contract/responsedataclasses.py,sha256=6-5DJkYBdXb3UB1eNidTTPPBIYxMjEoMdYDkp9VhH8o,4223
@@ -21,13 +21,13 @@ code_loader/experiment_api/utils.py,sha256=XZHtxge12TS4H4-8PjV3sKuhp8Ud6ojAiIzTZ
21
21
  code_loader/experiment_api/workingspace_config_utils.py,sha256=DLzXQCg4dgTV_YgaSbeTVzq-2ja_SQw4zi7LXwKL9cY,990
22
22
  code_loader/inner_leap_binder/__init__.py,sha256=koOlJyMNYzGbEsoIbXathSmQ-L38N_pEXH_HvL7beXU,99
23
23
  code_loader/inner_leap_binder/leapbinder.py,sha256=eHnjPfJvYQDQsBM55sf63kI-NC2M-lOB4cwxjYHNTkk,32766
24
- code_loader/inner_leap_binder/leapbinder_decorators.py,sha256=jb4UtLN8m5xRz-OpKzEOw5f6PWZjET4Ysp49vd81Wlw,28807
24
+ code_loader/inner_leap_binder/leapbinder_decorators.py,sha256=ZpctEOpV_cJ3wCR6KxF9KhBrQTQGnw6-0RAQrWl3iuY,28951
25
25
  code_loader/leaploader.py,sha256=K532J4Z8YUjyBpTagJPff4PD0dkuwT9szgBbwBiWwwY,28846
26
26
  code_loader/leaploaderbase.py,sha256=tpMVEd97675b_var4hvesjN7EgQzoCbPEayNBut6AvI,4551
27
27
  code_loader/utils.py,sha256=_j8b60pimoNAvWMRj7hEkkT6C76qES6cZoBFHpXHMxA,2698
28
28
  code_loader/visualizers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
29
29
  code_loader/visualizers/default_visualizers.py,sha256=669lBpLISLO6my5Qcgn1FLDDeZgHumPf252m4KHY4YM,2555
30
- code_loader-1.0.91.dev11.dist-info/LICENSE,sha256=qIwWjdspQeSMTtnFZBC8MuT-95L02FPvzRUdWFxrwJY,1067
31
- code_loader-1.0.91.dev11.dist-info/METADATA,sha256=qEJ9pgcAFdwKoxGPsjpHac4T9YOYiXth3MC0uJS-PSw,855
32
- code_loader-1.0.91.dev11.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
33
- code_loader-1.0.91.dev11.dist-info/RECORD,,
30
+ code_loader-1.0.91.dev13.dist-info/LICENSE,sha256=qIwWjdspQeSMTtnFZBC8MuT-95L02FPvzRUdWFxrwJY,1067
31
+ code_loader-1.0.91.dev13.dist-info/METADATA,sha256=wagFBr0x6BvUqvMstdZtB1PVwlFzcWbpPtzc6hdkCRQ,855
32
+ code_loader-1.0.91.dev13.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
33
+ code_loader-1.0.91.dev13.dist-info/RECORD,,