Code Monkey home page Code Monkey logo

baby-face-generator-with-cyclegan's Introduction

Baby-Face-Generator-with-CycleGAN

Contribution

This repo is heavily based on Original CycleGAN implementation. Most of our work involves adding code to better handle the dataset we are working with.

Prerequisites

  • Linux or macOS
  • Python 3
  • CPU or NVIDIA GPU + CUDA CuDNN

Getting Started

Installation

  • Clone this repo:
git clone https://github.com/lsh0357/Baby-Face-Generator-with-CycleGAN.git
cd Baby-Face-Generator-with-CycleGAN
  • Install [PyTorch](http://pytorch.org and) 0.4+ and other dependencies (e.g., torchvision, visdom and dominate).
    • For pip users, please type the command pip install -r requirements.txt.

Play with your own images!

  • If you would like to try the model with 2 or more input images, you could use http://www.morphthing.com/morph to morph your images, else if only one image as input, look into the next step.
  • The model is restricted to face only images, so please follow https://github.com/kb22/Create-Face-Data-from-Images to extract face from images or use any other tool to clean up the background noisies.
  • The trained model is saved at ./trained_model. Move the whole trained_model directory to ./checkpoints
  • To generate a baby style face of your input, simply run
python test.py --dataroot <PATH_TO_TEST_SET> --name trained_model --model test
  • Look at your baby face at ./results

CycleGAN train/test

  • To view training results and loss plots, run python -m visdom.server and click the URL http://localhost:8097.
  • Train a model:
#!./scripts/train_cyclegan.sh
python train.py --dataroot <PATH_TO_TRAINING_SET> --name <NAME_FOR_THE_MODEL> --model cycle_gan

To see more intermediate results, check out ./checkpoints/<NAME_FOR_THE_MODEL>.

  • Test the model:
#!./scripts/test_cyclegan.sh
python test.py --dataroot <PATH_TO_TEST_SET> --name <NAME_FOR_THE_MODEL> --model cycle_gan
python test.py --dataroot <PATH_TO_TEST_SET> --name <NAME_FOR_THE_MODEL> --model test(For one side test, such as only from adult to baby)
  • The test results will be saved to a html file here: ./results/<NAME_FOR_THE_MODEL>/latest_test/index.html.

Apply a pre-trained model (CycleGAN)

  • Look at the options directory or the original repo for more information about how to do a pre-train and pther advantage training and testing options.

baby-face-generator-with-cyclegan's People

Contributors

alanyee avatar alexkassil avatar andyli avatar bilal2vec avatar ecoopnet avatar guopzhao avatar heaversm avatar iver56 avatar jpmerc avatar junyanz avatar kagudkovart avatar lambdawill avatar layumi avatar levirve avatar lsh0357 avatar micmelesse avatar morpheus3000 avatar naruto-sasuke avatar orenkatzir avatar peterfogh avatar phillipi avatar ruotianluo avatar simontreu avatar ssnl avatar strob avatar taesungp avatar tariqahassan avatar tylercarberry avatar yichunk avatar yt6t6t avatar

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.