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

Inference does not work correctly #2

Closed
darkasevgen opened this issue Aug 3, 2022 · 4 comments
Closed

Inference does not work correctly #2

darkasevgen opened this issue Aug 3, 2022 · 4 comments

Comments

@darkasevgen
Copy link

darkasevgen commented Aug 3, 2022

Hi @LeslieZhoa, thanks for your implementation.
I tried running the inference.py script and I faced some problems.

I fixed the 'netG' key in the line:

self.net.load_state_dict(ckpt['netG'],strict=False)

to 'G' because final.pth does not contain 'netG'.

Also in the postprocess method you make the slice [..., ::-1], and you also make it after calling the run method:

oup = model.run(img)[...,::-1]

I removed the extra slice.
But I still get an unrealistic image (ran at 1024 and 256 resolutions). I'm attaching an example (first line is 1024, second line is 256) and waiting for a response/comment.
dct_net

@LeslieZhoa
Copy link
Owner

Hi @darkasevgen ! Thanks for your question. I fix the slice bug and upload a new model. You can try again!

@darkasevgen
Copy link
Author

Can you tell me more about how gif is received ?
Did you apply resize to a certain resolution and run the model? Or can the inference be done at any resolution?

@LeslieZhoa
Copy link
Owner

Hi @darkasevgen , the gif is generated with the whole image size. just like

img = cv2.imread('')
img_h,img_w,_ = img.shape 
n_h,n_w = img_h // 8 * 8,img_w // 8 * 8
img = cv2.resize(img,(n_w,n_h))

the model can run at any resolution which can be divided with no remainder.
but the result will be slightly worse.

@darkasevgen
Copy link
Author

Thank you for your reply.

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