SummitKwan / transparent_latent_gan

Use supervised learning to illuminate the latent space of GAN for controlled generation and edit
MIT License
1.97k stars 363 forks source link

Generating Feature Axes? #26

Open robbaker292 opened 4 years ago

robbaker292 commented 4 years ago

Hi,

This is great work, very interesting. I've managed to train my own GAN and feature extractor (I have my own labelled dataset), but am not having success with creating the feature extractor.

It's not clear to me what inputs src/tl-gan/script_label_regression.py require in order to generate the feature_direction_*.pkl file. Any help would be much appreciated.

rishabhshah13 commented 4 years ago

Follow these steps:

  1. Run script_gen_sample_pggan.py
  2. Run script_old_discover_feature_axis.py
  3. Run script_transform_sample_pickle_to_img.py
  4. Run script_predict_label.py
  5. Run script_label_regression.py
robbaker292 commented 4 years ago

Thanks, however when I run step 4, I get the following error:

PS D:\tl-gan> py .\src\tl_gan\script_predict_labels.py
Traceback (most recent call last):
  File ".\src\tl_gan\script_predict_labels.py", line 11, in <module>
    import src.model.cnn_face_attr_celeba as cnn_face
ModuleNotFoundError: No module named 'src'

This occurs when running from any of the directories in tl-gan. Any thoughts?

rishabhshah13 commented 4 years ago

Yes. See this for your reference [https://stackoverflow.com/questions/4383571/importing-files-from-different-folder] Or what can you is to copy and paste 'model.cnn_face_attr_celeba' to your current directory.