genforce / interfacegan

[CVPR 2020] Interpreting the Latent Space of GANs for Semantic Face Editing
https://genforce.github.io/interfacegan/
MIT License
1.51k stars 281 forks source link

how to prepare data for a custom attribute #36

Closed IQ17 closed 4 years ago

IQ17 commented 4 years ago

Hi, I think the main idea is to prepare data with/without a certain attribute, and train a binary classifier (namely linear-SVM) with the data.

But most attributes are of continuous values, such as pose rotation. The logic in your code is to use the average of the largest value and the smallest value as a threshold.

There are also some attributes should be quantised as several finite states, for example, face shape can be in [square, triangle, heart, round, oval]

Do you have more detailed suggestions on how to quantize those attributes?

Thanks!

ShenYujun commented 4 years ago

First, you may need a face shape detector, such as predicting the possibility of a face being a particular shape. Then, you can train a boundary between any two shapes.

IQ17 commented 4 years ago

Thanks, I have thought the idea to train multiple one-vs-one binary classifiers, and the idea to train multiple one-vs-other binary classifiers, like the way in the multiclass-svm. But I am not quite sure if either way is reasonable for editing a non-binary face attributes.