stouputils 1.13.2__tar.gz → 1.14.0__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.
Files changed (170) hide show
  1. {stouputils-1.13.2 → stouputils-1.14.0}/PKG-INFO +1 -1
  2. {stouputils-1.13.2 → stouputils-1.14.0}/pyproject.toml +102 -102
  3. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/data_science/config/get.py +51 -51
  4. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/data_science/data_processing/image/__init__.py +66 -66
  5. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/data_science/data_processing/image/auto_contrast.py +79 -79
  6. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/data_science/data_processing/image/axis_flip.py +58 -58
  7. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/data_science/data_processing/image/bias_field_correction.py +74 -74
  8. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/data_science/data_processing/image/binary_threshold.py +73 -73
  9. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/data_science/data_processing/image/blur.py +59 -59
  10. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/data_science/data_processing/image/brightness.py +54 -54
  11. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/data_science/data_processing/image/canny.py +110 -110
  12. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/data_science/data_processing/image/clahe.py +92 -92
  13. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/data_science/data_processing/image/common.py +30 -30
  14. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/data_science/data_processing/image/contrast.py +53 -53
  15. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/data_science/data_processing/image/curvature_flow_filter.py +74 -74
  16. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/data_science/data_processing/image/denoise.py +378 -378
  17. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/data_science/data_processing/image/histogram_equalization.py +123 -123
  18. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/data_science/data_processing/image/invert.py +64 -64
  19. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/data_science/data_processing/image/laplacian.py +60 -60
  20. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/data_science/data_processing/image/median_blur.py +52 -52
  21. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/data_science/data_processing/image/noise.py +59 -59
  22. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/data_science/data_processing/image/normalize.py +65 -65
  23. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/data_science/data_processing/image/random_erase.py +66 -66
  24. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/data_science/data_processing/image/resize.py +69 -69
  25. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/data_science/data_processing/image/rotation.py +80 -80
  26. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/data_science/data_processing/image/salt_pepper.py +68 -68
  27. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/data_science/data_processing/image/sharpening.py +55 -55
  28. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/data_science/data_processing/image/shearing.py +64 -64
  29. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/data_science/data_processing/image/threshold.py +64 -64
  30. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/data_science/data_processing/image/translation.py +71 -71
  31. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/data_science/data_processing/image/zoom.py +83 -83
  32. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/data_science/data_processing/image_augmentation.py +118 -118
  33. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/data_science/data_processing/image_preprocess.py +183 -183
  34. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/data_science/data_processing/prosthesis_detection.py +359 -359
  35. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/data_science/data_processing/technique.py +481 -481
  36. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/data_science/dataset/__init__.py +45 -45
  37. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/data_science/dataset/dataset.py +292 -292
  38. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/data_science/dataset/dataset_loader.py +135 -135
  39. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/data_science/dataset/grouping_strategy.py +296 -296
  40. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/data_science/dataset/image_loader.py +100 -100
  41. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/data_science/dataset/xy_tuple.py +696 -696
  42. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/data_science/metric_dictionnary.py +106 -106
  43. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/data_science/mlflow_utils.py +206 -206
  44. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/data_science/models/abstract_model.py +149 -149
  45. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/data_science/models/all.py +85 -85
  46. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/data_science/models/keras/all.py +38 -38
  47. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/data_science/models/keras/convnext.py +62 -62
  48. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/data_science/models/keras/densenet.py +50 -50
  49. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/data_science/models/keras/efficientnet.py +60 -60
  50. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/data_science/models/keras/mobilenet.py +56 -56
  51. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/data_science/models/keras/resnet.py +52 -52
  52. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/data_science/models/keras/squeezenet.py +233 -233
  53. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/data_science/models/keras/vgg.py +42 -42
  54. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/data_science/models/keras/xception.py +38 -38
  55. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/data_science/models/keras_utils/callbacks/__init__.py +20 -20
  56. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/data_science/models/keras_utils/callbacks/colored_progress_bar.py +219 -219
  57. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/data_science/models/keras_utils/callbacks/learning_rate_finder.py +148 -148
  58. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/data_science/models/keras_utils/callbacks/model_checkpoint_v2.py +31 -31
  59. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/data_science/models/keras_utils/callbacks/progressive_unfreezing.py +249 -249
  60. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/data_science/models/keras_utils/callbacks/warmup_scheduler.py +66 -66
  61. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/data_science/models/keras_utils/losses/__init__.py +12 -12
  62. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/data_science/models/keras_utils/losses/next_generation_loss.py +56 -56
  63. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/data_science/models/keras_utils/visualizations.py +416 -416
  64. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/data_science/models/sandbox.py +116 -116
  65. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/data_science/range_tuple.py +234 -234
  66. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/data_science/utils.py +285 -285
  67. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/decorators.py +20 -10
  68. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/installer/__init__.py +18 -18
  69. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/installer/linux.py +144 -144
  70. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/installer/main.py +223 -223
  71. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/installer/windows.py +136 -136
  72. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/parallel.py +34 -4
  73. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/print.py +12 -1
  74. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/py.typed +1 -1
  75. {stouputils-1.13.2 → stouputils-1.14.0/stouputils}/stouputils/decorators.pyi +10 -0
  76. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/stouputils/parallel.pyi +8 -3
  77. {stouputils-1.13.2 → stouputils-1.14.0/stouputils}/stouputils/print.pyi +2 -2
  78. stouputils-1.13.2/stouputils/continuous_delivery/pypi.pyi +0 -52
  79. stouputils-1.13.2/stouputils/parallel.pyi +0 -211
  80. stouputils-1.13.2/stouputils/stouputils/__init__.pyi +0 -15
  81. stouputils-1.13.2/stouputils/stouputils/_deprecated.pyi +0 -12
  82. stouputils-1.13.2/stouputils/stouputils/all_doctests.pyi +0 -46
  83. stouputils-1.13.2/stouputils/stouputils/applications/__init__.pyi +0 -2
  84. stouputils-1.13.2/stouputils/stouputils/applications/automatic_docs.pyi +0 -106
  85. stouputils-1.13.2/stouputils/stouputils/applications/upscaler/__init__.pyi +0 -3
  86. stouputils-1.13.2/stouputils/stouputils/applications/upscaler/config.pyi +0 -18
  87. stouputils-1.13.2/stouputils/stouputils/applications/upscaler/image.pyi +0 -109
  88. stouputils-1.13.2/stouputils/stouputils/applications/upscaler/video.pyi +0 -60
  89. stouputils-1.13.2/stouputils/stouputils/archive.pyi +0 -67
  90. stouputils-1.13.2/stouputils/stouputils/backup.pyi +0 -109
  91. stouputils-1.13.2/stouputils/stouputils/collections.pyi +0 -86
  92. stouputils-1.13.2/stouputils/stouputils/continuous_delivery/__init__.pyi +0 -5
  93. stouputils-1.13.2/stouputils/stouputils/continuous_delivery/cd_utils.pyi +0 -129
  94. stouputils-1.13.2/stouputils/stouputils/continuous_delivery/github.pyi +0 -162
  95. stouputils-1.13.2/stouputils/stouputils/continuous_delivery/pyproject.pyi +0 -67
  96. stouputils-1.13.2/stouputils/stouputils/continuous_delivery/stubs.pyi +0 -39
  97. stouputils-1.13.2/stouputils/stouputils/ctx.pyi +0 -211
  98. stouputils-1.13.2/stouputils/stouputils/decorators.pyi +0 -242
  99. stouputils-1.13.2/stouputils/stouputils/image.pyi +0 -172
  100. stouputils-1.13.2/stouputils/stouputils/installer/__init__.pyi +0 -5
  101. stouputils-1.13.2/stouputils/stouputils/installer/common.pyi +0 -39
  102. stouputils-1.13.2/stouputils/stouputils/installer/downloader.pyi +0 -24
  103. stouputils-1.13.2/stouputils/stouputils/installer/linux.pyi +0 -39
  104. stouputils-1.13.2/stouputils/stouputils/installer/main.pyi +0 -57
  105. stouputils-1.13.2/stouputils/stouputils/installer/windows.pyi +0 -31
  106. stouputils-1.13.2/stouputils/stouputils/io.pyi +0 -213
  107. stouputils-1.13.2/stouputils/stouputils/print.pyi +0 -136
  108. stouputils-1.13.2/stouputils/version_pkg.pyi +0 -15
  109. {stouputils-1.13.2 → stouputils-1.14.0}/README.md +0 -0
  110. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/__init__.py +0 -0
  111. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/__main__.py +0 -0
  112. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/_deprecated.py +0 -0
  113. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/all_doctests.py +0 -0
  114. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/applications/__init__.py +0 -0
  115. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/applications/automatic_docs.py +0 -0
  116. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/applications/upscaler/__init__.py +0 -0
  117. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/applications/upscaler/config.py +0 -0
  118. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/applications/upscaler/image.py +0 -0
  119. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/applications/upscaler/video.py +0 -0
  120. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/archive.py +0 -0
  121. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/backup.py +0 -0
  122. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/collections.py +0 -0
  123. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/continuous_delivery/__init__.py +0 -0
  124. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/continuous_delivery/cd_utils.py +0 -0
  125. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/continuous_delivery/github.py +0 -0
  126. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/continuous_delivery/pypi.py +0 -0
  127. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/continuous_delivery/pyproject.py +0 -0
  128. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/continuous_delivery/stubs.py +0 -0
  129. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/ctx.py +0 -0
  130. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/data_science/config/set.py +0 -0
  131. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/data_science/metric_utils.py +0 -0
  132. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/data_science/models/base_keras.py +0 -0
  133. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/data_science/models/model_interface.py +0 -0
  134. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/data_science/scripts/augment_dataset.py +0 -0
  135. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/data_science/scripts/exhaustive_process.py +0 -0
  136. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/data_science/scripts/preprocess_dataset.py +0 -0
  137. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/data_science/scripts/routine.py +0 -0
  138. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/image.py +0 -0
  139. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/installer/common.py +0 -0
  140. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/installer/downloader.py +0 -0
  141. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/io.py +0 -0
  142. {stouputils-1.13.2 → stouputils-1.14.0/stouputils}/stouputils/__init__.pyi +0 -0
  143. {stouputils-1.13.2 → stouputils-1.14.0/stouputils}/stouputils/_deprecated.pyi +0 -0
  144. {stouputils-1.13.2 → stouputils-1.14.0/stouputils}/stouputils/all_doctests.pyi +0 -0
  145. {stouputils-1.13.2 → stouputils-1.14.0/stouputils}/stouputils/applications/__init__.pyi +0 -0
  146. {stouputils-1.13.2 → stouputils-1.14.0/stouputils}/stouputils/applications/automatic_docs.pyi +0 -0
  147. {stouputils-1.13.2 → stouputils-1.14.0/stouputils}/stouputils/applications/upscaler/__init__.pyi +0 -0
  148. {stouputils-1.13.2 → stouputils-1.14.0/stouputils}/stouputils/applications/upscaler/config.pyi +0 -0
  149. {stouputils-1.13.2 → stouputils-1.14.0/stouputils}/stouputils/applications/upscaler/image.pyi +0 -0
  150. {stouputils-1.13.2 → stouputils-1.14.0/stouputils}/stouputils/applications/upscaler/video.pyi +0 -0
  151. {stouputils-1.13.2 → stouputils-1.14.0/stouputils}/stouputils/archive.pyi +0 -0
  152. {stouputils-1.13.2 → stouputils-1.14.0/stouputils}/stouputils/backup.pyi +0 -0
  153. {stouputils-1.13.2 → stouputils-1.14.0/stouputils}/stouputils/collections.pyi +0 -0
  154. {stouputils-1.13.2 → stouputils-1.14.0/stouputils}/stouputils/continuous_delivery/__init__.pyi +0 -0
  155. {stouputils-1.13.2 → stouputils-1.14.0/stouputils}/stouputils/continuous_delivery/cd_utils.pyi +0 -0
  156. {stouputils-1.13.2 → stouputils-1.14.0/stouputils}/stouputils/continuous_delivery/github.pyi +0 -0
  157. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/stouputils/continuous_delivery/pypi.pyi +0 -0
  158. {stouputils-1.13.2 → stouputils-1.14.0/stouputils}/stouputils/continuous_delivery/pyproject.pyi +0 -0
  159. {stouputils-1.13.2 → stouputils-1.14.0/stouputils}/stouputils/continuous_delivery/stubs.pyi +0 -0
  160. {stouputils-1.13.2 → stouputils-1.14.0/stouputils}/stouputils/ctx.pyi +0 -0
  161. {stouputils-1.13.2 → stouputils-1.14.0/stouputils}/stouputils/image.pyi +0 -0
  162. {stouputils-1.13.2 → stouputils-1.14.0/stouputils}/stouputils/installer/__init__.pyi +0 -0
  163. {stouputils-1.13.2 → stouputils-1.14.0/stouputils}/stouputils/installer/common.pyi +0 -0
  164. {stouputils-1.13.2 → stouputils-1.14.0/stouputils}/stouputils/installer/downloader.pyi +0 -0
  165. {stouputils-1.13.2 → stouputils-1.14.0/stouputils}/stouputils/installer/linux.pyi +0 -0
  166. {stouputils-1.13.2 → stouputils-1.14.0/stouputils}/stouputils/installer/main.pyi +0 -0
  167. {stouputils-1.13.2 → stouputils-1.14.0/stouputils}/stouputils/installer/windows.pyi +0 -0
  168. {stouputils-1.13.2 → stouputils-1.14.0/stouputils}/stouputils/io.pyi +0 -0
  169. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/stouputils/version_pkg.pyi +0 -0
  170. {stouputils-1.13.2 → stouputils-1.14.0}/stouputils/version_pkg.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: stouputils
3
- Version: 1.13.2
3
+ Version: 1.14.0
4
4
  Summary: Stouputils is a collection of utility modules designed to simplify and enhance the development process. It includes a range of tools for tasks such as execution of doctests, display utilities, decorators, as well as context managers, and many more.
5
5
  Keywords: utilities,tools,helpers,development,python
6
6
  Author: Stoupy51
@@ -1,102 +1,102 @@
1
-
2
- [build-system]
3
- requires = ["uv_build"]
4
- build-backend = "uv_build"
5
-
6
- [tool.uv.build-backend]
7
- module-root = ""
8
-
9
- [project]
10
- name = "stouputils"
11
- version = "1.13.2"
12
- description = "Stouputils is a collection of utility modules designed to simplify and enhance the development process. It includes a range of tools for tasks such as execution of doctests, display utilities, decorators, as well as context managers, and many more."
13
- readme = "README.md"
14
- keywords = ["utilities", "tools", "helpers", "development", "python"]
15
- requires-python = ">=3.12"
16
- classifiers = [
17
- "Programming Language :: Python :: 3",
18
- "Programming Language :: Python :: 3.12",
19
- "Programming Language :: Python :: 3.13",
20
- "Programming Language :: Python :: 3.14",
21
- "License :: OSI Approved :: MIT License",
22
- "Operating System :: OS Independent",
23
- ]
24
- dependencies = [
25
- "tqdm>=4.0.0",
26
- "requests>=2.20.0",
27
- "msgspec[toml,yaml]>=0.20.0",
28
- "pillow>=12.0.0",
29
- "python-box>=7.0.0",
30
- "argcomplete>=3.0.0",
31
- "numpy",
32
- ]
33
- authors = [
34
- { name = "Stoupy51", email = "stoupy51@gmail.com" },
35
- ]
36
-
37
- [project.optional-dependencies]
38
- docs = [
39
- "m2r2",
40
- "myst_parser",
41
- "sphinx_copybutton",
42
- "sphinx_design",
43
- "sphinx_treeview",
44
- "sphinx_breeze_theme",
45
- "pydata_sphinx_theme",
46
- ]
47
- data_science = [
48
- "opencv-python",
49
- "scikit-image",
50
- "simpleitk",
51
- "mlflow",
52
- "tensorflow",
53
- "scikit-learn",
54
- "PyWavelets",
55
- ]
56
-
57
- [project.urls]
58
- Homepage = "https://stoupy51.github.io/stouputils"
59
- Issues = "https://github.com/Stoupy51/stouputils/issues"
60
- Source = "https://github.com/Stoupy51/stouputils"
61
-
62
- [project.scripts]
63
- stouputils = "stouputils.__main__:main"
64
-
65
- [tool.pyright]
66
- typeCheckingMode = "strict"
67
-
68
- [tool.ruff]
69
- exclude = [
70
- ".git",
71
- ".ruff_cache",
72
- ".venv",
73
- ".vscode",
74
- ".cursor",
75
- "build",
76
- "dist",
77
- "*.pyi",
78
- ]
79
- line-length = 200
80
-
81
- [tool.ruff.lint]
82
- select = [
83
- "E",
84
- "W",
85
- "F",
86
- "I",
87
- "N",
88
- "UP",
89
- "B",
90
- "C4",
91
- "T20",
92
- "RUF",
93
- ]
94
- ignore = [
95
- "T201",
96
- "W191",
97
- "N803",
98
- "N806",
99
- "F403",
100
- "F405",
101
- ]
102
-
1
+
2
+ [build-system]
3
+ requires = ["uv_build"]
4
+ build-backend = "uv_build"
5
+
6
+ [tool.uv.build-backend]
7
+ module-root = ""
8
+
9
+ [project]
10
+ name = "stouputils"
11
+ version = "1.14.0"
12
+ description = "Stouputils is a collection of utility modules designed to simplify and enhance the development process. It includes a range of tools for tasks such as execution of doctests, display utilities, decorators, as well as context managers, and many more."
13
+ readme = "README.md"
14
+ keywords = ["utilities", "tools", "helpers", "development", "python"]
15
+ requires-python = ">=3.12"
16
+ classifiers = [
17
+ "Programming Language :: Python :: 3",
18
+ "Programming Language :: Python :: 3.12",
19
+ "Programming Language :: Python :: 3.13",
20
+ "Programming Language :: Python :: 3.14",
21
+ "License :: OSI Approved :: MIT License",
22
+ "Operating System :: OS Independent",
23
+ ]
24
+ dependencies = [
25
+ "tqdm>=4.0.0",
26
+ "requests>=2.20.0",
27
+ "msgspec[toml,yaml]>=0.20.0",
28
+ "pillow>=12.0.0",
29
+ "python-box>=7.0.0",
30
+ "argcomplete>=3.0.0",
31
+ "numpy",
32
+ ]
33
+ authors = [
34
+ { name = "Stoupy51", email = "stoupy51@gmail.com" },
35
+ ]
36
+
37
+ [project.optional-dependencies]
38
+ docs = [
39
+ "m2r2",
40
+ "myst_parser",
41
+ "sphinx_copybutton",
42
+ "sphinx_design",
43
+ "sphinx_treeview",
44
+ "sphinx_breeze_theme",
45
+ "pydata_sphinx_theme",
46
+ ]
47
+ data_science = [
48
+ "opencv-python",
49
+ "scikit-image",
50
+ "simpleitk",
51
+ "mlflow",
52
+ "tensorflow",
53
+ "scikit-learn",
54
+ "PyWavelets",
55
+ ]
56
+
57
+ [project.urls]
58
+ Homepage = "https://stoupy51.github.io/stouputils"
59
+ Issues = "https://github.com/Stoupy51/stouputils/issues"
60
+ Source = "https://github.com/Stoupy51/stouputils"
61
+
62
+ [project.scripts]
63
+ stouputils = "stouputils.__main__:main"
64
+
65
+ [tool.pyright]
66
+ typeCheckingMode = "strict"
67
+
68
+ [tool.ruff]
69
+ exclude = [
70
+ ".git",
71
+ ".ruff_cache",
72
+ ".venv",
73
+ ".vscode",
74
+ ".cursor",
75
+ "build",
76
+ "dist",
77
+ "*.pyi",
78
+ ]
79
+ line-length = 200
80
+
81
+ [tool.ruff.lint]
82
+ select = [
83
+ "E",
84
+ "W",
85
+ "F",
86
+ "I",
87
+ "N",
88
+ "UP",
89
+ "B",
90
+ "C4",
91
+ "T20",
92
+ "RUF",
93
+ ]
94
+ ignore = [
95
+ "T201",
96
+ "W191",
97
+ "N803",
98
+ "N806",
99
+ "F403",
100
+ "F405",
101
+ ]
102
+
@@ -1,51 +1,51 @@
1
- """ Load configuration from the set.py file and handle some special cases.
2
-
3
- Proper way to get the configuration is by importing this module, not the set.py file directly.
4
- """
5
-
6
- # pyright: reportUnknownMemberType=false
7
- # pyright: reportUnknownVariableType=false
8
- # pyright: reportMissingTypeStubs=false
9
-
10
- # Imports
11
- import os
12
- from typing import Any
13
-
14
- from .set import DataScienceConfig
15
-
16
- # Special cases
17
- # Hide GPU when using CPU
18
- if DataScienceConfig.TENSORFLOW_DEVICE.lower().startswith("/cpu"):
19
- os.environ["CUDA_VISIBLE_DEVICES"] = "-1"
20
-
21
- # Precise which GPU we use
22
- elif DataScienceConfig.TENSORFLOW_DEVICE.lower().startswith("/gpu"):
23
- os.environ["CUDA_VISIBLE_DEVICES"] = DataScienceConfig.TENSORFLOW_DEVICE.split(":")[-1]
24
-
25
- # Configure TensorFlow (if available)
26
- try:
27
- from tensorflow import config as tf_config
28
-
29
- # Get the physical devices
30
- physical_devices: list[Any] = tf_config.list_physical_devices("GPU")
31
-
32
- # Configure TensorFlow GPU memory management to allocate memory dynamically
33
- # This prevents TensorFlow from allocating all GPU memory upfront
34
- # Instead, memory will grow as needed, allowing better resource sharing
35
- for device in physical_devices:
36
- tf_config.experimental.set_memory_growth(device, True)
37
-
38
- # Disable eager execution mode in TensorFlow
39
- # This improves performance by allowing TensorFlow to create an optimized graph
40
- # of operations instead of executing operations one by one (at the cost of debugging difficulty)
41
- tf_config.run_functions_eagerly(False)
42
- except ImportError:
43
- pass
44
-
45
- # Enable mixed precision training (if available)
46
- try:
47
- from keras import mixed_precision
48
- mixed_precision.set_global_policy(DataScienceConfig.MIXED_PRECISION_POLICY)
49
- except ImportError:
50
- pass
51
-
1
+ """ Load configuration from the set.py file and handle some special cases.
2
+
3
+ Proper way to get the configuration is by importing this module, not the set.py file directly.
4
+ """
5
+
6
+ # pyright: reportUnknownMemberType=false
7
+ # pyright: reportUnknownVariableType=false
8
+ # pyright: reportMissingTypeStubs=false
9
+
10
+ # Imports
11
+ import os
12
+ from typing import Any
13
+
14
+ from .set import DataScienceConfig
15
+
16
+ # Special cases
17
+ # Hide GPU when using CPU
18
+ if DataScienceConfig.TENSORFLOW_DEVICE.lower().startswith("/cpu"):
19
+ os.environ["CUDA_VISIBLE_DEVICES"] = "-1"
20
+
21
+ # Precise which GPU we use
22
+ elif DataScienceConfig.TENSORFLOW_DEVICE.lower().startswith("/gpu"):
23
+ os.environ["CUDA_VISIBLE_DEVICES"] = DataScienceConfig.TENSORFLOW_DEVICE.split(":")[-1]
24
+
25
+ # Configure TensorFlow (if available)
26
+ try:
27
+ from tensorflow import config as tf_config
28
+
29
+ # Get the physical devices
30
+ physical_devices: list[Any] = tf_config.list_physical_devices("GPU")
31
+
32
+ # Configure TensorFlow GPU memory management to allocate memory dynamically
33
+ # This prevents TensorFlow from allocating all GPU memory upfront
34
+ # Instead, memory will grow as needed, allowing better resource sharing
35
+ for device in physical_devices:
36
+ tf_config.experimental.set_memory_growth(device, True)
37
+
38
+ # Disable eager execution mode in TensorFlow
39
+ # This improves performance by allowing TensorFlow to create an optimized graph
40
+ # of operations instead of executing operations one by one (at the cost of debugging difficulty)
41
+ tf_config.run_functions_eagerly(False)
42
+ except ImportError:
43
+ pass
44
+
45
+ # Enable mixed precision training (if available)
46
+ try:
47
+ from keras import mixed_precision
48
+ mixed_precision.set_global_policy(DataScienceConfig.MIXED_PRECISION_POLICY)
49
+ except ImportError:
50
+ pass
51
+
@@ -1,66 +1,66 @@
1
-
2
- # Imports
3
- from .auto_contrast import auto_contrast_image
4
- from .axis_flip import flip_image
5
- from .bias_field_correction import bias_field_correction_image
6
- from .binary_threshold import binary_threshold_image
7
- from .blur import blur_image
8
- from .brightness import brightness_image
9
- from .canny import canny_image
10
- from .clahe import clahe_image
11
- from .contrast import contrast_image
12
- from .curvature_flow_filter import curvature_flow_filter_image
13
- from .denoise import (
14
- adaptive_denoise_image,
15
- bilateral_denoise_image,
16
- nlm_denoise_image,
17
- tv_denoise_image,
18
- wavelet_denoise_image,
19
- )
20
- from .invert import invert_image
21
- from .laplacian import laplacian_image
22
- from .median_blur import median_blur_image
23
- from .noise import noise_image
24
- from .normalize import normalize_image
25
- from .random_erase import random_erase_image
26
- from .resize import resize_image
27
- from .rotation import rotate_image
28
- from .salt_pepper import salt_pepper_image
29
- from .sharpening import sharpen_image
30
- from .shearing import shear_image
31
- from .threshold import threshold_image
32
- from .translation import translate_image
33
- from .zoom import zoom_image
34
-
35
- __all__ = [
36
- "adaptive_denoise_image",
37
- "auto_contrast_image",
38
- "bias_field_correction_image",
39
- "bilateral_denoise_image",
40
- "binary_threshold_image",
41
- "blur_image",
42
- "brightness_image",
43
- "canny_image",
44
- "clahe_image",
45
- "contrast_image",
46
- "curvature_flow_filter_image",
47
- "flip_image",
48
- "invert_image",
49
- "laplacian_image",
50
- "median_blur_image",
51
- "nlm_denoise_image",
52
- "noise_image",
53
- "normalize_image",
54
- "random_erase_image",
55
- "resize_image",
56
- "rotate_image",
57
- "salt_pepper_image",
58
- "sharpen_image",
59
- "shear_image",
60
- "threshold_image",
61
- "translate_image",
62
- "tv_denoise_image",
63
- "wavelet_denoise_image",
64
- "zoom_image",
65
- ]
66
-
1
+
2
+ # Imports
3
+ from .auto_contrast import auto_contrast_image
4
+ from .axis_flip import flip_image
5
+ from .bias_field_correction import bias_field_correction_image
6
+ from .binary_threshold import binary_threshold_image
7
+ from .blur import blur_image
8
+ from .brightness import brightness_image
9
+ from .canny import canny_image
10
+ from .clahe import clahe_image
11
+ from .contrast import contrast_image
12
+ from .curvature_flow_filter import curvature_flow_filter_image
13
+ from .denoise import (
14
+ adaptive_denoise_image,
15
+ bilateral_denoise_image,
16
+ nlm_denoise_image,
17
+ tv_denoise_image,
18
+ wavelet_denoise_image,
19
+ )
20
+ from .invert import invert_image
21
+ from .laplacian import laplacian_image
22
+ from .median_blur import median_blur_image
23
+ from .noise import noise_image
24
+ from .normalize import normalize_image
25
+ from .random_erase import random_erase_image
26
+ from .resize import resize_image
27
+ from .rotation import rotate_image
28
+ from .salt_pepper import salt_pepper_image
29
+ from .sharpening import sharpen_image
30
+ from .shearing import shear_image
31
+ from .threshold import threshold_image
32
+ from .translation import translate_image
33
+ from .zoom import zoom_image
34
+
35
+ __all__ = [
36
+ "adaptive_denoise_image",
37
+ "auto_contrast_image",
38
+ "bias_field_correction_image",
39
+ "bilateral_denoise_image",
40
+ "binary_threshold_image",
41
+ "blur_image",
42
+ "brightness_image",
43
+ "canny_image",
44
+ "clahe_image",
45
+ "contrast_image",
46
+ "curvature_flow_filter_image",
47
+ "flip_image",
48
+ "invert_image",
49
+ "laplacian_image",
50
+ "median_blur_image",
51
+ "nlm_denoise_image",
52
+ "noise_image",
53
+ "normalize_image",
54
+ "random_erase_image",
55
+ "resize_image",
56
+ "rotate_image",
57
+ "salt_pepper_image",
58
+ "sharpen_image",
59
+ "shear_image",
60
+ "threshold_image",
61
+ "translate_image",
62
+ "tv_denoise_image",
63
+ "wavelet_denoise_image",
64
+ "zoom_image",
65
+ ]
66
+
@@ -1,79 +1,79 @@
1
-
2
- # pyright: reportUnusedImport=false
3
- # ruff: noqa: F401
4
-
5
- # Imports
6
- from .common import Any, NDArray, check_image, cv2, np
7
-
8
-
9
- # Functions
10
- def auto_contrast_image(image: NDArray[Any], ignore_dtype: bool = False) -> NDArray[Any]:
11
- """ Adjust the contrast of an image.
12
-
13
- Args:
14
- image (NDArray[Any]): Image to adjust contrast
15
- ignore_dtype (bool): Ignore the dtype check
16
- Returns:
17
- NDArray[Any]: Image with adjusted contrast
18
-
19
- >>> ## Basic tests
20
- >>> image = np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]], dtype=np.uint8)
21
- >>> adjusted = auto_contrast_image(image)
22
- >>> adjusted.tolist()
23
- [[0, 36, 73], [109, 146, 182], [219, 255, 255]]
24
- >>> adjusted.shape == image.shape
25
- True
26
- >>> adjusted.dtype == image.dtype
27
- True
28
-
29
- >>> ## Test invalid inputs
30
- >>> auto_contrast_image("not an image")
31
- Traceback (most recent call last):
32
- ...
33
- AssertionError: Image must be a numpy array
34
- """
35
- # Check input data
36
- check_image(image, ignore_dtype=ignore_dtype)
37
-
38
- # Perform histogram clipping
39
- clip_hist_percent: float = 1.0
40
-
41
- # Calculate the histogram of the image
42
- hist: NDArray[Any] = cv2.calcHist([image], [0], None, [256], [0, 256])
43
-
44
- # Create an accumulator list to store the cumulative histogram
45
- accumulator: list[float] = []
46
- accumulator.append(hist[0])
47
- for i in range(1, 256):
48
- accumulator.append(accumulator[i - 1] + hist[i])
49
-
50
- # Find the maximum value in the accumulator
51
- max_value: float = accumulator[-1]
52
-
53
- # Calculate the clipping threshold
54
- clip_hist_percent = clip_hist_percent * (max_value / 100.0)
55
- clip_hist_percent = clip_hist_percent / 2.0
56
-
57
- # Find the minimum and maximum gray levels after clipping
58
- min_gray: int = 0
59
- while accumulator[min_gray] < clip_hist_percent:
60
- min_gray = min_gray + 1
61
- max_gray: int = 256 - 1
62
- while (max_gray >= 0 and accumulator[max_gray] >= (max_value - clip_hist_percent)):
63
- max_gray = max_gray - 1
64
-
65
- # Calculate the input range after clipping
66
- input_range: int = max_gray - min_gray
67
-
68
- # If the input range is 0, return the original image
69
- if input_range == 0:
70
- return image
71
-
72
- # Calculate the scaling factors for contrast adjustment
73
- alpha: float = (256 - 1) / input_range
74
- beta: float = -min_gray * alpha
75
-
76
- # Apply the contrast adjustment
77
- adjusted: NDArray[Any] = cv2.convertScaleAbs(image, alpha=alpha, beta=beta)
78
- return adjusted
79
-
1
+
2
+ # pyright: reportUnusedImport=false
3
+ # ruff: noqa: F401
4
+
5
+ # Imports
6
+ from .common import Any, NDArray, check_image, cv2, np
7
+
8
+
9
+ # Functions
10
+ def auto_contrast_image(image: NDArray[Any], ignore_dtype: bool = False) -> NDArray[Any]:
11
+ """ Adjust the contrast of an image.
12
+
13
+ Args:
14
+ image (NDArray[Any]): Image to adjust contrast
15
+ ignore_dtype (bool): Ignore the dtype check
16
+ Returns:
17
+ NDArray[Any]: Image with adjusted contrast
18
+
19
+ >>> ## Basic tests
20
+ >>> image = np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]], dtype=np.uint8)
21
+ >>> adjusted = auto_contrast_image(image)
22
+ >>> adjusted.tolist()
23
+ [[0, 36, 73], [109, 146, 182], [219, 255, 255]]
24
+ >>> adjusted.shape == image.shape
25
+ True
26
+ >>> adjusted.dtype == image.dtype
27
+ True
28
+
29
+ >>> ## Test invalid inputs
30
+ >>> auto_contrast_image("not an image")
31
+ Traceback (most recent call last):
32
+ ...
33
+ AssertionError: Image must be a numpy array
34
+ """
35
+ # Check input data
36
+ check_image(image, ignore_dtype=ignore_dtype)
37
+
38
+ # Perform histogram clipping
39
+ clip_hist_percent: float = 1.0
40
+
41
+ # Calculate the histogram of the image
42
+ hist: NDArray[Any] = cv2.calcHist([image], [0], None, [256], [0, 256])
43
+
44
+ # Create an accumulator list to store the cumulative histogram
45
+ accumulator: list[float] = []
46
+ accumulator.append(hist[0])
47
+ for i in range(1, 256):
48
+ accumulator.append(accumulator[i - 1] + hist[i])
49
+
50
+ # Find the maximum value in the accumulator
51
+ max_value: float = accumulator[-1]
52
+
53
+ # Calculate the clipping threshold
54
+ clip_hist_percent = clip_hist_percent * (max_value / 100.0)
55
+ clip_hist_percent = clip_hist_percent / 2.0
56
+
57
+ # Find the minimum and maximum gray levels after clipping
58
+ min_gray: int = 0
59
+ while accumulator[min_gray] < clip_hist_percent:
60
+ min_gray = min_gray + 1
61
+ max_gray: int = 256 - 1
62
+ while (max_gray >= 0 and accumulator[max_gray] >= (max_value - clip_hist_percent)):
63
+ max_gray = max_gray - 1
64
+
65
+ # Calculate the input range after clipping
66
+ input_range: int = max_gray - min_gray
67
+
68
+ # If the input range is 0, return the original image
69
+ if input_range == 0:
70
+ return image
71
+
72
+ # Calculate the scaling factors for contrast adjustment
73
+ alpha: float = (256 - 1) / input_range
74
+ beta: float = -min_gray * alpha
75
+
76
+ # Apply the contrast adjustment
77
+ adjusted: NDArray[Any] = cv2.convertScaleAbs(image, alpha=alpha, beta=beta)
78
+ return adjusted
79
+