Skip to content

Official code for "Domain Intersection and Domain Difference", ICCV 2019

Notifications You must be signed in to change notification settings

TomerGalanti/DomainDisentanglement

Repository files navigation

Pytorch Implementation of "Domain Intersection and Domain Difference"

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

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}
}

About

Official code for "Domain Intersection and Domain Difference", ICCV 2019

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages