https://github.com/wtupc96/copy-pasting-gan
Object Discovery with a Copy-Pasting GAN
https://github.com/wtupc96/copy-pasting-gan
copy-paste gan image-processing mask tensorflow
Last synced: about 1 year ago
JSON representation
Object Discovery with a Copy-Pasting GAN
- Host: GitHub
- URL: https://github.com/wtupc96/copy-pasting-gan
- Owner: wtupc96
- License: mit
- Created: 2019-07-25T02:34:43.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-12-28T07:10:39.000Z (over 6 years ago)
- Last Synced: 2025-02-25T09:24:00.755Z (over 1 year ago)
- Topics: copy-paste, gan, image-processing, mask, tensorflow
- Language: Python
- Size: 232 KB
- Stars: 8
- Watchers: 0
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Copy-Pasting GAN
A TensorFlow implementation of paper **Object Discovery with a Copy-Pasting GAN**.
## Requirements
- Python 3.7
- TensorFlow 1.13.1
## Run
1. Prepare dataset
1. Prepare foreground and background images(`jpg` format only);
2. Put foreground images into `data/plane_sky/plane`;
3. Put background images into `data/plane_sky/sky`;
4. Resize foreground and background images to $240\times240$;(You can use `img_utils.py` in `utils` folder);
- You can change image format in `train.py` and `utils/img_utils.py`;
- You can change image folder in `cfgs.py`;
2. Train with `python main.py`.
3. You can find checkpoints and saved images in `logs`. :)
## Results
|  |  |  |
| :----------------------------------------------------------: | :----------------------------------------------------------: | :----------------------------------------------------------: |
| Foreground | Background | Random selected foreground |
|  |  |  |
| Random generated Mask | Grounded Fake
(with random mask) | Predicted mask from D
(for Grounded Fake) |
|  |  |  |
| Predicted mask from G
(for Foreground) | Anti-shortcut
(foreground+random foreground) | Predicted mask from D
(for Anti-shortcut) |
|  |  |  |
| Predicted mask from D
(for Foreground) | **Composited image**
(foreground+background) | Predicted mask from D
(for Composited image) |