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

The results before and after running are different #6

Open
TomatoBoy90 opened this issue Jul 20, 2021 · 1 comment
Open

The results before and after running are different #6

TomatoBoy90 opened this issue Jul 20, 2021 · 1 comment

Comments

@TomatoBoy90
Copy link

image

code as follow:

from PIL import Image
img=Image.open('XX.jpg').resize((256,256))
image=np.array(img)
ih=torch.tensor(np.transpose(image,(2,0,1)))/255.0
ih=ih.unsqueeze(0)
imoutput,immask,imwatermark= model(ih.cuda())
imcoarser,imrefine,imwatermark = imoutput[1]immask + im(1-immask),imoutput[0]immask + im(1-immask),imwatermark*immask
torchvision.utils.save_image(imcoarser,'imrefine.jpg')

@atharvjairath
Copy link

@TomatoBoy90 I guess its because in line imcoarser,imrefine,imwatermark = imoutput[1]immask + im(1-immask),imoutput[0]immask + im(1-immask),imwatermark*immask here you are using im instead of ih.cuda()

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

2 participants