14c0cf773f514788aca6b935298fa186890eecc1,test.py,,,#,16
Before Change
target = Variable(ToTensor()(target))
if torch.cuda.is_available():
image = image.unsqueeze(0).cuda()
target = target.unsqueeze(0).cuda()
out = model(image)
mse = ((target - out) ** 2).mean()
psnr = 10 * log10(1 / mse.data.cpu().numpy())
ssim = pytorch_ssim.ssim(out, target)
out_img = ToPILImage()(out[0].data)
out_img.save(out_path + "psnr_%.4f_ssim_%.4f_" % (psnr, ssim) + image_name)
After Change
out = model(image.unsqueeze(0))[0]
mse = ((target - out) ** 2).mean()
psnr = 10 * log10(1 / mse.data.cpu().numpy())
ssim = structural_similarity(out.data.cpu().numpy(), target.data.cpu().numpy())
out_img = ToPILImage()(out.data)
out_img.save(out_path + "psnr_%.4f_ssim_%.4f_" % (psnr, ssim) + image_name)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 4
Instances
Project Name: leftthomas/SRGAN
Commit Name: 14c0cf773f514788aca6b935298fa186890eecc1
Time: 2017-11-21
Author: leftthomas@qq.com
File Name: test.py
Class Name:
Method Name:
Project Name: interactiveaudiolab/nussl
Commit Name: 2ffbfa3a6bd3b8de8e21a762489346054dcd9ccc
Time: 2020-03-12
Author: prem@u.northwestern.edu
File Name: nussl/separation/deep/deep_mask_estimation.py
Class Name: DeepMaskEstimation
Method Name: extract_features
Project Name: carpedm20/ENAS-pytorch
Commit Name: f98bd2ec9d4289939ff6661d5a9c43ee7e8996f7
Time: 2018-03-11
Author: dukebw@mcmaster.ca
File Name: models/shared_rnn.py
Class Name: RNN
Method Name: forward