FMEN icon indicating copy to clipboard operation
FMEN copied to clipboard

Fade output

Open akhalili opened this issue 3 years ago • 0 comments

he super-resolution output I get is fade, I appreciate your hints how to get the right output. Here is how I normalize the lr image and transfer the output tensor to numpy to display with opencv

input normalization:

down_sampled_frm = cv.resize(gt_img, (0, 0), fx=1.0 / args.scale[0], fy=1.0 / args.scale[0])

cv.imshow("down sampled", down_sampled_frm)

down_sampled_frm = cv.cvtColor(down_sampled_frm, cv.COLOR_BGR2RGB)

down_sampled_frm = down_sampled_frm.transpose(2, 0, 1)

down_sampled_frm_tensor = torch.from_numpy(down_sampled_frm).float() / 255.

output tensor to opencv numpy:

up_sampled_frm_tensor = model.forward(down_sampled_frm_tensor[None, :])
up_sampled_frm = (up_sampled_frm_tensor[0] * 255).cpu().clamp(0, 255).round().byte().permute(1, 2, 0).numpy()
up_sampled_frm = cv.cvtColor(up_sampled_frm, cv.COLOR_RGB2BGR)

here I get at the end:

test

akhalili avatar Mar 03 '23 22:03 akhalili