{"id":19190765,"url":"https://github.com/rtlee9/food-gan","last_synced_at":"2025-05-08T04:50:52.990Z","repository":{"id":93162625,"uuid":"86283416","full_name":"rtlee9/food-GAN","owner":"rtlee9","description":"Novel food image generation using GANs","archived":false,"fork":false,"pushed_at":"2017-03-29T04:01:21.000Z","size":1825,"stargazers_count":15,"open_issues_count":0,"forks_count":5,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-20T08:38:16.345Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rtlee9.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-03-27T02:38:00.000Z","updated_at":"2024-07-19T11:54:51.000Z","dependencies_parsed_at":"2023-04-19T11:03:53.979Z","dependency_job_id":null,"html_url":"https://github.com/rtlee9/food-GAN","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rtlee9%2Ffood-GAN","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rtlee9%2Ffood-GAN/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rtlee9%2Ffood-GAN/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rtlee9%2Ffood-GAN/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rtlee9","download_url":"https://codeload.github.com/rtlee9/food-GAN/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253002841,"owners_count":21838637,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T11:35:42.690Z","updated_at":"2025-05-08T04:50:52.962Z","avatar_url":"https://github.com/rtlee9.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Food GAN\n\nThis repo implements a [Deep Convolutional GAN](https://arxiv.org/abs/1511.06434)(DCGAN) and a [Wasserstein GAN](https://arxiv.org/abs/1701.07875)(WGAN) to generate novel images of food.\n\n## Data\nI [scraped](https://github.com/rtlee9/recipe-box) ~125,000 recipes from various websites for use in this model. Each recipe consists of:\n\n* A recipe title\n* A list of ingredients\n* Preparation instructions\n* An image of the prepared recipe (missing for ~40% of recipes collected)\n\nThese GANs were fitted on the recipe images; they did not utilize the recipe's title, ingredients list, or instructions.\n\n## Sampled outputs\nBelow are a few randomly selected outputs from both the DCGAN and the WGAN:\n\n### DCGAN\n![DCGAN](fake_DCGAN.png)\n\n### WGAN\n![WGAN](fake_WGAN.png)\n\n## Training\nEach model was trained for ~4 hours on an nVidia Tesla K80. The loss curve for the WGAN is depicted below:\n\n### WGAN loss curve\n![WGAN-loss-curve](WGAN_loss_history.png)\n\n## Usage (Python 3.6)\n\n* Clone repo: `git clone https://github.com/rtlee9/food-GAN.git; cd food-GAN`\n* Download images from my Google Cloud Bucket: `wget -P imgs https://storage.googleapis.com/recipe-box/imgs.zip; unzip imgs/imgs.zip -d imgs` (alternatively, see the recipe-box submodule to scrape fresh recipe data)\n* Remove blacklisted images: `./src/rm_blacklist.sh`\n* Train and sample GAN: `python src/pytorch_DCGAN.py --dataset folder --dataroot imgs --outf outputs` or `python src/pytorch_WGAN.py --dataset folder --dataroot imgs --outf outputs`\n\n## Next steps\n\n* Incorporate recipe text (title, ingredients, and instructions) to generate images conditioned on recipe context.\n* Filter out placeholder images prior to training\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frtlee9%2Ffood-gan","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frtlee9%2Ffood-gan","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frtlee9%2Ffood-gan/lists"}