Giter Club home page Giter Club logo

recovergan's Introduction

RecoverGAN Final Version: X-GAN

Overview

  • Structure

  • Some results
  1. Inpainting center cropped cat faces

  1. Inpainting random noised cat faces

  1. Inpainting center cropped aircrafts

  1. Inpainting random noised aircrafts

Advantages

  • Has decent inpainting performance on cats and planes
  • Robust to different noises at random locations
  • Our model learns much faster than original GAN
  • Based on DCGAN, Context Encoder and WGAN, open to many extensions

Open-Challenges and future works

  • Further modify the inputs for generator / discriminator:
    • Compressive sensing technique (maybe a compressive sensing layer)
    • An extra encoder to encode noisy images
    • Additional inputs (different types of noise)
  • Wider applications for generators (inpainters):
    • Wider varieties of categories of images
    • Wider areas (Music, Video, Creative Works, etc.)
  • Modify the network:
    • Stacked GANs
    • Add dropouts
    • Optimized formulas

References

  1. Yeh, Raymond, et al. "Semantic Image Inpainting with Perceptual and Contextual Losses." arXiv preprint arXiv:1607.07539 (2016).
  2. Arjovsky, Martin, Soumith Chintala, and Léon Bottou. "Wasserstein gan." arXiv preprint arXiv:1701.07875 (2017).
  3. Radford, Alec, Luke Metz, and Soumith Chintala. "Unsupervised representation learning with deep convolutional generative adversarial networks." arXiv preprint arXiv:1511.06434 (2015).
  4. Goodfellow, Ian, et al. "Generative adversarial nets." Advances in Neural Information Processing Systems. 2014.

Instructions

You need to prepare 2 dataset, one is original images and the other is noised original images, no need to have same images

Train XGAN

If dataset (all images under ./data/xxx1 and ./data/xxx2)is already resized to 64x64, run:

python main.py --dataset xxx1 --is_train --is_crop False --epoch 100 --dataset2 xxx2

Otherwise, run:

python main.py --dataset xxx1 --is_train --is_crop True --epoch 100 --dataset2 xxx2

Use model as an inpainter

imgs: path to testing dataset

outDir: path to where to output inpainted results

maskType: mask types :['center', 'random', 'left', 'right']

nIter: inpainting iterations

checkpointDir: path to trained model checkpoint directory

If the same datasets as training process (all images under ./data/xxx1 and ./data/xxx2 and testing data xxx_test) are already resized to 64x64, run:

python inpainter.py --dataset xxx1 --dataset2 xxx2 --imgs xxx_test --outDir path_to_where_to_output_inpainted_results --is_train --nIter 2000 --is_crop False --maskType center --checkpointDir path_to_trained_model_checkpoint_directory

Otherwise, run:

python inpainter.py --dataset xxx1 --dataset2 xxx2 --imgs data/catface_O_r --outDir path_to_where_to_output_inpainted_results --is_train --nIter 2000 --is_crop True --maskType center --checkpointDir path_to_trained_model_checkpoint_directory

recovergan's People

Contributors

icefirecloud avatar rexwangcc avatar zalacheung avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

hutinko junekee

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.