From b74b9c54247177c82493f180617d7551de8e2bb1 Mon Sep 17 00:00:00 2001 From: natanielruiz <nataniel777@hotmail.com> Date: 星期二, 26 九月 2017 03:47:06 +0800 Subject: [PATCH] Before SR experiments --- code/test_preangles_superres.py | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diff --git a/code/test_preangles_superres.py b/code/test_preangles_superres.py index faf73d3..13f2451 100644 --- a/code/test_preangles_superres.py +++ b/code/test_preangles_superres.py @@ -107,12 +107,12 @@ ### START Super-resolution ### # To new color space img = transforms.ToPILImage()(images[0]) - print img + # print img img = img.convert('YCbCr') img_y, img_cb, img_cr = img.split() # Super-resolution - img_y_var = Variable(transforms.ToTensor()(img_y)).view(1, -1, img_y.size[0], img_y.size[1]).cuda(gpu) / 255. + img_y_var = Variable(transforms.ToTensor()(img_y)).view(1, -1, img_y.size[0], img_y.size[1]).cuda(gpu) out_sr = sr_model(img_y_var) img_h_y = out_sr.data[0].cpu().numpy().astype(np.float32) @@ -124,7 +124,6 @@ img_new = np.zeros((img_h_y.shape[0], img_h_y.shape[1], 3), np.uint8) img_new[:,:,0] = img_h_y - # img_new[:,:,0] = np.asarray(img_y) img_new[:,:,1] = np.asarray(img_cb) img_new[:,:,2] = np.asarray(img_cr) img_new = Image.fromarray(img_new, "YCbCr").convert("RGB") -- Gitblit v1.8.0