eladrich / pixel2style2pixel

Official Implementation for "Encoding in Style: a StyleGAN Encoder for Image-to-Image Translation" (CVPR 2021) presenting the pixel2style2pixel (pSp) framework
https://eladrich.github.io/pixel2style2pixel/
MIT License
3.2k stars 568 forks source link

About customizing datasets #268

Closed Lufffya closed 2 years ago

Lufffya commented 2 years ago

Hi, thank you for sharing such a great job

I encountered some questions during the use:

1,Can this framework only work on face images? can it be other images? such as cat and dog.

2,If I can, I should build training and test datasets, and how should they be structured. for example, I have some sketches and real images of dogs. which training method should I use in this tutorial. choose "Training pSp", or "Training the pSp Encoder", or something else.

Thank you in advance

yuval-alaluf commented 2 years ago

1,Can this framework only work on face images? can it be other images? such as cat and dog.

In the paper we showed results on different domains including cats and dogs. In general, pSp is generic. If you have a high-quality SG generator for a specific domain, you can train an encoder for that domain.

If I can, I should build training and test datasets, and how should they be structured.

This depends on the image-to-image task you want to solve. If you said that you have pairs of (real dog, sketch dog) then you should train a sketch-to-image model. And you can follow the idea here to get started: https://github.com/eladrich/pixel2style2pixel#sketch-to-face

Lufffya commented 2 years ago

This is my task:from sketched package image to real image

image

started here: https://github.com/eladrich/pixel2style2pixel#sketch-to-face

But I got this situation. It looks a little abnormal

yuval-alaluf commented 2 years ago

Are you using a SG generator for faces? You need to first train a SG generator for your real handbag images.

Lufffya commented 2 years ago

Thank you for your reply