Git Product home page Git Product logo

domainintersectiondifference's Introduction

Domain Intersection and Domain Difference (arxiv).

Pytorch Implementation of "Domain Intersection and Domain Difference" (ICCV 2019)

Prerequisites

Download and Prepare the Data

Download the celeba dataset. Create a celeb directory and place the img_align_celeba folder and list_attr_celeba.txt inside.

You can use the provided script preprocess.py to split celebA into the above format (with A and B based on the attribute of your choosing). For example, you can run the script using the following command:

python preprocess.py --root ./celeba/img_align_celeba --attributes ./celeba/list_attr_celeba.txt --dest ./smile_glasses

You can also use your own custom dataset, as long as it adheres to the following format:

root/
     trainA/
     trainB/
     testA/
     testB/

You can then run the preprocessing in the following manner:

python preprocess.py --root ./custom_dataset --dest ./custom_train --folders --config smile_glasses

To Train

Run train.py. You can use the following example to run:

python train.py --root ./smile_glasses --out ./smile_glasses_out

To Resume Training

Run train.py. You can use the following example to run:

python train.py --root ./smile_glasses --out ./smile_glasses_out --load ./smile_glasses 

To Evaluate

Run eval.py. You can use the following example to run:

python eval.py --root ./smile_glasses --out ./smile_glasses_eval --sep 25 --num_display 10

Figure

Figure from paper describing the method:

Reference

If you found this code useful, please cite the following paper:

@inproceedings{Benaim2019DomainIntersectionDifference,
  title={Domain Intersection and Domain Difference},
  author={Sagie Benaim and Michael Khaitov and Tomer Galanti and Lior Wolf},
  booktitle={ICCV},
  year={2019}
}

Acknowledgements

The implementation is based on the architecture of Content Disentanglement.

domainintersectiondifference's People

Contributors

sagiebenaim avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

domainintersectiondifference's Issues

bug in preprocess.py for custom dataset

It looks like the ) after args.root should be moved to the end of the line:
`

trainA = os.listdir(os.path.join(args.root), 'trainA')

trainB = os.listdir(os.path.join(args.root), 'trainB')

testA = os.listdir(os.path.join(args.root), 'testA')

testB = os.listdir(os.path.join(args.root), 'testB')

`

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.