This repository contains the code used during the master thesis of Santiago Jiménez Navarro in the Master Program in Robotics, Graphics and Computer Vision. It builds on top of the original Disentangled VAE and the Disentanglement Lib repositories.
- Install the required packages using the
requirements.txt
file. - Download the necessary files:
- The Serrano21 (LDR) dataset. Move the
color_chnl
folder todata/serrano
, rename it tocolor_chnl_original
and execute the scriptchange_shape.py
. - Background masks. Place them in
data/serrano/one_exr_per_geom
.
- Modify the file
hyperparam.ini
to make sure that the paths are correct in your machine.
Now that we have the original Serrano21 dataset, we can build the subset that we want, for example, executing the get_masked.py
script with the option 1 (the variable mode
inside the script). This will generate a folder called masked-serrano
, which should be the value of the training_dataset
variable in the hyperparam.ini
file.
Run the training command, specifying all the required parameters, for example:
python main.py factor_serrano_test -d serrano -l factor --lr 0.0005 -b 128 -e 1000 -z 20 -f 500 --lr-disc 0.00001
After the training is complete, two new folders will be created with the results, whose path is defined in the hyperparam.ini
file (by default named results
and runs
).
To check the development of the training, you can use Tensorboard. For example, by running tensorboard --logdir "disentangling-vae-master/runs"
and then opening http://localhost:6006/
in a browser, you should see plots similar to these:
Test the trained model, using the main_viz.py
script. For example, to generate all the plots, run:
python main_viz.py factor_serrano_test all -r 8 -c 7
This should give a result similar to this: