code-loader 1.0.124.dev0__py3-none-any.whl → 1.0.124.dev1__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.
Potentially problematic release.
This version of code-loader might be problematic. Click here for more details.
- code_loader/leaploader.py +7 -19
- code_loader/leaploaderbase.py +1 -5
- {code_loader-1.0.124.dev0.dist-info → code_loader-1.0.124.dev1.dist-info}/METADATA +1 -1
- {code_loader-1.0.124.dev0.dist-info → code_loader-1.0.124.dev1.dist-info}/RECORD +6 -6
- {code_loader-1.0.124.dev0.dist-info → code_loader-1.0.124.dev1.dist-info}/LICENSE +0 -0
- {code_loader-1.0.124.dev0.dist-info → code_loader-1.0.124.dev1.dist-info}/WHEEL +0 -0
code_loader/leaploader.py
CHANGED
|
@@ -157,7 +157,7 @@ class LeapLoader(LeapLoaderBase):
|
|
|
157
157
|
for prediction_type in setup.prediction_types
|
|
158
158
|
}
|
|
159
159
|
|
|
160
|
-
def get_sample(self, state: DataStateEnum, sample_id: Union[int, str]) -> DatasetSample:
|
|
160
|
+
def get_sample(self, state: DataStateEnum, sample_id: Union[int, str], instance_id: int = None) -> DatasetSample:
|
|
161
161
|
self.exec_script()
|
|
162
162
|
preprocess_result = self._preprocess_result()
|
|
163
163
|
if state == DataStateEnum.unlabeled and sample_id not in preprocess_result[state].sample_ids:
|
|
@@ -170,29 +170,15 @@ class LeapLoader(LeapLoaderBase):
|
|
|
170
170
|
custom_latent_space = global_leap_binder.setup_container.custom_latent_space.function(sample_id,
|
|
171
171
|
preprocess_result[
|
|
172
172
|
state])
|
|
173
|
+
instance_mask = self._get_instances_masks(state, sample_id, instance_id)
|
|
173
174
|
sample = DatasetSample(inputs=self._get_inputs(state, sample_id),
|
|
174
175
|
gt=None if state == DataStateEnum.unlabeled else self._get_gt(state, sample_id),
|
|
175
176
|
metadata=metadata,
|
|
176
177
|
metadata_is_none=metadata_is_none,
|
|
177
178
|
index=sample_id,
|
|
178
179
|
state=state,
|
|
179
|
-
custom_latent_space=custom_latent_space
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
def get_sample_with_masks(self, state: DataStateEnum, sample_id: Union[int, str], instance_id: int) -> DatasetSample:
|
|
183
|
-
self.exec_script()
|
|
184
|
-
preprocess_result = self._preprocess_result()
|
|
185
|
-
if state == DataStateEnum.unlabeled and sample_id not in preprocess_result[state].sample_ids:
|
|
186
|
-
self._preprocess_result(update_unlabeled_preprocess=True)
|
|
187
|
-
|
|
188
|
-
metadata, metadata_is_none = self._get_metadata(state, sample_id)
|
|
189
|
-
sample = DatasetSample(inputs=self._get_inputs(state, sample_id),
|
|
190
|
-
gt=None if state == DataStateEnum.unlabeled else self._get_gt(state, sample_id),
|
|
191
|
-
metadata=metadata,
|
|
192
|
-
metadata_is_none=metadata_is_none,
|
|
193
|
-
index=sample_id,
|
|
194
|
-
state=state,
|
|
195
|
-
instance_masks=self._get_instances_masks(state, sample_id, instance_id))
|
|
180
|
+
custom_latent_space=custom_latent_space,
|
|
181
|
+
instance_masks=instance_mask)
|
|
196
182
|
return sample
|
|
197
183
|
|
|
198
184
|
def check_dataset(self) -> DatasetIntegParseResult:
|
|
@@ -483,7 +469,9 @@ class LeapLoader(LeapLoaderBase):
|
|
|
483
469
|
def _get_inputs(self, state: DataStateEnum, sample_id: Union[int, str]) -> Dict[str, npt.NDArray[np.float32]]:
|
|
484
470
|
return self._get_dataset_handlers(global_leap_binder.setup_container.inputs, state, sample_id)
|
|
485
471
|
|
|
486
|
-
def _get_instances_masks(self, state: DataStateEnum, sample_id: Union[int, str], instance_id: int) -> Dict[str, ElementInstance]:
|
|
472
|
+
def _get_instances_masks(self, state: DataStateEnum, sample_id: Union[int, str], instance_id: int) -> Optional[Dict[str, ElementInstance]]:
|
|
473
|
+
if instance_id is None:
|
|
474
|
+
return None
|
|
487
475
|
preprocess_result = self._preprocess_result()
|
|
488
476
|
preprocess_state = preprocess_result[state]
|
|
489
477
|
result_agg = {}
|
code_loader/leaploaderbase.py
CHANGED
|
@@ -61,11 +61,7 @@ class LeapLoaderBase:
|
|
|
61
61
|
pass
|
|
62
62
|
|
|
63
63
|
@abstractmethod
|
|
64
|
-
def get_sample(self, state: DataStateEnum, sample_id: Union[int, str]) -> DatasetSample:
|
|
65
|
-
pass
|
|
66
|
-
|
|
67
|
-
@abstractmethod
|
|
68
|
-
def get_sample_with_masks(self, state: DataStateEnum, sample_id: Union[int, str], instance_id: int) -> DatasetSample:
|
|
64
|
+
def get_sample(self, state: DataStateEnum, sample_id: Union[int, str], instance_id: int = None) -> DatasetSample:
|
|
69
65
|
pass
|
|
70
66
|
|
|
71
67
|
@abstractmethod
|
|
@@ -22,8 +22,8 @@ code_loader/experiment_api/workingspace_config_utils.py,sha256=DLzXQCg4dgTV_YgaS
|
|
|
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=Q3D9yVM-GNEJfYRFvMV__BoZbcWOgnWKhrZXAv6Tu7o,33232
|
|
24
24
|
code_loader/inner_leap_binder/leapbinder_decorators.py,sha256=39Qv4VZBQ-TP1ToOo_cVcecz5s9Qx3bwj8Y8As9Z3Mw,45723
|
|
25
|
-
code_loader/leaploader.py,sha256=
|
|
26
|
-
code_loader/leaploaderbase.py,sha256=
|
|
25
|
+
code_loader/leaploader.py,sha256=85XUWd7Y8kup76xeqefgd8db7pGaeHMhE7QlmYlNFMw,29747
|
|
26
|
+
code_loader/leaploaderbase.py,sha256=LIFcC6xo6V_iiGN3BjibXETu_l84EWM_WIOKAvkfTiM,4458
|
|
27
27
|
code_loader/mixpanel_tracker.py,sha256=U20vQXH8G7XIVXxcpQcVEZSuIwwGnyH5RMHXWZZG8HI,4639
|
|
28
28
|
code_loader/plot_functions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
29
29
|
code_loader/plot_functions/plot_functions.py,sha256=xg6Gi4myTN9crq6JtyrhYI38HLXjPVJcbnI7CIy8f7w,14625
|
|
@@ -31,7 +31,7 @@ code_loader/plot_functions/visualize.py,sha256=gsBAYYkwMh7jIpJeDMPS8G4CW-pxwx6Lz
|
|
|
31
31
|
code_loader/utils.py,sha256=gXENTYpjdidq2dx0gVbXlErPeHoNs-4TYAZbLRe0y2c,2712
|
|
32
32
|
code_loader/visualizers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
33
33
|
code_loader/visualizers/default_visualizers.py,sha256=onRnLE_TXfgLN4o52hQIOOhUcFexGlqJ3xSpQDVLuZM,2604
|
|
34
|
-
code_loader-1.0.124.
|
|
35
|
-
code_loader-1.0.124.
|
|
36
|
-
code_loader-1.0.124.
|
|
37
|
-
code_loader-1.0.124.
|
|
34
|
+
code_loader-1.0.124.dev1.dist-info/LICENSE,sha256=qIwWjdspQeSMTtnFZBC8MuT-95L02FPvzRUdWFxrwJY,1067
|
|
35
|
+
code_loader-1.0.124.dev1.dist-info/METADATA,sha256=kUC9picA0wKPA-LV1Hak2dRCYgN3EM-TzI7yiR_HGkU,1095
|
|
36
|
+
code_loader-1.0.124.dev1.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
37
|
+
code_loader-1.0.124.dev1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|