konfai 1.1.7__tar.gz → 1.1.8__tar.gz
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.
- {konfai-1.1.7 → konfai-1.1.8}/PKG-INFO +1 -1
- {konfai-1.1.7 → konfai-1.1.8}/konfai/data/data_manager.py +1 -1
- {konfai-1.1.7 → konfai-1.1.8}/konfai/data/transform.py +0 -2
- {konfai-1.1.7 → konfai-1.1.8}/konfai/predictor.py +3 -4
- {konfai-1.1.7 → konfai-1.1.8}/konfai.egg-info/PKG-INFO +1 -1
- {konfai-1.1.7 → konfai-1.1.8}/pyproject.toml +1 -1
- {konfai-1.1.7 → konfai-1.1.8}/LICENSE +0 -0
- {konfai-1.1.7 → konfai-1.1.8}/README.md +0 -0
- {konfai-1.1.7 → konfai-1.1.8}/konfai/__init__.py +0 -0
- {konfai-1.1.7 → konfai-1.1.8}/konfai/data/__init__.py +0 -0
- {konfai-1.1.7 → konfai-1.1.8}/konfai/data/augmentation.py +0 -0
- {konfai-1.1.7 → konfai-1.1.8}/konfai/data/patching.py +0 -0
- {konfai-1.1.7 → konfai-1.1.8}/konfai/evaluator.py +0 -0
- {konfai-1.1.7 → konfai-1.1.8}/konfai/main.py +0 -0
- {konfai-1.1.7 → konfai-1.1.8}/konfai/metric/__init__.py +0 -0
- {konfai-1.1.7 → konfai-1.1.8}/konfai/metric/measure.py +0 -0
- {konfai-1.1.7 → konfai-1.1.8}/konfai/metric/schedulers.py +0 -0
- {konfai-1.1.7 → konfai-1.1.8}/konfai/models/classification/convNeXt.py +0 -0
- {konfai-1.1.7 → konfai-1.1.8}/konfai/models/classification/resnet.py +0 -0
- {konfai-1.1.7 → konfai-1.1.8}/konfai/models/generation/cStyleGan.py +0 -0
- {konfai-1.1.7 → konfai-1.1.8}/konfai/models/generation/ddpm.py +0 -0
- {konfai-1.1.7 → konfai-1.1.8}/konfai/models/generation/diffusionGan.py +0 -0
- {konfai-1.1.7 → konfai-1.1.8}/konfai/models/generation/gan.py +0 -0
- {konfai-1.1.7 → konfai-1.1.8}/konfai/models/generation/vae.py +0 -0
- {konfai-1.1.7 → konfai-1.1.8}/konfai/models/registration/registration.py +0 -0
- {konfai-1.1.7 → konfai-1.1.8}/konfai/models/representation/representation.py +0 -0
- {konfai-1.1.7 → konfai-1.1.8}/konfai/models/segmentation/NestedUNet.py +0 -0
- {konfai-1.1.7 → konfai-1.1.8}/konfai/models/segmentation/UNet.py +0 -0
- {konfai-1.1.7 → konfai-1.1.8}/konfai/network/__init__.py +0 -0
- {konfai-1.1.7 → konfai-1.1.8}/konfai/network/blocks.py +0 -0
- {konfai-1.1.7 → konfai-1.1.8}/konfai/network/network.py +0 -0
- {konfai-1.1.7 → konfai-1.1.8}/konfai/trainer.py +0 -0
- {konfai-1.1.7 → konfai-1.1.8}/konfai/utils/ITK.py +0 -0
- {konfai-1.1.7 → konfai-1.1.8}/konfai/utils/__init__.py +0 -0
- {konfai-1.1.7 → konfai-1.1.8}/konfai/utils/config.py +0 -0
- {konfai-1.1.7 → konfai-1.1.8}/konfai/utils/dataset.py +0 -0
- {konfai-1.1.7 → konfai-1.1.8}/konfai/utils/registration.py +0 -0
- {konfai-1.1.7 → konfai-1.1.8}/konfai/utils/utils.py +0 -0
- {konfai-1.1.7 → konfai-1.1.8}/konfai.egg-info/SOURCES.txt +0 -0
- {konfai-1.1.7 → konfai-1.1.8}/konfai.egg-info/dependency_links.txt +0 -0
- {konfai-1.1.7 → konfai-1.1.8}/konfai.egg-info/entry_points.txt +0 -0
- {konfai-1.1.7 → konfai-1.1.8}/konfai.egg-info/requires.txt +0 -0
- {konfai-1.1.7 → konfai-1.1.8}/konfai.egg-info/top_level.txt +0 -0
- {konfai-1.1.7 → konfai-1.1.8}/setup.cfg +0 -0
- {konfai-1.1.7 → konfai-1.1.8}/tests/test_config.py +0 -0
- {konfai-1.1.7 → konfai-1.1.8}/tests/test_dataset.py +0 -0
|
@@ -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] = {}
|
|
@@ -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:
|
|
@@ -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
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|