imicpe 0.0.9__tar.gz → 0.0.9.6__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.
@@ -6,24 +6,25 @@ Developped and maintained for teaching usage only!
6
6
 
7
7
  ## In a Jupyter Notebook
8
8
 
9
- ```!pip install -i https://test.pypi.org/simple/ -U imicpe```
9
+ ```!pip install -U imicpe```
10
10
 
11
11
  ## In a local environment
12
12
 
13
- ```pip install -i https://test.pypi.org/simple/ -U imicpe```
13
+ ```pip install -U imicpe```
14
14
 
15
15
  # Usage example
16
16
 
17
- The example below uses the kurtosis method available in the `tsa` subpackage of `msicpe`.
17
+ The example below uses the mse method available in the `optim.metrics` subpackage of `imicpe`.
18
18
  It requires `numpy.randn` to generate a gaussian distribution of N points.
19
19
 
20
20
  ```python
21
21
  import numpy as np
22
- from msicpe.tsa import kurtosis
22
+ from imicpe.optim import metrics
23
23
  N=10000
24
24
 
25
- x=np.randn(1,N)
26
- kurt=kurtosis(x)
25
+ x=np.random.randn(1,N)
26
+ ref = np.zeros((1,N))
27
+ mse=metrics.mse(x,ref)
27
28
 
28
- print(kurt)
29
+ print(mse)
29
30
  ```
@@ -1,17 +1,23 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: imicpe
3
- Version: 0.0.9
3
+ Version: 0.0.9.6
4
4
  Summary: Toolbox for Maths,Signal,Image Teaching @ CPE
5
5
  Author-email: Marion Foare <marion.foare@cpe.fr>, Eric Van Reeth <eric.vanreeth@cpe.fr>, Arthur Gautheron <arthur.gautheron@cpe.fr>
6
6
  License: MIT License
7
7
  Project-URL: Homepage, https://www.cpe.fr
8
- Project-URL: Documentation, https://toolbox-imi-cpe-msi-1bcfcdd75992c038486502447f7f6937f3492f60127.pages.in2p3.fr/
8
+ Project-URL: Documentation, https://cpe.pages.in2p3.fr/msi/toolbox_imi/
9
9
  Classifier: Programming Language :: Python :: 3
10
10
  Classifier: License :: OSI Approved :: MIT License
11
11
  Classifier: Operating System :: OS Independent
12
12
  Requires-Python: >=3.8
13
13
  Description-Content-Type: text/markdown
14
14
  License-File: LICENSE
15
+ Requires-Dist: numpy
16
+ Requires-Dist: scipy
17
+ Requires-Dist: plotly
18
+ Requires-Dist: torch
19
+ Requires-Dist: torchvision
20
+ Requires-Dist: tqdm
15
21
 
16
22
 
17
23
  A toolbox used for practical sessions at [CPE Lyon](https://www.cpe.fr/).
@@ -21,24 +27,25 @@ Developped and maintained for teaching usage only!
21
27
 
22
28
  ## In a Jupyter Notebook
23
29
 
24
- ```!pip install -i https://test.pypi.org/simple/ -U imicpe```
30
+ ```!pip install -U imicpe```
25
31
 
26
32
  ## In a local environment
27
33
 
28
- ```pip install -i https://test.pypi.org/simple/ -U imicpe```
34
+ ```pip install -U imicpe```
29
35
 
30
36
  # Usage example
31
37
 
32
- The example below uses the kurtosis method available in the `tsa` subpackage of `msicpe`.
38
+ The example below uses the mse method available in the `optim.metrics` subpackage of `imicpe`.
33
39
  It requires `numpy.randn` to generate a gaussian distribution of N points.
34
40
 
35
41
  ```python
36
42
  import numpy as np
37
- from msicpe.tsa import kurtosis
43
+ from imicpe.optim import metrics
38
44
  N=10000
39
45
 
40
- x=np.randn(1,N)
41
- kurt=kurtosis(x)
46
+ x=np.random.randn(1,N)
47
+ ref = np.zeros((1,N))
48
+ mse=metrics.mse(x,ref)
42
49
 
43
- print(kurt)
50
+ print(mse)
44
51
  ```
@@ -14,7 +14,7 @@ mypkg = ["*.txt", "*.mat"]
14
14
  #[tool.setuptools_scm]
15
15
 
16
16
  [project]
17
- version="0.0.9"
17
+ version="0.0.9.6"
18
18
  name = "imicpe"
19
19
  authors = [
20
20
  { name="Marion Foare", email="marion.foare@cpe.fr" },
@@ -25,6 +25,14 @@ description = "Toolbox for Maths,Signal,Image Teaching @ CPE"
25
25
  readme = {file = "DESCRIPTION.md", content-type = "text/markdown"}
26
26
  license = {text = "MIT License"}
27
27
  requires-python = ">=3.8"
28
+ dependencies = [
29
+ "numpy",
30
+ "scipy",
31
+ "plotly",
32
+ "torch",
33
+ "torchvision",
34
+ "tqdm",
35
+ ]
28
36
  classifiers = [
29
37
  "Programming Language :: Python :: 3",
30
38
  "License :: OSI Approved :: MIT License",
@@ -33,4 +41,4 @@ classifiers = [
33
41
 
34
42
  [project.urls]
35
43
  Homepage = "https://www.cpe.fr"
36
- Documentation = "https://toolbox-imi-cpe-msi-1bcfcdd75992c038486502447f7f6937f3492f60127.pages.in2p3.fr/"
44
+ Documentation = "https://cpe.pages.in2p3.fr/msi/toolbox_imi/"
@@ -0,0 +1 @@
1
+ from ._version import __version__
@@ -0,0 +1 @@
1
+ __version__="0.0.9.6"
@@ -1,5 +1,5 @@
1
1
  from .metrics import mse, snr
2
- from .operators import Id, D, Dt, L, Lt, generateDiff3D, generatePSF, A, At, S, St, opNorm, matNorm
2
+ from .operators import Id, D, Dt, L, Lt, generatePSF, A, At, S, St, opNorm, matNorm
3
3
  from .pnnDataset import BSDSDataset, NoisyDataset
4
4
  from .pnnTrainer import Trainer, Metrics
5
5
  from .pnnUtils import chooseDevice, torchImg2Numpy, getData
@@ -1,18 +1,15 @@
1
-
2
1
  import numpy as np
3
2
  from scipy import ndimage
4
- import igl
3
+ #import igl
5
4
 
6
5
  ############################################################
7
6
  ## identity operator
8
7
  ############################################################
9
8
  def Id(x):
10
- """
11
- Id Opérateur identité
9
+ """Opérateur identité
12
10
 
13
11
  Args:
14
- X (numpy.ndarray) signal 1D
15
- ou: image non vectorisée 2D
12
+ X (numpy.ndarray) signal 1D ou: image non vectorisée 2D
16
13
 
17
14
  Returns:
18
15
  (numpy.ndarray) X
@@ -26,8 +23,7 @@ def Id(x):
26
23
  ############################################################
27
24
  # gradient
28
25
  def D(x):
29
- """
30
- D Calcule le gradient par différences finies à droite.
26
+ """Calcule le gradient par différences finies à droite.
31
27
  Autrement dit, D(x) calcule le produit matriciel Dx.
32
28
 
33
29
  Args:
@@ -50,8 +46,7 @@ def D(x):
50
46
  return grad
51
47
 
52
48
  def Dt(x):
53
- """
54
- Dt Calcule l’adjoint gradient par différences finies à droite.
49
+ """Calcule l’adjoint gradient par différences finies à droite.
55
50
  Autrement dit, Dt(x) calcule le produit matriciel D'x.
56
51
 
57
52
  Args:
@@ -74,8 +69,7 @@ def Dt(x):
74
69
 
75
70
  # laplacian
76
71
  def L(x):
77
- """
78
- L Calcule la dérivée seconde d’un signal, ou le laplacien dans le cas d’une image.
72
+ """Calcule la dérivée seconde d’un signal, ou le laplacien dans le cas d’une image.
79
73
  Autrement dit, L(x) calcule le produit matriciel Lx.
80
74
 
81
75
  Args:
@@ -97,8 +91,7 @@ def L(x):
97
91
  return lap
98
92
 
99
93
  def Lt(x):
100
- """
101
- Lt Calcule l’adjoint du laplacien.
94
+ """Calcule l’adjoint du laplacien.
102
95
  Autrement dit, Lt(x) calcule le produit matriciel L'x.
103
96
 
104
97
  Args:
@@ -119,27 +112,26 @@ def Lt(x):
119
112
  lap = ndimage.correlate(x,ker,mode='nearest')
120
113
  return lap
121
114
 
122
- def generateDiff3D(vert, faces, dtype):
123
- """
124
- generateDiff3D Génère la matrice de différentiation de type DTYPE (ordre 1 ou 2) en 3D
115
+ # def generateDiff3D(vert, faces, dtype):
116
+ # """Génère la matrice de différentiation de type DTYPE (ordre 1 ou 2) en 3D
125
117
 
126
- Args:
127
- VERT (numpy.ndarray) matrice Nx3 dont la i-ème ligne correspond au vecteur
128
- de coordonnées (X,Y,Z) du i-ème point du maillage
129
- FACES (numpy.ndarray) matrice Nx3 dont la i-ème ligne donne les numéros des
130
- 3 points composant un triangle du maillage
131
- DTYPE(str) 'gradient', 'laplacian'
118
+ # Args:
119
+ # VERT (numpy.ndarray) matrice Nx3 dont la i-ème ligne correspond au vecteur
120
+ # de coordonnées (X,Y,Z) du i-ème point du maillage
121
+ # FACES (numpy.ndarray) matrice Nx3 dont la i-ème ligne donne les numéros des
122
+ # 3 points composant un triangle du maillage
123
+ # DTYPE(str) 'gradient', 'laplacian'
132
124
 
133
- Returns:
134
- (numpy.ndarray) matrice 3D de différentiation de type DTYPE
135
- """
125
+ # Returns:
126
+ # (numpy.ndarray) matrice 3D de différentiation de type DTYPE
127
+ # """
136
128
 
137
- if dtype == 'gradient':
138
- matG = igl.grad(vert, faces)
139
- elif dtype == 'laplacien':
140
- matG = igl.cotmatrix(vert, faces)
129
+ # if dtype == 'gradient':
130
+ # matG = igl.grad(vert, faces)
131
+ # elif dtype == 'laplacien':
132
+ # matG = igl.cotmatrix(vert, faces)
141
133
 
142
- return (matG/np.amax(matG)).toarray()
134
+ # return (matG/np.amax(matG)).toarray()
143
135
 
144
136
 
145
137
 
@@ -147,8 +139,7 @@ def generateDiff3D(vert, faces, dtype):
147
139
  ## blurring operators
148
140
  ############################################################
149
141
  def generatePSF(dim,blurtype,kernelSize):
150
- """
151
- generatePSF Génère le noyau de convolution d’un flou de dimension DIM, de type BLURTYPE,
142
+ """Génère le noyau de convolution d’un flou de dimension DIM, de type BLURTYPE,
152
143
  et de taille KERNELSIZE.
153
144
 
154
145
  Args:
@@ -187,8 +178,7 @@ def generatePSF(dim,blurtype,kernelSize):
187
178
  return ker
188
179
 
189
180
  def A(x,psf):
190
- """
191
- A Permet de flouter l’image X par un flou de noyau PSF.
181
+ """Permet de flouter l’image X par un flou de noyau PSF.
192
182
  Autrement dit, A(x,h) calcule le produit de convolution h*x, ou de manière équivalente, calcule
193
183
  le produit matriciel Hx.
194
184
 
@@ -209,8 +199,7 @@ def A(x,psf):
209
199
  return b
210
200
 
211
201
  def At(x,psf):
212
- """
213
- At Permet de flouter l’image X par un flou de noyau la transposée de PSF.
202
+ """Permet de flouter l’image X par un flou de noyau la transposée de PSF.
214
203
  Autrement dit, A(x,h) calcule le produit de convolution h'*x, ou de manière équivalente, calcule
215
204
  le produit matriciel H'x.
216
205
 
@@ -236,8 +225,7 @@ def At(x,psf):
236
225
  ## TP3 - cartoon + texture decomposition operators (only 2D)
237
226
  ############################################################
238
227
  def S(x):
239
- """
240
- S Convolue X avec un noyau KER.
228
+ """Convolue X avec un noyau KER.
241
229
 
242
230
  Args:
243
231
  X (numpy.ndarray) image non vectorisée 2D
@@ -261,8 +249,7 @@ def S(x):
261
249
  return imf
262
250
 
263
251
  def St(x):
264
- """
265
- S Corrèle X avec un noyau KER.
252
+ """Corrèle X avec un noyau KER.
266
253
 
267
254
  Args:
268
255
  X (numpy.ndarray) image non vectorisée 2D
@@ -291,8 +278,7 @@ def St(x):
291
278
  ## Operator and matrix norm
292
279
  ############################################################
293
280
  def opNorm(op,opt,dim):
294
- """
295
- opNorm Calcule la norme de l'opérateur OP, dont
281
+ """Calcule la norme de l'opérateur OP, dont
296
282
  l'opérateur transposé est OPT, en dimension DIM
297
283
 
298
284
  Args:
@@ -334,8 +320,7 @@ def opNorm(op,opt,dim):
334
320
 
335
321
 
336
322
  def matNorm(M):
337
- """
338
- matNorm Calcule la norme de la matrice M
323
+ """Calcule la norme de la matrice M
339
324
 
340
325
  Args:
341
326
  M (numpy.ndarray) matrice dont on souhaite calculer la norme
@@ -1,17 +1,23 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: imicpe
3
- Version: 0.0.9
3
+ Version: 0.0.9.6
4
4
  Summary: Toolbox for Maths,Signal,Image Teaching @ CPE
5
5
  Author-email: Marion Foare <marion.foare@cpe.fr>, Eric Van Reeth <eric.vanreeth@cpe.fr>, Arthur Gautheron <arthur.gautheron@cpe.fr>
6
6
  License: MIT License
7
7
  Project-URL: Homepage, https://www.cpe.fr
8
- Project-URL: Documentation, https://toolbox-imi-cpe-msi-1bcfcdd75992c038486502447f7f6937f3492f60127.pages.in2p3.fr/
8
+ Project-URL: Documentation, https://cpe.pages.in2p3.fr/msi/toolbox_imi/
9
9
  Classifier: Programming Language :: Python :: 3
10
10
  Classifier: License :: OSI Approved :: MIT License
11
11
  Classifier: Operating System :: OS Independent
12
12
  Requires-Python: >=3.8
13
13
  Description-Content-Type: text/markdown
14
14
  License-File: LICENSE
15
+ Requires-Dist: numpy
16
+ Requires-Dist: scipy
17
+ Requires-Dist: plotly
18
+ Requires-Dist: torch
19
+ Requires-Dist: torchvision
20
+ Requires-Dist: tqdm
15
21
 
16
22
 
17
23
  A toolbox used for practical sessions at [CPE Lyon](https://www.cpe.fr/).
@@ -21,24 +27,25 @@ Developped and maintained for teaching usage only!
21
27
 
22
28
  ## In a Jupyter Notebook
23
29
 
24
- ```!pip install -i https://test.pypi.org/simple/ -U imicpe```
30
+ ```!pip install -U imicpe```
25
31
 
26
32
  ## In a local environment
27
33
 
28
- ```pip install -i https://test.pypi.org/simple/ -U imicpe```
34
+ ```pip install -U imicpe```
29
35
 
30
36
  # Usage example
31
37
 
32
- The example below uses the kurtosis method available in the `tsa` subpackage of `msicpe`.
38
+ The example below uses the mse method available in the `optim.metrics` subpackage of `imicpe`.
33
39
  It requires `numpy.randn` to generate a gaussian distribution of N points.
34
40
 
35
41
  ```python
36
42
  import numpy as np
37
- from msicpe.tsa import kurtosis
43
+ from imicpe.optim import metrics
38
44
  N=10000
39
45
 
40
- x=np.randn(1,N)
41
- kurt=kurtosis(x)
46
+ x=np.random.randn(1,N)
47
+ ref = np.zeros((1,N))
48
+ mse=metrics.mse(x,ref)
42
49
 
43
- print(kurt)
50
+ print(mse)
44
51
  ```
@@ -3,9 +3,11 @@ LICENSE
3
3
  README.md
4
4
  pyproject.toml
5
5
  src/imicpe/__init__.py
6
+ src/imicpe/_version.py
6
7
  src/imicpe.egg-info/PKG-INFO
7
8
  src/imicpe.egg-info/SOURCES.txt
8
9
  src/imicpe.egg-info/dependency_links.txt
10
+ src/imicpe.egg-info/requires.txt
9
11
  src/imicpe.egg-info/top_level.txt
10
12
  src/imicpe/optim/__init__.py
11
13
  src/imicpe/optim/metrics.py
@@ -0,0 +1,6 @@
1
+ numpy
2
+ scipy
3
+ plotly
4
+ torch
5
+ torchvision
6
+ tqdm
File without changes
File without changes
File without changes
File without changes