zichongc / Semantic-face-editing

StyleGAN-based semantic face editing
MIT License
4 stars 1 forks source link

Attribute classifier #1

Open pavelxx1 opened 1 day ago

pavelxx1 commented 1 day ago

How to train own attribute classifier? THx

zichongc commented 1 day ago

Two simple steps:

  1. collect a set of facial data that reflects variations in your target attribute and label each image for binary classification.
  2. use this data to train a binary classifier to serve as your custom attribute classifier. A simple network like resnet should work well.
pavelxx1 commented 1 day ago

Do I understand correctly that the required class should express an emotion, while the other is just a set of faces without the required emotion?

Should the faces be aligned?

How many images need for good training result? in your case

thanks! 🙏

zichongc commented 1 day ago

Yes, that is correct. Additionally, images expressing a certain emotion are generally labeled as the positive class, while others are negative.

Performing face alignment before training the classifier is better.

In my replication experiment, I probably used hundreds of images for training a specific classifier. I'm not entirely sure as it has been a while. However, I believe the amount of data is also closely related to the distinguishability of the attributes and the quality of the data.

pavelxx1 commented 1 day ago

Just tested inference . Output Face not equ to input =(

zichongc commented 15 hours ago

It could be due to GAN inversion if the facial identity recognition has worsened.