summaryrefslogtreecommitdiffstats
path: root/Wrappers/Python/conda-recipe
diff options
context:
space:
mode:
authoralgol <dkazanc@hotmail.com>2018-04-12 11:56:54 +0100
committeralgol <dkazanc@hotmail.com>2018-04-12 11:56:54 +0100
commit22f6e22cbe6db04c6bbe8d259ce761e3748d7102 (patch)
tree225dcf0db9dc7e0f0fc5fc001a7efb14c19658f8 /Wrappers/Python/conda-recipe
parent58f5ce047b063d53906e38047b6ae744ccdbd4eb (diff)
downloadregularization-22f6e22cbe6db04c6bbe8d259ce761e3748d7102.tar.gz
regularization-22f6e22cbe6db04c6bbe8d259ce761e3748d7102.tar.bz2
regularization-22f6e22cbe6db04c6bbe8d259ce761e3748d7102.tar.xz
regularization-22f6e22cbe6db04c6bbe8d259ce761e3748d7102.zip
dTV some bugs in cython
Diffstat (limited to 'Wrappers/Python/conda-recipe')
-rw-r--r--Wrappers/Python/conda-recipe/run_test.py.in (renamed from Wrappers/Python/conda-recipe/run_test.py)17
-rw-r--r--Wrappers/Python/conda-recipe/testLena.npybin0 -> 1048656 bytes
2 files changed, 8 insertions, 9 deletions
diff --git a/Wrappers/Python/conda-recipe/run_test.py b/Wrappers/Python/conda-recipe/run_test.py.in
index 04bbd40..9a6f4de 100644
--- a/Wrappers/Python/conda-recipe/run_test.py
+++ b/Wrappers/Python/conda-recipe/run_test.py.in
@@ -1,8 +1,6 @@
import unittest
import numpy as np
-import os
from ccpi.filters.regularisers import ROF_TV, FGP_TV
-import matplotlib.pyplot as plt
def rmse(im1, im2):
rmse = np.sqrt(np.sum((im1 - im2) ** 2) / float(im1.size))
@@ -14,13 +12,16 @@ class TestRegularisers(unittest.TestCase):
pass
def test_cpu_regularisers(self):
- filename = os.path.join(".." , ".." , ".." , "data" ,"lena_gray_512.tif")
+ #filename = os.path.join(".." , ".." , ".." , "data" ,"testLena.npy")
+ Im = np.load('testLena.npy');
+ """
# read noiseless image
Im = plt.imread(filename)
Im = np.asarray(Im, dtype='float32')
Im = Im/255
+ """
tolerance = 1e-05
rms_rof_exp = 0.006812507 #expected value for ROF model
rms_fgp_exp = 0.019152347 #expected value for FGP model
@@ -80,13 +81,11 @@ class TestRegularisers(unittest.TestCase):
"""
self.assertTrue(res)
def test_gpu_regularisers(self):
- filename = os.path.join(".." , ".." , ".." , "data" ,"lena_gray_512.tif")
+ #filename = os.path.join(".." , ".." , ".." , "data" ,"testLena.npy")
- # read noiseless image
- Im = plt.imread(filename)
- Im = np.asarray(Im, dtype='float32')
+ Im = np.load('testLena.npy');
- Im = Im/255
+ #Im = Im/255
tolerance = 1e-05
rms_rof_exp = 0.006812507 #expected value for ROF model
rms_fgp_exp = 0.019152347 #expected value for FGP model
@@ -146,4 +145,4 @@ class TestRegularisers(unittest.TestCase):
"""
self.assertTrue(res)
if __name__ == '__main__':
- unittest.main() \ No newline at end of file
+ unittest.main()
diff --git a/Wrappers/Python/conda-recipe/testLena.npy b/Wrappers/Python/conda-recipe/testLena.npy
new file mode 100644
index 0000000..14bc0e3
--- /dev/null
+++ b/Wrappers/Python/conda-recipe/testLena.npy
Binary files differ