diff options
author | Edoardo Pasca <edo.paskino@gmail.com> | 2018-01-23 22:24:37 +0000 |
---|---|---|
committer | Edoardo Pasca <edo.paskino@gmail.com> | 2018-01-23 22:45:21 +0000 |
commit | 97d2cbf43f301b2d002fc109978f9fc8a8fd5bdf (patch) | |
tree | 8f12b9d1983d700156407e4f110bb8cafc2f921b /Wrappers | |
parent | 39cc838da62d2a073ffd280bc781b61116ece64e (diff) | |
download | regularization-97d2cbf43f301b2d002fc109978f9fc8a8fd5bdf.tar.gz regularization-97d2cbf43f301b2d002fc109978f9fc8a8fd5bdf.tar.bz2 regularization-97d2cbf43f301b2d002fc109978f9fc8a8fd5bdf.tar.xz regularization-97d2cbf43f301b2d002fc109978f9fc8a8fd5bdf.zip |
Fix #13
Fixes #13. Bug due to calling list(np::array). For some reasons, it
splitted the array (512x512) in 512 arrays of len 512.
Diffstat (limited to 'Wrappers')
-rw-r--r-- | Wrappers/Python/ccpi/filters/Regularizer.py | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/Wrappers/Python/ccpi/filters/Regularizer.py b/Wrappers/Python/ccpi/filters/Regularizer.py index 8623f41..b9f12ca 100644 --- a/Wrappers/Python/ccpi/filters/Regularizer.py +++ b/Wrappers/Python/ccpi/filters/Regularizer.py @@ -251,7 +251,9 @@ class Regularizer(): def SplitBregman_TV(input, regularization_parameter , **kwargs): start_time = timeit.default_timer() reg = Regularizer(Regularizer.Algorithm.SplitBregman_TV) - out = list( reg(input, regularization_parameter, **kwargs) ) + out = [] + a = reg(input, regularization_parameter, **kwargs) + out.append(a) out.append(reg.pars) txt = reg.printParametersToString() txt += "%s = %.3fs" % ('elapsed time',timeit.default_timer() - start_time) @@ -262,7 +264,9 @@ class Regularizer(): def FGP_TV(input, regularization_parameter , **kwargs): start_time = timeit.default_timer() reg = Regularizer(Regularizer.Algorithm.FGP_TV) - out = list( reg(input, regularization_parameter, **kwargs) ) + out = [] + a = reg(input, regularization_parameter, **kwargs) + out.append(a) out.append(reg.pars) txt = reg.printParametersToString() txt += "%s = %.3fs" % ('elapsed time',timeit.default_timer() - start_time) @@ -274,10 +278,13 @@ class Regularizer(): tolerance_constant, restrictive_Z_smoothing=0): start_time = timeit.default_timer() reg = Regularizer(Regularizer.Algorithm.LLT_model) - out = list( reg(input, regularization_parameter, time_step=time_step, + out = [] + a = reg(input, regularization_parameter, time_step=time_step, number_of_iterations=number_of_iterations, tolerance_constant=tolerance_constant, - restrictive_Z_smoothing=restrictive_Z_smoothing) ) + restrictive_Z_smoothing=restrictive_Z_smoothing) + + out.append(a) out.append(reg.pars) txt = reg.printParametersToString() txt += "%s = %.3fs" % ('elapsed time',timeit.default_timer() - start_time) @@ -291,12 +298,13 @@ class Regularizer(): PB_filtering_parameter): start_time = timeit.default_timer() reg = Regularizer(Regularizer.Algorithm.PatchBased_Regul) - out = list( reg(input, + out = [] + a = reg(input, regularization_parameter, searching_window_ratio=searching_window_ratio, similarity_window_ratio=similarity_window_ratio, PB_filtering_parameter=PB_filtering_parameter ) - ) + out.append(a) out.append(reg.pars) txt = reg.printParametersToString() txt += "%s = %.3fs" % ('elapsed time',timeit.default_timer() - start_time) @@ -309,10 +317,12 @@ class Regularizer(): start_time = timeit.default_timer() reg = Regularizer(Regularizer.Algorithm.TGV_PD) - out = list( reg(input, regularization_parameter, + a = reg(input, regularization_parameter, first_order_term=first_order_term, second_order_term=second_order_term, - number_of_iterations=number_of_iterations) ) + number_of_iterations=number_of_iterations) + out = [] + out.append(a) out.append(reg.pars) txt = reg.printParametersToString() txt += "%s = %.3fs" % ('elapsed time',timeit.default_timer() - start_time) |