Skip to content

DarthReca/mlinapp-project

Repository files navigation

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contributing
  6. License
  7. Contact
  8. Acknowledgments

About The Project

This repo contains the implementation of a project made during the course Machine Learning in Applications attended at Politecnico di Torino. The objective of this project is to create a filter for facial attribute editing. It contains the original baseline and the other techniques exploited to finetune the network.

The final report can be found here.

(back to top)

Built With

(back to top)

Getting Started

Prerequisites

To setup the environment run the following script:

python setup_env.py

Otherwise install manually the dependencies with pip install -r requirements.txt and download the dataset and the desired weights.

The dataset can be found in CelebA website and the weights in the Pytorch implementation of AttGAN repo.

(back to top)

Usage

To train the model simply run train.py with the desired arguments. The ones used in report are:

  • lambda_1 : the weight of reconstruction loss
  • epochs : number of training epochs to run
  • batch_size : the size of batch
  • indices_path : the numpy file containing the indices of the images to use for training
  • experiment_name : the CometML experiment name
  • target_attr : the attribute to modify
  • dg_ratio : how many discriminator steps we run for each generator step
  • freeze_layers : how many low layers of discriminator to freeze
  • use_alternate_dataset : use Alternate method as described in report
  • max_time : timer for stopping training
  • upload_weights : if present upload checkpoint to CometML

For more details use python train.py --help and refer to original implementation.

(back to top)

License

Distributed under the MIT License. See LICENSE for more information.

We used third-party AttGAN implementation see ATTGAN for more details.

(back to top)

Contributors

The project was built by Damiano Bonaccorsi, Daniele Rege Cambrin, Giulia D’Ascenzi, Patrizio de Girolamo.

(back to top)

Acknowledgments

  • He, Zhenliang et al. "AttGAN: Facial Attribute Editing by Only Changing What You Want." (2017).
  • Mo, Sangwoo et al. "Freeze the Discriminator: a Simple Baseline for Fine-Tuning GANs." (2020).

(back to top)

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •