MCPcopy Index your code
hub / github.com/LynnHo/EigenGAN-Tensorflow

github.com/LynnHo/EigenGAN-Tensorflow @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
244 symbols 484 edges 57 files 60 documented · 25%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README
Gender Bangs Body Side Pose (Yaw)
Lighting Smile Face Shape Lipstick Color
Painting Style Pose (Yaw) Pose (Pitch) Zoom & Rotate
Flush & Eye Color Mouth Shape Hair Color Hue (Orange-Blue)

more unsupervisedly learned dimensions

EigenGAN

EigenGAN: Layer-Wise Eigen-Learning for GANs \ Zhenliang He1,2, Meina Kan1,2, Shiguang Shan1,2,3 \ 1Key Lab of Intelligent Information Processing, Institute of Computing Technology, CAS, China \ 2University of Chinese Academy of Sciences, China \ 3Peng Cheng Laboratory, China

Schema

Manifold Perspective

Usage

  • Environment

    • Python 3.6

    • TensorFlow 1.15

    • OpenCV, scikit-image, tqdm, oyaml

    • we recommend Anaconda or Miniconda, then you can create the environment with commands below

      ```console conda create -n EigenGAN python=3.6

      source activate EigenGAN

      conda install opencv scikit-image tqdm tensorflow-gpu=1.15

      conda install -c conda-forge oyaml ```

    • NOTICE: if you create a new conda environment, remember to activate it before any other command

      console source activate EigenGAN

  • Data Preparation

    • CelebA-unaligned (10.2GB, higher quality than the aligned data)

      • download the dataset

      • unzip and process the data

        ```console 7z x ./data/img_celeba/img_celeba.7z/img_celeba.7z.001 -o./data/img_celeba/

        unzip ./data/img_celeba/annotations.zip -d ./data/img_celeba/

        python ./scripts/align.py ```

    • Anime

      • download the dataset

        ```console mkdir -p ./data/anime

        rsync --verbose --recursive rsync://176.9.41.242:873/biggan/portraits/ ./data/anime/original_imgs ```

      • process the data

        console python ./scripts/remove_black_edge.py

  • Run (support multi-GPU)

    • training on CelebA

      console CUDA_VISIBLE_DEVICES=0,1 \ python train.py \ --img_dir ./data/img_celeba/aligned/align_size(572,572)_move(0.250,0.000)_face_factor(0.450)_jpg/data \ --experiment_name CelebA

    • training on Anime

      console CUDA_VISIBLE_DEVICES=0,1 \ python train.py \ --img_dir ./data/anime/remove_black_edge_imgs \ --experiment_name Anime

    • testing

      console CUDA_VISIBLE_DEVICES=0 \ python test_traversal_all_dims.py \ --experiment_name CelebA

    • loss visualization

      console CUDA_VISIBLE_DEVICES='' \ tensorboard \ --logdir ./output/CelebA/summaries \ --port 6006

  • Using Trained Weights

    • trained weights (move to ./output/*.zip)

    • unzip the file (CelebA.zip for example)

      console unzip ./output/CelebA.zip -d ./output/

    • testing (see above)

Citation

If you find EigenGAN useful in your research works, please consider citing:

@inproceedings{he2021eigengan,
  title={EigenGAN: Layer-Wise Eigen-Learning for GANs},
  author={He, Zhenliang and Kan, Meina and Shan, Shiguang},
  booktitle={IEEE International Conference on Computer Vision (ICCV)},
  year={2021}
}

Core symbols most depended-on inside this repo

activation_fn
called by 8
tfprob/gan/loss.py
split
called by 6
pylib/path.py
split
called by 6
scripts/pylib/path.py
get_fgan_losses_fn
called by 4
tfprob/gan/loss.py
outputs_size
called by 4
tflib/deep_learning/layers.py
_norm
called by 3
tfprob/gan/gradient_penalty.py
_check_ext
called by 3
pylib/serialization.py
_check_ext
called by 3
scripts/pylib/serialization.py

Shape

Function 199
Method 37
Class 8

Languages

Python100%

Modules by API surface

tfprob/gan/loss.py14 symbols
scripts/pylib/path.py14 symbols
pylib/path.py14 symbols
tflib/deep_learning/module.py13 symbols
scripts/pylib/timer.py12 symbols
pylib/timer.py12 symbols
tflib/utils/utils.py11 symbols
tflib/deep_learning/learning_rate.py9 symbols
tflib/deep_learning/layers.py9 symbols
scripts/pylib/argument.py8 symbols
scripts/imlib/dtype.py8 symbols
pylib/argument.py8 symbols

For agents

$ claude mcp add EigenGAN-Tensorflow \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact