Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It is not working Correctly! #349

Open
MuhammadShahzeb123 opened this issue May 14, 2023 · 0 comments
Open

It is not working Correctly! #349

MuhammadShahzeb123 opened this issue May 14, 2023 · 0 comments

Comments

@MuhammadShahzeb123
Copy link

Brothers, I have tested the Model on Windows using Python ( Because of the dome.sh could not run ).
In this code:

import torch
from torch.autograd import Variable
from PIL import Image
from torchvision.transforms import ToTensor, ToPILImage

from src import option
from src.model import edsr

model_path = "experiment/edsr_baseline_x2-1bc95232.pt"
args = option.args
args.n_resblocks = 16
args.n_feats = 64
args.rgb_range = 255
args.res_scale = 1
args.n_colors = 3
args.scale = [2]

model = edsr.EDSR(args=args)
model.load_state_dict(torch.load(model_path, map_location=lambda storage, loc: storage))
model.eval()

input_image_path = "Aneesa.jpg"
image = Image.open(input_image_path).convert('RGB')
image = ToTensor()(image).unsqueeze(0)

with torch.no_grad():
    input_image = Variable(image)
    upscaled_image = model(input_image)

output_image_path = "image.jpg"
upscaled_image = ToPILImage()(upscaled_image.squeeze(0))
upscaled_image.save(output_image_path)

It turned the picture:
Aneesa

Into this Picture:
image

Can anyone help me with that because I am a true beginner and I want to adopt this field

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant