https://github.com/paparazz1/misgan
https://github.com/paparazz1/misgan
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/paparazz1/misgan
- Owner: PaParaZz1
- License: other
- Created: 2019-12-17T04:19:41.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-03-13T15:53:43.000Z (about 5 years ago)
- Last Synced: 2025-01-05T21:12:17.667Z (5 months ago)
- Language: Python
- Size: 13.3 MB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# InGAN
### Official code for the paper "InGAN: Capturing and Retargeting the DNA of a Natural Image"Project page: http://www.wisdom.weizmann.ac.il/~vision/ingan/ (See our results and visual comparison to other methods)
**Accepted ICCV'19 (Oral)**
----------

----------
If you find our work useful in your research or publication, please cite our work:```
@InProceedings{InGAN,
author = {Assaf Shocher and Shai Bagon and Phillip Isola and Michal Irani},
title = {InGAN: Capturing and Retargeting the "DNA" of a Natural Image},
booktitle = {The IEEE International Conference on Computer Vision (ICCV)},
year = {2019}
}
```
----------# Usage:
## Test
### Quick example
First you have to [download the example checkpoint file](http://www.wisdom.weizmann.ac.il/~vision/ingan/resources/checkpoint_0075000.pth.tar), and put it in ``` InGAN/examples/fruit/ ```.
Will defaulty run on the fruits image, using an existing checkpoint.
```
python test.py
```### General testing
By default, when testing you get a collage of various sizes and a smooth video of the transforms. You can also choose to test specific sizes, non-rectangular transforms and more.See configs.py, for all the options. You can either edit this file or modify configuration from command-line.
Examples:
```
python test.py --input_image_path /path/to/some/image.png # choose input image
python test.py --test_non_rect # also output non rectangular transformation results
python test.py --test_vid_scale 2.0, 0.5, 2.5, 0.2 # boundary scales for output video: [max_v, min_v, max_h, min_h]
```
Please see configs.py for many more options## Train
### Quick example
Will defaulty run on the fruits image.
```
python train.py
```
### General training
See configs.py for all the options. You can either edit this file or modify configuration from command-line.
Examples:
```
python train.py --input_image_path /path/to/some/image.png # choose input image
python train.py --G_num_resblocks 3 # change number of residual block in the generator
```
Please see configs.py for many more options
### monitoring
In you results folder, monitor files will be periodically created, example:
## Produce complex animations by scripts:
Please see the file supp_video.py## Parallel training for many images
Please see the file train_supp_mat.py## parameters
```python
[
'entry_block.1.bias',
'entry_block.1.weight_orig',
'entry_block.1.weight_u',
'entry_block.1.weight_v',
'entry_block.2.weight',
'entry_block.2.bias',
'entry_block.2.running_mean',
'entry_block.2.running_var',
'entry_block.2.num_batches_tracked',
'downscale_block.conv_0.1.bias',
'downscale_block.conv_0.1.weight_orig',
'downscale_block.conv_0.1.weight_u',
'downscale_block.conv_0.1.weight_v',
'downscale_block.conv_0.2.weight',
'downscale_block.conv_0.2.bias',
'downscale_block.conv_0.2.running_mean',
'downscale_block.conv_0.2.running_var',
'downscale_block.conv_0.2.num_batches_tracked',
'downscale_block.conv_1.1.bias',
'downscale_block.conv_1.1.weight_orig',
'downscale_block.conv_1.1.weight_u',
'downscale_block.conv_1.1.weight_v',
'downscale_block.conv_1.2.weight',
'downscale_block.conv_1.2.bias',
'downscale_block.conv_1.2.running_mean',
'downscale_block.conv_1.2.running_var',
'downscale_block.conv_1.2.num_batches_tracked',
'downscale_block.conv_2.1.bias',
'downscale_block.conv_2.1.weight_orig',
'downscale_block.conv_2.1.weight_u',
'downscale_block.conv_2.1.weight_v',
'downscale_block.conv_2.2.weight',
'downscale_block.conv_2.2.bias',
'downscale_block.conv_2.2.running_mean',
'downscale_block.conv_2.2.running_var',
'downscale_block.conv_2.2.num_batches_tracked',
'bottleneck_block.0.conv_block.0.bias',
'bottleneck_block.0.conv_block.0.weight_orig',
'bottleneck_block.0.conv_block.0.weight_u',
'bottleneck_block.0.conv_block.0.weight_v',
'bottleneck_block.0.conv_block.1.weight',
'bottleneck_block.0.conv_block.1.bias',
'bottleneck_block.0.conv_block.1.running_mean',
'bottleneck_block.0.conv_block.1.running_var',
'bottleneck_block.0.conv_block.1.num_batches_tracked',
'bottleneck_block.0.conv_block.4.bias',
'bottleneck_block.0.conv_block.4.weight_orig',
'bottleneck_block.0.conv_block.4.weight_u',
'bottleneck_block.0.conv_block.4.weight_v',
'bottleneck_block.0.conv_block.5.weight',
'bottleneck_block.0.conv_block.5.bias',
'bottleneck_block.0.conv_block.5.running_mean',
'bottleneck_block.0.conv_block.5.running_var',
'bottleneck_block.0.conv_block.5.num_batches_tracked',
'bottleneck_block.0.conv_block.7.bias',
'bottleneck_block.0.conv_block.7.weight_orig',
'bottleneck_block.0.conv_block.7.weight_u',
'bottleneck_block.0.conv_block.7.weight_v',
'bottleneck_block.0.conv_block.8.weight',
'bottleneck_block.0.conv_block.8.bias',
'bottleneck_block.0.conv_block.8.running_mean',
'bottleneck_block.0.conv_block.8.running_var',
'bottleneck_block.0.conv_block.8.num_batches_tracked',
'bottleneck_block.1.conv_block.0.bias',
'bottleneck_block.1.conv_block.0.weight_orig',
'bottleneck_block.1.conv_block.0.weight_u',
'bottleneck_block.1.conv_block.0.weight_v',
'bottleneck_block.1.conv_block.1.weight',
'bottleneck_block.1.conv_block.1.bias',
'bottleneck_block.1.conv_block.1.running_mean',
'bottleneck_block.1.conv_block.1.running_var',
'bottleneck_block.1.conv_block.1.num_batches_tracked',
'bottleneck_block.1.conv_block.4.bias',
'bottleneck_block.1.conv_block.4.weight_orig',
'bottleneck_block.1.conv_block.4.weight_u',
'bottleneck_block.1.conv_block.4.weight_v',
'bottleneck_block.1.conv_block.5.weight',
'bottleneck_block.1.conv_block.5.bias',
'bottleneck_block.1.conv_block.5.running_mean',
'bottleneck_block.1.conv_block.5.running_var',
'bottleneck_block.1.conv_block.5.num_batches_tracked',
'bottleneck_block.1.conv_block.7.bias',
'bottleneck_block.1.conv_block.7.weight_orig',
'bottleneck_block.1.conv_block.7.weight_u',
'bottleneck_block.1.conv_block.7.weight_v',
'bottleneck_block.1.conv_block.8.weight',
'bottleneck_block.1.conv_block.8.bias',
'bottleneck_block.1.conv_block.8.running_mean',
'bottleneck_block.1.conv_block.8.running_var',
'bottleneck_block.1.conv_block.8.num_batches_tracked',
'bottleneck_block.2.conv_block.0.bias',
'bottleneck_block.2.conv_block.0.weight_orig',
'bottleneck_block.2.conv_block.0.weight_u',
'bottleneck_block.2.conv_block.0.weight_v',
'bottleneck_block.2.conv_block.1.weight',
'bottleneck_block.2.conv_block.1.bias',
'bottleneck_block.2.conv_block.1.running_mean',
'bottleneck_block.2.conv_block.1.running_var',
'bottleneck_block.2.conv_block.1.num_batches_tracked',
'bottleneck_block.2.conv_block.4.bias',
'bottleneck_block.2.conv_block.4.weight_orig',
'bottleneck_block.2.conv_block.4.weight_u',
'bottleneck_block.2.conv_block.4.weight_v',
'bottleneck_block.2.conv_block.5.weight',
'bottleneck_block.2.conv_block.5.bias',
'bottleneck_block.2.conv_block.5.running_mean',
'bottleneck_block.2.conv_block.5.running_var',
'bottleneck_block.2.conv_block.5.num_batches_tracked',
'bottleneck_block.2.conv_block.7.bias',
'bottleneck_block.2.conv_block.7.weight_orig',
'bottleneck_block.2.conv_block.7.weight_u',
'bottleneck_block.2.conv_block.7.weight_v',
'bottleneck_block.2.conv_block.8.weight',
'bottleneck_block.2.conv_block.8.bias',
'bottleneck_block.2.conv_block.8.running_mean',
'bottleneck_block.2.conv_block.8.running_var',
'bottleneck_block.2.conv_block.8.num_batches_tracked',
'bottleneck_block.3.conv_block.0.bias',
'bottleneck_block.3.conv_block.0.weight_orig',
'bottleneck_block.3.conv_block.0.weight_u',
'bottleneck_block.3.conv_block.0.weight_v',
'bottleneck_block.3.conv_block.1.weight',
'bottleneck_block.3.conv_block.1.bias',
'bottleneck_block.3.conv_block.1.running_mean',
'bottleneck_block.3.conv_block.1.running_var',
'bottleneck_block.3.conv_block.1.num_batches_tracked',
'bottleneck_block.3.conv_block.4.bias',
'bottleneck_block.3.conv_block.4.weight_orig',
'bottleneck_block.3.conv_block.4.weight_u',
'bottleneck_block.3.conv_block.4.weight_v',
'bottleneck_block.3.conv_block.5.weight',
'bottleneck_block.3.conv_block.5.bias',
'bottleneck_block.3.conv_block.5.running_mean',
'bottleneck_block.3.conv_block.5.running_var',
'bottleneck_block.3.conv_block.5.num_batches_tracked',
'bottleneck_block.3.conv_block.7.bias',
'bottleneck_block.3.conv_block.7.weight_orig',
'bottleneck_block.3.conv_block.7.weight_u',
'bottleneck_block.3.conv_block.7.weight_v',
'bottleneck_block.3.conv_block.8.weight',
'bottleneck_block.3.conv_block.8.bias',
'bottleneck_block.3.conv_block.8.running_mean',
'bottleneck_block.3.conv_block.8.running_var',
'bottleneck_block.3.conv_block.8.num_batches_tracked',
'bottleneck_block.4.conv_block.0.bias',
'bottleneck_block.4.conv_block.0.weight_orig',
'bottleneck_block.4.conv_block.0.weight_u',
'bottleneck_block.4.conv_block.0.weight_v',
'bottleneck_block.4.conv_block.1.weight',
'bottleneck_block.4.conv_block.1.bias',
'bottleneck_block.4.conv_block.1.running_mean',
'bottleneck_block.4.conv_block.1.running_var',
'bottleneck_block.4.conv_block.1.num_batches_tracked',
'bottleneck_block.4.conv_block.4.bias',
'bottleneck_block.4.conv_block.4.weight_orig',
'bottleneck_block.4.conv_block.4.weight_u',
'bottleneck_block.4.conv_block.4.weight_v',
'bottleneck_block.4.conv_block.5.weight',
'bottleneck_block.4.conv_block.5.bias',
'bottleneck_block.4.conv_block.5.running_mean',
'bottleneck_block.4.conv_block.5.running_var',
'bottleneck_block.4.conv_block.5.num_batches_tracked',
'bottleneck_block.4.conv_block.7.bias',
'bottleneck_block.4.conv_block.7.weight_orig',
'bottleneck_block.4.conv_block.7.weight_u',
'bottleneck_block.4.conv_block.7.weight_v',
'bottleneck_block.4.conv_block.8.weight',
'bottleneck_block.4.conv_block.8.bias',
'bottleneck_block.4.conv_block.8.running_mean',
'bottleneck_block.4.conv_block.8.running_var',
'bottleneck_block.4.conv_block.8.num_batches_tracked',
'bottleneck_block.5.conv_block.0.bias',
'bottleneck_block.5.conv_block.0.weight_orig',
'bottleneck_block.5.conv_block.0.weight_u',
'bottleneck_block.5.conv_block.0.weight_v',
'bottleneck_block.5.conv_block.1.weight',
'bottleneck_block.5.conv_block.1.bias',
'bottleneck_block.5.conv_block.1.running_mean',
'bottleneck_block.5.conv_block.1.running_var',
'bottleneck_block.5.conv_block.1.num_batches_tracked',
'bottleneck_block.5.conv_block.4.bias',
'bottleneck_block.5.conv_block.4.weight_orig',
'bottleneck_block.5.conv_block.4.weight_u',
'bottleneck_block.5.conv_block.4.weight_v',
'bottleneck_block.5.conv_block.5.weight',
'bottleneck_block.5.conv_block.5.bias',
'bottleneck_block.5.conv_block.5.running_mean',
'bottleneck_block.5.conv_block.5.running_var',
'bottleneck_block.5.conv_block.5.num_batches_tracked',
'bottleneck_block.5.conv_block.7.bias',
'bottleneck_block.5.conv_block.7.weight_orig',
'bottleneck_block.5.conv_block.7.weight_u',
'bottleneck_block.5.conv_block.7.weight_v',
'bottleneck_block.5.conv_block.8.weight',
'bottleneck_block.5.conv_block.8.bias',
'bottleneck_block.5.conv_block.8.running_mean',
'bottleneck_block.5.conv_block.8.running_var',
'bottleneck_block.5.conv_block.8.num_batches_tracked',
'upscale_block.conv_2.1.bias',
'upscale_block.conv_2.1.weight_orig',
'upscale_block.conv_2.1.weight_u',
'upscale_block.conv_2.1.weight_v',
'upscale_block.conv_2.2.weight',
'upscale_block.conv_2.2.bias',
'upscale_block.conv_2.2.running_mean',
'upscale_block.conv_2.2.running_var',
'upscale_block.conv_2.2.num_batches_tracked',
'upscale_block.conv_1.1.bias',
'upscale_block.conv_1.1.weight_orig',
'upscale_block.conv_1.1.weight_u',
'upscale_block.conv_1.1.weight_v',
'upscale_block.conv_1.2.weight',
'upscale_block.conv_1.2.bias',
'upscale_block.conv_1.2.running_mean',
'upscale_block.conv_1.2.running_var',
'upscale_block.conv_1.2.num_batches_tracked',
'upscale_block.conv_0.1.bias',
'upscale_block.conv_0.1.weight_orig',
'upscale_block.conv_0.1.weight_u',
'upscale_block.conv_0.1.weight_v',
'upscale_block.conv_0.2.weight',
'upscale_block.conv_0.2.bias',
'upscale_block.conv_0.2.running_mean',
'upscale_block.conv_0.2.running_var',
'upscale_block.conv_0.2.num_batches_tracked',
'final_block.1.weight',
'final_block.1.bias'
]
```