konfai 1.1.7__py3-none-any.whl → 1.1.8__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 konfai might be problematic. Click here for more details.

@@ -282,7 +282,7 @@ class Data(ABC):
282
282
  self.dataAugmentationsList = dataAugmentationsList
283
283
  self.batch_size = batch_size
284
284
  self.dataSet_args = dict(groups_src=self.groups_src, inlineAugmentations=inlineAugmentations, dataAugmentationsList = list(self.dataAugmentationsList.values()), use_cache = use_cache, buffer_size=batch_size+1, patch_size=self.patch.patch_size if self.patch is not None else None, overlap=self.patch.overlap if self.patch is not None else None)
285
- self.dataLoader_args = dict(num_workers=int(os.environ["KONFAI_WORKERS"]), pin_memory=True)
285
+ self.dataLoader_args = dict(num_workers=int(os.environ["KONFAI_WORKERS"]) if use_cache else 0, pin_memory=True)
286
286
  self.data : list[list[dict[str, list[DatasetManager]]], dict[str, list[DatasetManager]]] = []
287
287
  self.map : list[list[list[tuple[int, int, int]]], list[tuple[int, int, int]]] = []
288
288
  self.datasets: dict[str, Dataset] = {}
konfai/data/transform.py CHANGED
@@ -250,7 +250,6 @@ class ResampleToShape(Resample):
250
250
  self.shape = torch.tensor([0 if s < 0 else s for s in shape])
251
251
 
252
252
  def transformShape(self, shape: list[int], cache_attribute: Attribute) -> list[int]:
253
- print(shape)
254
253
  if "Spacing" not in cache_attribute:
255
254
  TransformError("Missing 'Spacing' in cache attributes, the data is likely not a valid image.",
256
255
  "Make sure your input is a image (e.g., .nii, .mha) with proper metadata.")
@@ -260,7 +259,6 @@ class ResampleToShape(Resample):
260
259
  for i, s in enumerate(self.shape):
261
260
  if s == 0:
262
261
  new_shape[i] = shape[i]
263
- print(new_shape)
264
262
  return new_shape
265
263
 
266
264
  def __call__(self, name: str, input: torch.Tensor, cache_attribute: Attribute) -> torch.Tensor:
konfai/predictor.py CHANGED
@@ -64,7 +64,7 @@ class OutDataset(Dataset, NeedDevice, ABC):
64
64
 
65
65
  module, name = _getModule(self.reduction_classpath, "konfai.predictor")
66
66
  if module == "konfai.predictor":
67
- self.reduction = getattr(importlib.import_module(module), name)
67
+ self.reduction = getattr(importlib.import_module(module), name)()
68
68
  else:
69
69
  self.reduction = config("{}.outsDataset.{}.OutDataset.{}".format(KONFAI_ROOT(), name_layer, self.reduction_classpath))(getattr(importlib.import_module(module), name))(config = None)
70
70
 
@@ -184,7 +184,6 @@ class OutSameAsGroupDataset(OutDataset):
184
184
  result = torch.cat([self._getOutput(index, index_augmentation, dataset).unsqueeze(0) for index_augmentation in self.output_layer_accumulator[index].keys()], dim=0)
185
185
  self.output_layer_accumulator.pop(index)
186
186
  result = self.reduction(result.float()).to(result.dtype)
187
-
188
187
  for transform in self.after_reduction_transforms:
189
188
  result = transform(self.names[index], result, self.attributes[index][0][0])
190
189
 
@@ -303,7 +302,7 @@ class ModelComposite(Network):
303
302
  for module_outputs in result.values():
304
303
  for key, tensor in module_outputs:
305
304
  aggregated[key].append(tensor)
306
-
305
+
307
306
  final_outputs = []
308
307
  for key, tensors in aggregated.items():
309
308
  final_outputs.append((key, self.combine(torch.stack(tensors, dim=0))))
@@ -404,7 +403,7 @@ class Predictor(DistributedObject):
404
403
 
405
404
  module, name = _getModule(self.combine_classpath, "konfai.predictor")
406
405
  if module == "konfai.predictor":
407
- combine = getattr(importlib.import_module(module), name)
406
+ combine = getattr(importlib.import_module(module), name)()
408
407
  else:
409
408
  combine = config("{}.{}".format(KONFAI_ROOT(), self.combine_classpath))(getattr(importlib.import_module(module), name))(config = None)
410
409
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: konfai
3
- Version: 1.1.7
3
+ Version: 1.1.8
4
4
  Summary: Modular and configurable Deep Learning framework with YAML and PyTorch
5
5
  Author-email: Valentin Boussot <boussot.v@gmail.com>
6
6
  License-Expression: Apache-2.0
@@ -1,13 +1,13 @@
1
1
  konfai/__init__.py,sha256=YXG-wpSEXWs6Jt3BDI77V4r89gEUNX-6lxW9btj5VYI,851
2
2
  konfai/evaluator.py,sha256=WM78NGydV0iqKElahr-WpOCZLEJXHjjPq-LS-gi23rk,8401
3
3
  konfai/main.py,sha256=kr7Iie_f67NF6G3dAAj9G6Z9dhn9RzbdLYpzy2WvIh8,2573
4
- konfai/predictor.py,sha256=6zFGjQhG5-3hF10pvCn58UDLB6ZQ_UhMlxkOCzpM4tM,23053
4
+ konfai/predictor.py,sha256=ih0GVkYEhIxvolDdQ-Cr9mWTNvtIGyGadtrT_RAkzys,23052
5
5
  konfai/trainer.py,sha256=Edi8l8OOfCewYM-Cd5C5rCqCaprvlfxzohd4iLkK5u0,20632
6
6
  konfai/data/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
7
  konfai/data/augmentation.py,sha256=mFVMpbJ8WBKGbMILdmTZYBA8k7kRDQVPOEy1A9t5QP4,32281
8
- konfai/data/data_manager.py,sha256=yphkTjk4_gyr_vOGodfhu9ImDHplRe2KR6dL2ORXzCw,29000
8
+ konfai/data/data_manager.py,sha256=FHRGiSg5HcXmlMWntdNgv0_bty_gwaDUBWYt5LSw86k,29020
9
9
  konfai/data/patching.py,sha256=zAm6jjUW--lsqTBlDFICVlj7O_QOlSxStFAHS9S9H8I,14753
10
- konfai/data/transform.py,sha256=yZ6aALtVEqTYghREPH8Z1deglU7M4t4OiQqMY6gpjjA,26559
10
+ konfai/data/transform.py,sha256=RSVCjHshw74yk4QV6d3lPRhqkwP77T08rI3YkNV6nTQ,26513
11
11
  konfai/metric/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
12
12
  konfai/metric/measure.py,sha256=S65WGBRYMoalkwI_Le3C6K0tQmT4Qft82nUTBwhpvFU,26907
13
13
  konfai/metric/schedulers.py,sha256=VPp7zEwD0AtQz51XG0TlutD_NrsTZs4fstC5h8A8f8U,1309
@@ -31,9 +31,9 @@ konfai/utils/config.py,sha256=f7o83ix5_oNbr2pki-Czqr-yHi-8n92ZL64nlo0XGwA,12514
31
31
  konfai/utils/dataset.py,sha256=6ZzevdhJ7e5zlXATAVwSh9O6acKXM7gYNxkMAa5DrmM,36351
32
32
  konfai/utils/registration.py,sha256=v1srEBOcgDnHrx0YtsK6bcj0yCMH7wNeaQ3wC7gEvOw,8898
33
33
  konfai/utils/utils.py,sha256=mQQ6FB0Jw7Odg5GxYeTApR6lvFhXn_iz-GVGZRngGQA,24934
34
- konfai-1.1.7.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
35
- konfai-1.1.7.dist-info/METADATA,sha256=DJ2n6Rc9NF018KsJPQxFHpQmlDazUnrrP4zHtgE4_Ew,2515
36
- konfai-1.1.7.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
37
- konfai-1.1.7.dist-info/entry_points.txt,sha256=fG82HRN5-g39ACSOCtij_I3N6EHxfYnMR0D7TI_8pW8,81
38
- konfai-1.1.7.dist-info/top_level.txt,sha256=xF470dkIlFoFqTZEOlRehKJr4WU_8OKGXrJqYm9vWKs,7
39
- konfai-1.1.7.dist-info/RECORD,,
34
+ konfai-1.1.8.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
35
+ konfai-1.1.8.dist-info/METADATA,sha256=nHfQDnRa5XjIHXCoVSRY7JX7pP-kSoaWnb0Nt1IwQaU,2515
36
+ konfai-1.1.8.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
37
+ konfai-1.1.8.dist-info/entry_points.txt,sha256=fG82HRN5-g39ACSOCtij_I3N6EHxfYnMR0D7TI_8pW8,81
38
+ konfai-1.1.8.dist-info/top_level.txt,sha256=xF470dkIlFoFqTZEOlRehKJr4WU_8OKGXrJqYm9vWKs,7
39
+ konfai-1.1.8.dist-info/RECORD,,
File without changes