Skip to content

Commit 454631d

Browse files
committed
initial commit
0 parents  commit 454631d

23 files changed

+3100
-0
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
__pycache__/
2+
.idea/
3+
pretrained_model/
4+
dataset/

Dockerfile

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
FROM tensorflow/tensorflow:1.5.0-devel-gpu
2+
3+
RUN apt update
4+
RUN apt install --yes software-properties-common
5+
RUN apt install --yes python3-pip sudo git locales wget libssl-dev openssl vim
6+
RUN locale-gen "en_US.UTF-8"
7+
RUN update-locale LC_ALL="en_US.UTF-8"
8+
9+
RUN pip3 install --upgrade pip
10+
RUN pip3 install --upgrade setuptools
11+
RUN pip3 install tensorflow-gpu==1.5.0 Pillow scipy==1.1.0 scikit-learn matplotlib==2.1.2 tqdm
12+
RUN ln -sf /usr/bin/python3 /usr/bin/python && \
13+
ln -sf /usr/bin/pip3 /usr/bin/pip
14+
15+
ENV USER docker
16+
17+
RUN echo "${USER} ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers.d/${USER}
18+
RUN chmod u+s /usr/sbin/useradd \
19+
&& chmod u+s /usr/sbin/groupadd
20+
ENV HOME /home/${USER}
21+
ENV SHELL /bin/bash
22+
ENV LANG en_US.UTF-8
23+
ENV LANGUAGE en_US:en
24+
ENV LC_ALL en_US.UTF-8
25+
ENV TERM xterm-256color
26+
27+
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
28+
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
29+
CMD ["bash"]
30+
31+
WORKDIR /workspace

README.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
## CircleGAN: Generative Adversarial Learning across Spherical Circles
2+
3+
This repository is the official implementation of CircleGAN. (https://arxiv.org/pdf/2011.12486.pdf)
4+
5+
Most code is adapted from [AM-GAN](https://github.com/ZhimingZhou/AM-GANs-refactored)
6+
7+
## Requirements
8+
9+
You can set up the required environments according to build_env.sh.
10+
11+
Or you can use docker with build_and_run.sh
12+
13+
## Training
14+
15+
* For training unconditional GANs, use the following command at directory /code:
16+
```bash
17+
python circlegan.py --sDataSet [stl10 or cifar10]
18+
```
19+
20+
* For training conditional GANs, use the following command at directory /code:
21+
```bash
22+
python circlegan_cond.py --sDataSet [cifar10/cifar100/tinyimagenet]
23+
```
24+
25+
- The datasets will be automatically downloaded.
26+
- IS and FID will be evaluated at every 10% of total iterations.
27+
28+
## Citation
29+
30+
If you use this code or ideas for your research, please cite our paper.
31+
32+
@article{shim2020CircleGAN,
33+
title = {{CircleGAN: Generative Adversarial Learning across Spherical Circles}},
34+
author = {Woohyeon Shim and Minsu Cho},
35+
journal = {Conference on Neural Information Processing Systems (NeurIPS)},
36+
year = {2020}
37+
}

build_and_run.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
DOCKER_FILE=${1:-"Dockerfile"}
2+
IMAGE_NAME=${2:-"am-gan"}
3+
4+
docker build --tag ${IMAGE_NAME} --file ${DOCKER_FILE} .
5+
6+
docker run --gpus 0 --rm -it --user $(id -u):$(id -g) --mount type=bind,source=$(pwd),target=/workspace ${IMAGE_NAME} bash

build_env.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
sudo -H apt-get update
2+
sudo -H apt-get install -y python3-pip
3+
sudo -H pip3 install --upgrade pip
4+
sudo -H pip3 install --upgrade setuptools
5+
6+
sudo -H pip3 install /newNAS/Share/GPU_Server/tensorflow_gpu-1.5.0rc1-cp35-cp35m-manylinux1_x86_64.whl
7+
sudo -H pip3 install Pillow scipy scikit-learn matplotlib==2.1.2 tqdm
8+
9+
sudo sh /newNAS/Share/GPU_Server/cuda_9.0.176_384.81_linux.run --silent --toolkit
10+
echo 'export PATH=$PATH:/usr/local/cuda/bin' >> ~/.bashrc
11+
echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64' >> ~/.bashrc
12+
. ~/.bashrc
13+
14+
tar xf /newNAS/Share/GPU_Server/cudnn-9.0-linux-x64-v7.tgz -C /tmp
15+
sudo cp -r /tmp/cuda/* /usr/local/cuda/

code/.great_circle.py.swp

4 KB
Binary file not shown.

code/.great_circle_naive.py.swp

16 KB
Binary file not shown.

0 commit comments

Comments
 (0)