about the evaluation script of ST-RRED
Closed this issue · 1 comments
redrock303 commented
Could you provide the evaluation script of ST-RRED , I want to compare my method with fastdvdnet using ST-RRED. Thanks.
m-tassano commented
Hey,
Sharing the whole script wouldn't make sense because it does many other things, but the computation of ST-RRED is basically what I copy below. Then, I average the scores of all the sequences in the testset per sigma.
from skvideo.measure import viideo_score, strred
from skvideo.io import vread
...
# open ref seq
try:
refseq = vread(seq_ref_path, num_frames=nframes, outputdict={"-pix_fmt": "gray"})
except:
refseq = None
# iterate over the list of sigmas and algorithms
for sigma, algo in product(sigmaL, algoD.keys()):
# Load denoised sequence only if there is no previously computed psnr
if need_to_load_seq(psnr_list, algo, sigma, tsetname, subdir):
# Denoised: base_den_dir / algo / sigma / testset / seq
seq_den_path = os.path.join(base_den_dir, algo, tsetname, sigma, subdir, subdir+'.mp4')
# load denoised sequence for comparison
try:
denseq = vread(seq_den_path, num_frames=nframes, outputdict={"-pix_fmt": "gray"})
except:
denseq = None
# compute only if value had not been precomputed
if (denseq is not None) and (refseq is not None):
# compute psnr
psnr = psnrfunc(refseq, denseq).mean()
_, strred_fr, strred_rr = strred(refseq, denseq)