konfai 1.0.4__py3-none-any.whl → 1.0.6__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.

@@ -58,7 +58,7 @@ class DataAugmentationsList():
58
58
 
59
59
  def load(self, key: str):
60
60
  for augmentation, prob in self.dataAugmentationsLoader.items():
61
- module, name = _getModule(augmentation, "augmentation")
61
+ module, name = _getModule(augmentation, "data.augmentation")
62
62
  dataAugmentation: DataAugmentation = getattr(importlib.import_module(module), name)(config = None, DL_args="{}.Dataset.augmentations.{}.dataAugmentations".format(DEEP_LEARNING_API_ROOT(), key))
63
63
  dataAugmentation.load(prob.prob)
64
64
  self.dataAugmentations.append(dataAugmentation)
konfai/data/transform.py CHANGED
@@ -36,7 +36,7 @@ class TransformLoader:
36
36
  pass
37
37
 
38
38
  def getTransform(self, classpath : str, DL_args : str) -> Transform:
39
- module, name = _getModule(classpath, "transform")
39
+ module, name = _getModule(classpath, "data.transform")
40
40
  return config("{}.{}".format(DL_args, classpath))(getattr(importlib.import_module(module), name))(config = None)
41
41
 
42
42
  class Clip(Transform):
konfai/evaluator.py CHANGED
@@ -27,7 +27,7 @@ class CriterionsLoader():
27
27
  def getCriterions(self, output_group : str, target_group : str) -> dict[torch.nn.Module, CriterionsAttr]:
28
28
  criterions = {}
29
29
  for module_classpath, criterionsAttr in self.criterionsLoader.items():
30
- module, name = _getModule(module_classpath, "measure")
30
+ module, name = _getModule(module_classpath, "metric.measure")
31
31
  criterions[config("{}.metrics.{}.targetsCriterions.{}.criterionsLoader.{}".format(DEEP_LEARNING_API_ROOT(), output_group, target_group, module_classpath))(getattr(importlib.import_module(module), name))(config = None)] = criterionsAttr
32
32
  return criterions
33
33
 
@@ -90,7 +90,7 @@ class Evaluator(DistributedObject):
90
90
  if os.environ["DEEP_LEANING_API_CONFIG_MODE"] != "Done":
91
91
  exit(0)
92
92
  super().__init__(train_name)
93
- self.metric_path = METRICS_DIRECTORY()+self.name+"/"
93
+ self.metric_path = EVALUATIONS_DIRECTORY()+self.name+"/"
94
94
  self.predict_path = PREDICTIONS_DIRECTORY()+self.name+"/"
95
95
  self.metricsLoader = metrics
96
96
  self.dataset = dataset
@@ -141,6 +141,4 @@ class Evaluator(DistributedObject):
141
141
  batch_iter.set_description(description(self.update({k: (v[0], v[4]) for k,v in data_dict.items()}, self.statistics_validation)))
142
142
  outputs = synchronize_data(world_size, gpu, self.statistics_validation.measures)
143
143
  if global_rank == 0:
144
- self.statistics_validation.write(outputs)
145
-
146
- # 69.8936 ± 13.2773 (107) 28.6021 (117) 0.8641 (118)
144
+ self.statistics_validation.write(outputs)
konfai/metric/measure.py CHANGED
@@ -244,7 +244,7 @@ class PerceptualLoss(Criterion):
244
244
  def getLoss(self) -> dict[torch.nn.Module, float]:
245
245
  result: dict[torch.nn.Module, float] = {}
246
246
  for loss, l in self.losses.items():
247
- module, name = _getModule(loss, "measure")
247
+ module, name = _getModule(loss, "metric.measure")
248
248
  result[config(self.DL_args)(getattr(importlib.import_module(module), name))(config=None)] = l
249
249
  return result
250
250
 
konfai/network/network.py CHANGED
@@ -96,7 +96,7 @@ class CriterionsLoader():
96
96
  def getCriterions(self, model_classname : str, output_group : str, target_group : str) -> dict[torch.nn.Module, CriterionsAttr]:
97
97
  criterions = {}
98
98
  for module_classpath, criterionsAttr in self.criterionsLoader.items():
99
- module, name = _getModule(module_classpath, "measure")
99
+ module, name = _getModule(module_classpath, "metric.measure")
100
100
  criterionsAttr.isTorchCriterion = module.startswith("torch")
101
101
  criterionsAttr.sheduler = criterionsAttr.l.getShedulers("{}.Model.{}.outputsCriterions.{}.targetsCriterions.{}.criterionsLoader.{}".format(DEEP_LEARNING_API_ROOT(), model_classname, output_group, target_group, module_classpath))
102
102
  criterions[config("{}.Model.{}.outputsCriterions.{}.targetsCriterions.{}.criterionsLoader.{}".format(DEEP_LEARNING_API_ROOT(), model_classname, output_group, target_group, module_classpath))(getattr(importlib.import_module(module), name))(config = None)] = criterionsAttr
konfai/predictor.py CHANGED
@@ -55,7 +55,7 @@ class OutDataset(Dataset, NeedDevice, ABC):
55
55
  transform_type.append(transform)
56
56
 
57
57
  if self._patchCombine is not None:
58
- module, name = _getModule(self._patchCombine, "HDF5")
58
+ module, name = _getModule(self._patchCombine, "data.HDF5")
59
59
  self.patchCombine = getattr(importlib.import_module(module), name)(config = None, DL_args = "{}.outsDataset.{}.OutDataset".format(DEEP_LEARNING_API_ROOT(), name_layer))
60
60
 
61
61
  def setPatchConfig(self, patchSize: Union[list[int], None], overlap: Union[int, None], nb_data_augmentation: int) -> None:
konfai/utils/utils.py CHANGED
@@ -35,7 +35,7 @@ def _getModule(classpath : str, type : str) -> tuple[str, str]:
35
35
  module = ".".join(classpath.split("_")[:-1])
36
36
  name = classpath.split("_")[-1]
37
37
  else:
38
- module = ""+type
38
+ module = "konfai."+type
39
39
  name = classpath
40
40
  return module, name
41
41
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: konfai
3
- Version: 1.0.4
3
+ Version: 1.0.6
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
@@ -33,7 +33,7 @@ Dynamic: license-file
33
33
 
34
34
 
35
35
  # 🧠 KonfAI
36
- <img src="logo.png" alt="KonfAI Logo" width="200" align="right"/>
36
+ <img src="https://raw.githubusercontent.com/vboussot/KonfAI/main/logo.png" alt="KonfAI Logo" width="200" align="right"/>
37
37
 
38
38
  **KonfAI** is a modular and highly configurable deep learning framework built on PyTorch, driven entirely by YAML configuration files.
39
39
 
@@ -54,8 +54,30 @@ It is designed to support complex medical imaging workflows, flexible model arch
54
54
 
55
55
  ## 🚀 Installation
56
56
 
57
- ```bash
58
- git clone https://github.com/vboussot/KonfAI.git && cd KonfAI
57
+ ### From PyPI (recommended)
58
+
59
+ Install KonfAI from PyPI:
60
+
61
+ ```
62
+ pip install konfai
63
+ ```
64
+
65
+ This will install the command-line tools:
66
+
67
+ ```
68
+ konfai --help
69
+ konfai-cluster --help
70
+ ```
71
+
72
+ ---
73
+
74
+ ### From GitHub
75
+
76
+ Clone the repository and install:
77
+
78
+ ```
79
+ git clone https://github.com/vboussot/KonfAI.git
80
+ cd KonfAI
59
81
  pip install -e .
60
82
  ```
61
83
 
@@ -1,15 +1,15 @@
1
1
  konfai/__init__.py,sha256=jXMTNml38eX6FSq9d3C_gJVgRLTKHPBUXqOLC7Pqkuo,828
2
- konfai/evaluator.py,sha256=emXNtEdKNf_YoJ-mkvdAuIwiwL6n5OvkWKAJmV6oMGc,7440
2
+ konfai/evaluator.py,sha256=WLJ_hEwY2smB6F2KBLCVH_j13WVe3biuETSg2_NTXdk,7396
3
3
  konfai/main.py,sha256=voh5P5UUY0vjBOsd79O23cVK2LR8WH4c_8ep-kI967E,2149
4
- konfai/predictor.py,sha256=Xmx8TSrYGPYkUjo82n-_7g5oznVzOv26tuytpeyYdtI,20173
4
+ konfai/predictor.py,sha256=-CtMHDaZgnCSz-eKC3MG5_y7CWQI89afWpr7i897RVI,20178
5
5
  konfai/trainer.py,sha256=x4Sni2JBOPgcSnpRwHHIQFB7cc0-cZ4L8X9pwZQt0qs,16866
6
6
  konfai/data/HDF5.py,sha256=Amexa4zMfsamo0odxHgKBwWlR7WquhGnAmFFVETcpQw,14355
7
7
  konfai/data/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
- konfai/data/augmentation.py,sha256=UA-Kpg9luU2CJPTW2Cjqry_AYpMxAdeXKgPIX8a1oSI,31729
8
+ konfai/data/augmentation.py,sha256=-1KYIVE_CuFwGg-AA5M9g5rDpkhwUWczfZA8JVhxNM4,31734
9
9
  konfai/data/dataset.py,sha256=azYz6yiwMHNaXlmXRY05PBHHcmrYjnpbXo0jcyachRk,23914
10
- konfai/data/transform.py,sha256=aiNMd_nGGwQreH6A7h1OcVJGlGHSkKb8Y0I0YoQVSuY,25150
10
+ konfai/data/transform.py,sha256=AI2k0e_ocphxccOyaHUhKtA9-E5B5SwZ0Du-C1mfG84,25155
11
11
  konfai/metric/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
12
- konfai/metric/measure.py,sha256=68tuBL6XteJTuQ4KgBBg3mTbNFdK9gfYHCyyqYfYW1c,21805
12
+ konfai/metric/measure.py,sha256=VN4SF1b8WHWckAsoObWKMfTOnOGf9Zm3DKyrK-bkNwg,21812
13
13
  konfai/metric/schedulers.py,sha256=UoSr1TW_hrus3DhvOEbDefxCSUGz7lJS_8vbz0GEye8,1370
14
14
  konfai/models/classification/convNeXt.py,sha256=TucP-EsQ4wlUX2MvbGYwOwUySJlo9Ljg65n3n-yivS0,9239
15
15
  konfai/models/classification/resnet.py,sha256=4EtjXBYLOjE89ywjoPkSR1MflpeMTG2dth1jvw6-lAw,7954
@@ -24,16 +24,16 @@ konfai/models/segmentation/NestedUNet.py,sha256=GnAwQYHzivHN1qouifJyneh9nOFHSloG
24
24
  konfai/models/segmentation/UNet.py,sha256=Icd_YddkHpExRxyvhoBTsd4McVkaBOF4Y3L_NrNA6Gs,4214
25
25
  konfai/network/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
26
26
  konfai/network/blocks.py,sha256=EN1JN929zzV0FfecgFnVvv8u-WwENFRxloOpfCBkqeU,13529
27
- konfai/network/network.py,sha256=VIFgZPsUUzpY07uuni84LQ-fGfODc06TsdaWVTpmxGo,45768
27
+ konfai/network/network.py,sha256=7JL7gtWB8vk8wHaQsritaVGDN_fjrmDNkHfIkqJtLSE,45775
28
28
  konfai/utils/ITK.py,sha256=OxTieDNNYHGkn7zxJsAG-6ecRG1VYMvn1dlBbBe1DOs,13955
29
- konfai/utils/Registration.py,sha256=v1srEBOcgDnHrx0YtsK6bcj0yCMH7wNeaQ3wC7gEvOw,8898
30
29
  konfai/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
31
30
  konfai/utils/config.py,sha256=tzIkNUA88EXGpkH-GUFA-BehxC47wAuDbu0M0kWfUIY,9887
32
31
  konfai/utils/dataset.py,sha256=DTAt8AEsAkDWM8ZtiXPUQfS5DQBqdYmXuw2sjOTIYV4,35517
33
- konfai/utils/utils.py,sha256=i7bfAMuIjaafy8wMFFgZQWHPJDkpXN61f_mNd4F29Kw,20179
34
- konfai-1.0.4.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
35
- konfai-1.0.4.dist-info/METADATA,sha256=jnUYKDmbnKUFJ9cyIlCz5HNuGsurJrKXNtDFPbilEzw,2035
36
- konfai-1.0.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
37
- konfai-1.0.4.dist-info/entry_points.txt,sha256=fG82HRN5-g39ACSOCtij_I3N6EHxfYnMR0D7TI_8pW8,81
38
- konfai-1.0.4.dist-info/top_level.txt,sha256=xF470dkIlFoFqTZEOlRehKJr4WU_8OKGXrJqYm9vWKs,7
39
- konfai-1.0.4.dist-info/RECORD,,
32
+ konfai/utils/registration.py,sha256=v1srEBOcgDnHrx0YtsK6bcj0yCMH7wNeaQ3wC7gEvOw,8898
33
+ konfai/utils/utils.py,sha256=hRxqq1cOXewFG417kYQZUGzKqaCK14GNQqjFdRBIVGs,20186
34
+ konfai-1.0.6.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
35
+ konfai-1.0.6.dist-info/METADATA,sha256=le1r8uFUsi1q5S2NlQQ0oXKtgrnRl-XYX0KnVanFWWw,2312
36
+ konfai-1.0.6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
37
+ konfai-1.0.6.dist-info/entry_points.txt,sha256=fG82HRN5-g39ACSOCtij_I3N6EHxfYnMR0D7TI_8pW8,81
38
+ konfai-1.0.6.dist-info/top_level.txt,sha256=xF470dkIlFoFqTZEOlRehKJr4WU_8OKGXrJqYm9vWKs,7
39
+ konfai-1.0.6.dist-info/RECORD,,
File without changes
File without changes