Skip to content

Commit c10ead9

Browse files
committed
add gap tv+ffdnet and gaptv+fastdvdnet
1 parent df76c64 commit c10ead9

File tree

164 files changed

+1595
-333
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

164 files changed

+1595
-333
lines changed

Diff for: PnP_SCI/matlab/results/savedmat/combine_binary_mask_256_10f/test_performance.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ ssim 0.6603 0.6930 0.8944 0.6190 0.7439 0.4921 0.6838
1313

1414
* GAP-TV+FFDNET
1515
aerial crash drop kobe runner traffic [average]
16-
psnr 22.34 22.65 31.40 24.41 26.65 19.11 24.4267
16+
psnr 22.34 22.65 31.40 24.88 26.65 19.11 24.4267
1717
ssim 0.8730 0.6047

Diff for: PnP_SCI/matlab/test_pnpsci_meas_test.m

+3-3
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
% datasetdir = './dataset/simdata/cacti/cacti_256_10f_1';
3636
resultdir = './results'; % results
3737

38-
test_algo_flag = [1, 4]; % choose algorithms: 0-all, 1-gaptv, 2-gap-ffdnet, 3-ista-tv, 4-gap-tv+ffdnet
38+
test_algo_flag = [1,4]; % choose algorithms: 0-all, 1-gaptv, 2-gap-ffdnet, 3-ista-tv, 4-gap-tv+ffdnet
3939
saving_data_flag = 0; % save the recon result
4040
tv_init_flag = 0; % use gap-tv recon as initial image for gap-ffdnet
4141
show_res_flag = 0;
@@ -96,12 +96,12 @@
9696
if ismember(0,test_algo_flag) || ismember(1,test_algo_flag)
9797
para.denoiser = 'tv'; % TV denoising
9898
% para.tvm = 'ITV3D_FGP'; % tv denoiser
99-
para.tvm = 'original'; % tv denoiser
99+
para.tvm = 'ATV_ClipA'; % tv denoiser
100100
para.maxiter = 100; % maximum iteration
101101
% para.tvweight = 0.07*255/MAXB; % weight for TV denoising, original
102102
% para.tviter = 5; % number of iteration for TV denoising, original
103103

104-
para.tvweight = 0.07*255/MAXB; % weight for TV denoising, test
104+
para.tvweight = 0.15*255/MAXB; % weight for TV denoising, test
105105
para.tviter = 5; % number of iteration for TV denoising, test
106106

107107
[vgaptv,psnr_gaptv,ssim_gaptv,tgaptv,psnrall_gaptv] = ...

Diff for: PnP_SCI/python/dvp_linear_inv.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,7 @@ def admm_denoise_bayer(y_bayer, Phi_bayer, _lambda=1, gamma=0.01,
441441
return x_bayer, psnr_all
442442

443443

444+
# admm(gap) denosie cacti (including gap)
444445
def admmdenoise_cacti(meas, mask, A, At, projmeth='admm', v0=None, orig=None,
445446
iframe=0, nframe=1, MAXB=1., maskdirection='plain',
446447
**args):
@@ -457,7 +458,7 @@ def admmdenoise_cacti(meas, mask, A, At, projmeth='admm', v0=None, orig=None,
457458
begin_time = time.time()
458459
# loop over all the coded frames [nframe]
459460
for kf in range(nframe):
460-
print('%s-%s Reconstruction coded frame block %2d of %2d ...'
461+
print('\n=== %s-%s Reconstruction coded frame block %2d of %2d ==='
461462
%(projmeth.upper(), args['denoiser'].upper(), kf+1, nframe))
462463
if orig is not None:
463464
orig_k = orig[:,:,(kf+iframe)*nmask:(kf+iframe+1)*nmask]/MAXB

Diff for: PnP_SCI/python/info_log.txt

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
info_log:
2+
conda environment:
3+
windows: dvp

Diff for: PnP_SCI/python/joint_dvp_linear_inv.py

+654
Large diffs are not rendered by default.

Diff for: PnP_SCI/python/pnp_sci_video_meas_test.py

+253-304
Large diffs are not rendered by default.

Diff for: PnP_SCI/python/pnp_sci_video_orig_test.py

+486
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# combine_binary_mask
2+
* use optimal parametes for kobe
3+
4+
bm_256_10f:
5+
---------
6+
GAP-TV
7+
aerial crash drop kobe runner traffic [average]
8+
psnr 22.33 21.88 24.82 24.09 25.71 18.61 22.9067
9+
ssim 0.7504 0.7609 0.9046 0.7655 0.8556 0.5896 0.7711
10+
11+
12+
13+
---------
14+
GAP-TV+FFDNET
15+
aerial crash drop kobe runner traffic [average]
16+
psnr 22.87 23.14 28.96 25.24 26.97 19.28 24.41
17+
ssim 0.7325 0.7144 0.9233 0.7528 0.8036 0.5858 0.7521
18+
19+
20+
21+
22+
---------
23+
GAP-TV+FASTDVDNET
24+
aerial crash drop kobe runner traffic [average]
25+
psnr 25.55 25.83 36.03 27.32 32.10 21.77 28.10
26+
ssim 0.8258 0.8607 0.9547 0.8583 0.9263 0.7492 0.8625
27+
28+
29+
30+
31+
32+
param log:
33+
GAP-TV:
34+
projmeth = 'gap' # projection method
35+
_lambda = 1 # regularization factor, [original set]
36+
accelerate = True # enable accelerated version of GAP
37+
denoiser = 'tv' # total variation (TV)
38+
iter_max = 100 # maximum number of iterations
39+
tv_weight = 0.25 # TV denoising weight (larger for smoother but slower) [kobe:0.25; ]
40+
tv_iter_max = 5 # TV denoising maximum number of iterations each
41+
42+
GAP-TV+FASTDVDNET
43+
projmeth = 'gap' # projection method
44+
_lambda = 1 # regularization factor, [original set]
45+
accelerate = True # enable accelerated version of GAP
46+
denoiser = 'tv+fastdvdnet' # video non-local network
47+
noise_estimate = False # disable noise estimation for GAP
48+
sigma1 = None # pre-set noise standard deviation for 1st period denoise
49+
iter_max1 = 100 # maximum number of iterations for 1st period denoise
50+
sigma2 = [100/255, 50/255, 25/255] # pre-set noise standard deviation for 2nd period denoise
51+
iter_max2 = [80, 100, 150] # maximum number of iterations for 2nd period denoise
52+
# sigma2 = [50/255, 25/255] # pre-set noise standard deviation for 2nd period denoise
53+
# iter_max2 = [20, 20] # maximum number of iterations for 2nd period denoise
54+
tv_iter_max = 5 # TV denoising maximum number of iterations each
55+
tv_weight = 0.25 # TV denoising weight (larger for smoother but slower) [kobe:0.25]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# combine_binary_mask_256_10f_2_uniform
2+
* use optimal parametes for each data
3+
4+
bm_256_10f:
5+
---------
6+
GAP-TV
7+
aerial crash drop kobe runner traffic [average]
8+
psnr 24.05 24.14 31.85 25.35 28.27 19.88 25.59
9+
ssim 0.7857 0.7953 0.9465 0.8016 0.8818 0.6438 0.8091
10+
11+
12+
13+
---------
14+
GAP-TV+FFDNET
15+
aerial crash drop kobe runner traffic [average]
16+
psnr
17+
ssim
18+
19+
20+
21+
22+
---------
23+
GAP-TV+FASTDVDNET
24+
aerial crash drop kobe runner traffic [average]
25+
psnr 26.33 26.79 38.39 28.13 32.58 22.73 29.1583
26+
ssim 0.8524 0.8889 0.9821 0.8866 0.9402 0.778 0.8880
27+
28+
29+
30+
param log:
31+
GAP-TV:
32+
projmeth = 'gap' # projection method
33+
_lambda = 1 # regularization factor, [original set]
34+
accelerate = True # enable accelerated version of GAP
35+
denoiser = 'tv' # total variation (TV)
36+
iter_max = 100 # maximum number of iterations
37+
tv_weight = 0.25 # TV denoising weight (larger for smoother but slower) [kobe:0.25; ]
38+
tv_iter_max = 5 # TV denoising maximum number of iterations each
39+
40+
GAP-TV+FASTDVDNET
41+
projmeth = 'gap' # projection method
42+
_lambda = 1 # regularization factor, [original set]
43+
accelerate = True # enable accelerated version of GAP
44+
denoiser = 'tv+fastdvdnet' # video non-local network
45+
noise_estimate = False # disable noise estimation for GAP
46+
sigma1 = None # pre-set noise standard deviation for 1st period denoise
47+
iter_max1 = 100 # maximum number of iterations for 1st period denoise
48+
sigma2 = [100/255, 50/255, 25/255] # pre-set noise standard deviation for 2nd period denoise
49+
iter_max2 = [60, 100, 150] # maximum number of iterations for 2nd period denoise
50+
# sigma2 = [50/255, 25/255] # pre-set noise standard deviation for 2nd period denoise
51+
# iter_max2 = [20, 20] # maximum number of iterations for 2nd period denoise
52+
tv_iter_max = 5 # TV denoising maximum number of iterations each
53+
tv_weight = 0.25 # TV denoising weight (larger for smoother but slower) [kobe:0.25]

Diff for: PnP_SCI/python/tv_denoiser.py

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
## tv denoisers
2+
3+
def denoise_tv_cham_ITV2D():
4+
pass
5+
6+
def denoise_tv_FGP_ITV3D():
7+
pass

Diff for: PnP_SCI/python/utils.py

+66
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
''' Utilities '''
22
import math
33
import numpy as np
4+
import matplotlib.pyplot as plt
5+
from statistics import mean
6+
import scipy.io as sio
7+
import os
8+
49

510
def A_(x, Phi):
611
'''
@@ -29,3 +34,64 @@ def psnr(ref, img):
2934
return 100
3035
PIXEL_MAX = 1.
3136
return 20 * math.log10(PIXEL_MAX / math.sqrt(mse))
37+
38+
39+
40+
## zzh
41+
def show_n_save_res(vdenoise,tdenoise,psnr_denoise,ssim_denoise,psnrall_denoise, orig, Cr, resultsdir,
42+
save_name, MAXB=255, show_res_flag=1, save_res_flag=1):
43+
# show res
44+
if show_res_flag:
45+
plt.ion()
46+
fig = plt.figure(figsize=(12, 6.5))
47+
row_num = 5
48+
savedfigdir = resultsdir + '/savedfig/cacti/'
49+
50+
for nt in range(Cr):
51+
plt.subplot(Cr//row_num, row_num, nt+1)
52+
plt.imshow(orig[:,:,nt]/MAXB, cmap=plt.cm.gray, vmin=0, vmax=1)
53+
plt.axis('off')
54+
plt.title('Ground truth: Frame #{0:d}'.format(nt+1), fontsize=12)
55+
plt.subplots_adjust(wspace=0.02, hspace=0.02, bottom=0, top=1, left=0, right=1)
56+
plt.savefig('{}{}_Cr{:d}_orig.png'.format(savedfigdir,save_name,Cr))
57+
58+
fig = plt.figure(figsize=(12, 6.5))
59+
PSNR_rec = np.zeros(Cr)
60+
for nt in range(Cr):
61+
plt.subplot(Cr//row_num, row_num, nt+1)
62+
plt.imshow(vdenoise[:,:,nt], cmap=plt.cm.gray, vmin=0, vmax=1)
63+
plt.axis('off')
64+
plt.title('Frame #{0:d} ({1:2.2f} dB)'.format(nt+1,psnr_denoise[nt]), fontsize=12)
65+
66+
# print('Mean PSNR {:2.2f} dB.'.format(mean(psnr_denoise)))
67+
# plt.title('-{} mean PSNR {:2.2f} dB'.format(denoiser.upper(),np.mean(PSNR_rec)))
68+
plt.subplots_adjust(wspace=0.02, hspace=0.02, bottom=0, top=1, left=0, right=1)
69+
plt.savefig('{}{}_Cr{:d}_vdenoise.png'.format(savedfigdir,save_name,Cr))
70+
71+
72+
plt.figure()
73+
# plt.rcParams["font.family"] = 'monospace'
74+
# plt.rcParams["font.size"] = "20"
75+
plt.plot(psnr_denoise)
76+
# plt.plot(psnr_denoise,color='black')
77+
plt.savefig('{}{}_Cr{:d}_psnr_framewise.png'.format(savedfigdir,save_name,Cr))
78+
79+
80+
plt.figure()
81+
plt.plot(*psnrall_denoise, 'r')
82+
plt.savefig('{}{}_Cr{:d}_psnr_all.png'.format(savedfigdir,save_name,Cr))
83+
84+
plt.ioff()
85+
86+
# save res
87+
if save_res_flag:
88+
savedmatdir = resultsdir + '/savedmat/cacti/'
89+
if not os.path.exists(savedmatdir):
90+
os.makedirs(savedmatdir)
91+
sio.savemat('{}{}_Cr{:d}.mat'.format(savedmatdir,save_name,Cr),
92+
{'vdenoise':vdenoise,
93+
'psnr_denoise':psnr_denoise,
94+
'ssim_denoise':ssim_denoise,
95+
'psnrall_denoise':psnrall_denoise,
96+
'tdenoise':tdenoise
97+
})

Diff for: [analysis]/SCI reconstruction analysis.md

+12-24

0 commit comments

Comments
 (0)