diff --git a/README.md b/README.md
index 49a0a99..6d39ba7 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,5 @@
# StyleFlow: Attribute-conditioned Exploration of StyleGAN-Generated Images using Conditional Continuous Normalizing Flows (ACM TOG 2021)
-
+## See you @ Siggraph 2021
![Python 3.7](https://img.shields.io/badge/Python-3.7-green.svg?style=plastic)
![pytorch 1.1.0](https://img.shields.io/badge/Pytorch-1.1.0-green.svg?style=plastic)
![TensorFlow 1.15.0](https://img.shields.io/badge/TensorFlow-1.15.0-green.svg?style=plastic)
@@ -13,6 +13,7 @@ High-quality, diverse, and photorealistic images can now be generated by uncondi
> **StyleFlow: Attribute-conditioned Exploration of StyleGAN-Generated Images using Conditional Continuous Normalizing Flows (ACM TOG 2021)**
> Rameen Abdal, Peihao Zhu, Niloy Mitra, Peter Wonka
+> KAUST, Adobe Research
@@ -22,18 +23,41 @@ High-quality, diverse, and photorealistic images can now be generated by uncondi
[[Promotional Video](https://youtu.be/Lt4Z5oOAeEY)]
+## Note: This repo works only in Windows 10
+
+
+
## Installation
Clone this repo.
```bash
-git clone https://github.com/RameenAbdal/StyleFlow.git
+git clone https://github.com/justinjohn0306/StyleFlow.git
cd StyleFlow/
```
-This code requires PyTorch, TensorFlow, Torchdiffeq, Python 3+ and Pyqt5. Please install dependencies by
-```bash
-conda env create -f environment.yml
-```
+This code requires PyTorch, TensorFlow, Torchdiffeq, Python 3+ and Pyqt5.
+
+Please install dependencies by following these instuctions properly:
+
+1. conda env create -f env_windows.yml (Download and Install Anaconda): [Download Anaconda 64-Bit Graphical Installer]
+ (https://www.anaconda.com/products/individual)
+
+2. conda activate styleflow
+
+3. conda install pytorch==1.2.0 torchvision==0.4.0 cudatoolkit=10.0 -c pytorch
+ [Also available here:(https://pytorch.org/get-started/previous-versions/)]
+
+4. Download and Install Microsoft Visual Studio Community 2017 : [https://visualstudio.microsoft.com/vs/older-downloads]
+ Note: MSV17 is specifically required. MSVS19 won't work
+
+ Make sure to add Microsoft Visual Studio to Windows path
+ eg-: (C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat)
+
+5. add compiler_bindir_search_path inside custom_ops.py
+
+ (inside this folder: dnnlib\tflib)
+ eg: ('C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/HostX64/x64',)
+
StyleGAN2 relies on custom TensorFlow ops that are compiled on the fly using [NVCC](https://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/index.html). To correctly setup the StyleGAN2 generator follow the **Requirements** in [this repo](https://github.com/NVlabs/stylegan2).
@@ -87,18 +111,43 @@ xhost -local:docker
```
+## Web UI (Beta)
+A web based UI is also now available. The WebUI is based on [Streamlit](https://www.streamlit.io/) framework and is still in development phase. To get started, install streamlit from pip:
+```bash
+pip install streamlit
+pip uninstall protobuf python3-protobuf
+pip install --upgrade pip
+pip install --upgrade protobuf
+```
+Then run the streamlit app located under webui/ folder as follows:
+```bash
+cd webui
+streamlit run app.py
+```
+This should automatically open a new browser tab with the UI.
+
+![image](./docs/assets/styleflow-web-final.gif)
+
+
## Training New Model
+Dataset containing sampled StyleGAN2 latents, lighting SH parameters and other attributes. ([Download Here](https://drive.google.com/file/d/1opdzeqpYWtE1uexO49JI-3_RWfE9MYlN/view?usp=sharing))
-To be added
+Create `./data_numpy/` in the main folder and extract the above data or create your own dataset.
+Train your model:
+```bash
+ python train_flow.py
+```
+## Projection
+Our new projection method is currently under review. To be updated!
## License
-All rights reserved. Licensed under the [CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode) (**Attribution-NonCommercial-ShareAlike 4.0 International**) The code is released for academic research use only.
+All rights reserved. Licensed under the [CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode) (**Attribution-NonCommercial-ShareAlike 4.0 International**). The code is released for academic research use only.
## Citation
-If you use this research/codebase, please cite our papers.
+If you use this research/codebase/dataset, please cite our papers.
```
@article{abdal2020styleflow,
title={Styleflow: Attribute-conditioned exploration of stylegan-generated images using conditional continuous normalizing flows},
@@ -119,5 +168,9 @@ If you use this research/codebase, please cite our papers.
pages={4431-4440},
doi={10.1109/ICCV.2019.00453}}
```
+
+## Broader Impact
+*Important* : Deep learning based facial imagery like DeepFakes and GAN generated images can be gravely misused. This can spread misinformation and lead to other offences. The intent of our work is not to promote such practices but instead be used in the areas such as identification (novel views of a subject, occlusion inpainting etc. ), security (facial composites etc.), image compression (high quality video conferencing at lower bitrates etc.) and development of algorithms for detecting DeepFakes.
+
## Acknowledgments
This implementation builds upon the awesome work done by Karras et al. ([StyleGAN2](https://github.com/NVlabs/stylegan2)), Chen et al. ([torchdiffeq](https://github.com/rtqichen/torchdiffeq)) and Yang et al. ([PointFlow](https://arxiv.org/abs/1906.12320)). This work was supported by Adobe Research and KAUST Office of Sponsored Research (OSR).
diff --git a/dnnlib/tflib/custom_ops.py b/dnnlib/tflib/custom_ops.py
index f87c0d8..7687d7c 100644
--- a/dnnlib/tflib/custom_ops.py
+++ b/dnnlib/tflib/custom_ops.py
@@ -25,18 +25,25 @@
verbose = True # Print status messages to stdout.
compiler_bindir_search_path = [
- 'C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.14.26428/bin/Hostx64/x64',
- 'C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.23.28105/bin/Hostx64/x64',
- 'C:/Program Files (x86)/Microsoft Visual Studio 14.0/vc/bin',
+ 'C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/HostX64/x64',
]
#----------------------------------------------------------------------------
# Internal helper funcs.
def _find_compiler_bindir():
+
+ #Derive MSVC compiler path from compiler_bindir_search_path array
for compiler_path in compiler_bindir_search_path:
if os.path.isdir(compiler_path):
return compiler_path
+
+ #Derive MSVC compiler path from subdirectory tree
+ subdirectory_paths = [x[0] for x in os.walk('C:\\Program Files (x86)\\Microsoft Visual Studio\\')];
+ if subdirectory_paths is not None:
+ for directory_path in subdirectory_paths:
+ if _compiler_path_validator(directory_path):
+ return directory_path
return None
def _get_compute_cap(device):
@@ -61,9 +68,7 @@ def _run_cmd(cmd):
raise RuntimeError('NVCC returned an error. See below for full command line and output log:\n\n%s\n\n%s' % (cmd, output))
def _prepare_nvcc_cli(opts):
- # cmd = 'nvcc ' + opts.strip()
- cmd = '/usr/local/cuda/bin/nvcc --std=c++11 -DNDEBUG ' + opts.strip()
-
+ cmd = 'nvcc ' + opts.strip()
cmd += ' --disable-warnings'
cmd += ' --include-path "%s"' % tf.sysconfig.get_include()
cmd += ' --include-path "%s"' % os.path.join(tf.sysconfig.get_include(), 'external', 'protobuf_archive', 'src')
@@ -81,6 +86,16 @@ def _prepare_nvcc_cli(opts):
cmd += ' 2>&1'
return cmd
+def _compiler_path_validator(path):
+ if path is not None:
+ if path[:76] == 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\' and path[-16:] == '\\bin\\Hostx64\\x64':
+ return True
+ elif path[:76] == 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\' and path[-16:] == '\\bin\\Hostx64\\x64':
+ return True
+ elif path == 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\vc\\bin':
+ return True
+ return False
+
#----------------------------------------------------------------------------
# Main entry point.
diff --git a/docs/_layouts/default.html b/docs/_layouts/default.html
index 705b17c..76517d2 100644
--- a/docs/_layouts/default.html
+++ b/docs/_layouts/default.html
@@ -22,6 +22,8 @@