Code Monkey home page Code Monkey logo

loho-generator's Introduction

LOHO: Latent Optimization of Hairstyles via Orthogonalization [CVPR'21]

Hairstyle transfer samples synthesized by LOHO.

This directory contains the code for running LOHO framework.

The sub-folders are:

  • networks: Contains scripts for Graphonomy, VGG16 and StyleGANv2
  • losses: Contains scripts for computing different losses
  • datasets: Contains scripts for preparing the images and masks required to run LOHO
  • data:
    • images: Contains FFHQ images at 1024px
    • masks: Contains masks at 128px, extracted from Graphonomy, corresponding to the images
    • softmasks: Contains pickle files used to perform "soft-blending" as a post-processing step at 512px
    • backgrounds: Contains images at 256px with foreground inpainted
    • results: Folders that store output files
  • checkpoints: Folder to store checkpoints

In order to run LOHO, you have to download the necessary model checkpoints. We provide instructions to download checkpoints:

Next, running LOHO requires relevant python and CUDA packages. Please run requirements.sh to install necessary packages via conda. Alternatively, you can use pip to install the packages.

Finally, execute loho.py and mention the flags --image1, --image2, --image3. We provide examples below for you to try LOHO. We also provide loop.sh that goes over all combinations and stores the outputs under data/results.

You can use the following specifications:

  • python loho.py --image1 67172.jpg --image2 02602.jpg --image3 67172.jpg
  • python loho.py --image1 00761.jpg --image2 00761.jpg --image3 00018.jpg
  • python loho.py --image1 52364.jpg --image2 52364.jpg --image3 19501.jpg
  • python loho.py --image1 17754.jpg --image2 17658.jpg --image3 00148.jpg
  • python loho.py --image1 46826.jpg --image2 08244.jpg --image3 10446.jpg

To cite this paper, use the following:

 @inproceedings{saha2021LOHO,
   title={LOHO: Latent Optimization of Hairstyles via Orthogonalization},
   author={Saha, Rohit and Duke, Brendan and Shkurti, Florian and Taylor, Graham, and Aarabi, Parham},
   booktitle={CVPR},
   year={2021}
 }

loho-generator's People

Contributors

dukebw avatar rohitsaha avatar

Watchers

 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.