Top AI Repos — open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Simplest working implementation of Stylegan2, state of the art generative adversarial network, in Pytorch. Enabling everyone to experience disentanglement
| Date | Stars |
|---|---|
| 2026-07-24 | 3784 |
| 2026-07-25 | 3784 |
| 2026-07-28 | 3784 |
| 2026-07-30 | 3784 |
| 2026-08-06 | 3784 |
Today
— stars today
This week
— stars this week
This month
— stars this month
Momentum
0.0
growth rate 0.00%/day
## Simple StyleGan2 for Pytorch
[](https://badge.fury.io/py/stylegan2-pytorch)
Simple Pytorch implementation of Stylegan2 based on https://arxiv.org/abs/1912.04958 that can be completely trained from the command-line, no coding needed.
Below are some flowers that do not exist.
<img src="https://raw.githubusercontent.com/lucidrains/stylegan2-pytorch/master/samples/flowers.jpg" width="450" height="auto">
<img src="https://raw.githubusercontent.com/lucidrains/stylegan2-pytorch/master/samples/flowers-2.jpg" width="450" height="auto">
Neither do these hands
<img src="https://raw.githubusercontent.com/lucidrains/stylegan2-pytorch/master/samples/hands.jpg" width="450" height="auto">
Nor these cities
<img src="https://raw.githubusercontent.com/lucidrains/stylegan2-pytorch/master/samples/cities.jpg" width="450" height="auto">
Nor these celebrities (trained by <a href="https://github.com/yoniker">@yoniker</a>)
<img src="https://raw.githubusercontent.com/lucidrains/stylegan2-pytorch/master/samples/celebrities.jpg" width="450" height="auto">
<img src="https://raw.githubusercontent.com/lucidrains/stylegan2-pytorch/master/samples/celebrities-2.jpg" width="450" height="auto">
## Install
You will need a machine with a GPU and CUDA installed. Then pip install the package like this
```bash
$ pip install stylegan2_pytorch
```
If you are using a windows machine, the following commands reportedly works.
```bash
$ conda install pytorch torchvision -c python
$ pip install stylegan2_pytorch
```
## Use
```bash
$ stylegan2_pytorch --data /path/to/images
```
That's it. Sample images will be saved to `results/default` and models will be saved periodically to `models/default`.
## Advanced Use
You can specify the name of your project with
```bash
$ stylegan2_pytorch --data /path/to/images --name my-project-name
```
You can also specify the location where intermediate results and model checkpoints should be stored with
```bash
$ stylegan2_pytorch --data /path/to/images --name my-project-name --results_dir /path/to/results/dir --models_dir /path/to/models/dir
```
You can increase the network capacity (which defaults to `16`) to improve generation results, at the cost of more memory.
```bash
$ stylegan2_pytorch --data /path/to/images --network-capacity 256
```
By default, if the training gets cut off, it will automatically resume from the last checkpointed file. If you want to restart with new settings, just add a `new` flag
```bash
$ stylegan2_pytorch --new --data /path/to/images --name my-project-name --image-size 512 --batch-size 1 --gradient-accumulate-every 16 --network-capacity 10
```
Once you have finished training, you can generate images from your latest checkpoint like so.
```bash
$ stylegan2_pytorch --generate
```
To generate a video of a interpolation through two random points in latent space.
```bash
$ stylegan2_pytorch --generate-interpolation --interpolation-num-steps 100
```
To save each individual frame of the interpolation
```bash
$ stylegan2_pytorch --generate-interpolation --save-frames
```
If a previous checkpoint contained a better generator, (which often happens as generators start degrading towards the end of training), you can load from a previous checkpoint with another flag
```bash
$ stylegan2_pytorch --generate --load-from {checkpoint number}
```
A technique used in both StyleGAN and BigGAN is truncating the latent values so that their values fall close to the mean. The small the truncation value, the better the samples will appear at the cost of sample variety. You can control this with the `--trunc-psi`, where values typically fall between `0.5` and `1`. It is set at `0.75` as default
```bash
$ stylegan2_pytorch --generate --trunc-psi 0.5
```
## Multi-GPU training
If you have one machine with multiple GPUs, the repository offers a way to utilize all of them for training. With multiple GPUs, each batch will be divided evenly amExcerpt of 18,808 characters
Read on GitHubPhil Wang · United States
203
Daniel Perry
3
1
1
1
Sophiah Ho · Canada
1
niansa/tuxifan
1
1
Would you bet a product on this? Bounded 0–100 and slow moving.
matched fp:74d5eb0820a81b9d, topic:pytorch