Skip to content

Latest commit

 

History

History
38 lines (25 loc) · 1.45 KB

README-foodi-ml.md

File metadata and controls

38 lines (25 loc) · 1.45 KB

Conditional Image Generation Foodi-ML

In order to conditionally generate images, we trained SAGAN to generate different type of pizza images in a small subset of our dataset.

Download pizza subset

1. Download the dataframe

Please download the dataframe containing the pizza images and their labels.

aws s3 cp s3://glovo-products-dataset-d1c9720d/pizza_subset.csv ENTER_DESTINATION_PATH --no-sign-request

2. Download and unzip the images

aws s3 cp s3://glovo-products-dataset-d1c9720d/pizza_subset.zip ENTER_DESTINATION_PATH --no-sign-request

unzip pizza_subset.zip

3. Train SAGAN for conditional image generation

By running this command we train SAGAN using the configuration specified in the config file SAGAN.json. Additionally, the fields listed below need to be modified as well in the SAGAN.json file.

"data_processing":{ 
      "dataset_name": "foodi-ml",
      "data_path": "DATASET_PATH",

To train the network, please run:

CUDA_VISIBLE_DEVICES=0 python3 src/main.py -t -e -s -iv -c src/configs/TINY_ILSVRC2012/SAGAN.json --save_every 200 --eval_type valid

4. Visualize generated images

To visualize the images generated by the best model, please run the following command with the correct path to the best model weights.

CUDA_VISIBLE_DEVICES=0 python3 src/main.py -iv -std_stat --standing_step 1 -c src/configs/TINY_ILSVRC2012/SAGAN.json --checkpoint_folder <ENTER_CHECKPOINTS_PATH> --log_output_path ./logs/