-
Notifications
You must be signed in to change notification settings - Fork 570
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
how to get each picture's latent code? #36
Comments
Did you only make a change in psp.py? You should make the changes in inference.py instead. You should change the call pixel2style2pixel/scripts/inference.py Line 111 in 751fcbd
in inference.py to return a tuple as such:
Then, in inference.py in line 129 you should change pixel2style2pixel/scripts/inference.py Line 129 in 751fcbd
to
Finally, in line 73, you should change the line pixel2style2pixel/scripts/inference.py Line 73 in 751fcbd
to something like
Now you have the latents of the batch and can save them if you wish. |
Thanks for your instruction and your great work! It helps a lot. |
Awesome! |
I set the 'return_latents=True' in psp.py , but get TypeError :
【
Traceback (most recent call last):
File "/home/zhz1/anaconda3/envs/env_36/lib/python3.7/site-packages/PIL/Image.py", line 2751, in fromarray
mode, rawmode = _fromarray_typemap[typekey]
KeyError: ((1, 1, 1, 256), '|u1')
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "scripts/inference.py", line 136, in
run()
File "scripts/inference.py", line 82, in run
result = tensor2im(result_batch[i])
File "./utils/common.py", line 23, in tensor2im
return Image.fromarray(var.astype('uint8'))
File "/home/zhz1/anaconda3/envs/env_36/lib/python3.7/site-packages/PIL/Image.py", line 2753, in fromarray
raise TypeError("Cannot handle this data type: %s, %s" % typekey) from e
TypeError: Cannot handle this data type: (1, 1, 1, 256), |u1
】
could you please tell me how to output each picture's latent code?
The text was updated successfully, but these errors were encountered: