orpatashnik / StyleCLIP

Official Implementation for "StyleCLIP: Text-Driven Manipulation of StyleGAN Imagery" (ICCV 2021 Oral)
MIT License
3.97k stars 557 forks source link

Load other images, but return ValueError #27

Closed zhangjingcode closed 3 years ago

zhangjingcode commented 3 years ago

I tried it with my pictures but failed all, and it returns: ValueError: operands could not be broadcast together with shapes (1,1,0) (1,1,512) (1,1,0), is my picture different from demo images? My 2 color pictures include a cat and a human face, both same size 1024*1024.

betterze commented 3 years ago

Dear Zhangjingcode,

Thank you for your interest in our work. Would you mind providing more information about what you tried?

  1. Which method did you try? The global direction method?
  2. If it is global direction method, you use the GUI or Colab?
  3. Did you invert your real image use e4e?

Please provide as much information as possible.

Best Wishes,

Alex

zhangjingcode commented 3 years ago

Thanks for your reply, I used GUI in the global direction method, and I add my pictures in ffhq folder, just put it in demo images folder together. It is successful when loading my picture and editing in Neutral Text, but return ValueError: operands could not be broadcast together with shapes (1,1,0) (1,1,512) (1,1,0) after editing in the Target Text, images in GUI do not change.

betterze commented 3 years ago

As state in global direction usage,

# to use custom images, please use e4e encoder to generate latents.pt, and place it in './data/dataset_name/' folder, and add --real flag while running this function.
# you may skip this step if you want to manipulate the real human faces we prepare in ./data/ffhq/ folder.   
python GetGUIData.py --dataset_name $dataset_name

We need to invert real images in to stylegan latent space first, our code only do manipulation, not inversion. Please use e4e to invert the images, generate latents.pt, and place it in './data/dataset_name/' folder, and add --real flag while running GetGUIData.py.

zhangjingcode commented 3 years ago

Thanks for your help, I get it!