{"id":21228181,"url":"https://github.com/tmabraham/upit","last_synced_at":"2026-03-02T21:06:54.407Z","repository":{"id":40003002,"uuid":"288096687","full_name":"tmabraham/UPIT","owner":"tmabraham","description":"A fastai/PyTorch package for unpaired image-to-image translation.","archived":false,"fork":false,"pushed_at":"2023-05-03T07:24:27.000Z","size":215349,"stargazers_count":135,"open_issues_count":6,"forks_count":21,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-09T22:18:16.310Z","etag":null,"topics":["cyclegan","deep-learning","fastai","image-to-image-translation","nbdev","pytorch"],"latest_commit_sha":null,"homepage":"https://tmabraham.github.io/UPIT","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tmabraham.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2020-08-17T06:03:22.000Z","updated_at":"2025-02-04T01:28:56.000Z","dependencies_parsed_at":"2024-01-11T13:19:44.517Z","dependency_job_id":null,"html_url":"https://github.com/tmabraham/UPIT","commit_stats":{"total_commits":142,"total_committers":5,"mean_commits":28.4,"dds":"0.14084507042253525","last_synced_commit":"a5432140cddc16a48181962da9d02fbba2240550"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":"fastai/nbdev_template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmabraham%2FUPIT","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmabraham%2FUPIT/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmabraham%2FUPIT/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmabraham%2FUPIT/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tmabraham","download_url":"https://codeload.github.com/tmabraham/UPIT/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248119285,"owners_count":21050755,"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":["cyclegan","deep-learning","fastai","image-to-image-translation","nbdev","pytorch"],"created_at":"2024-11-20T23:14:56.688Z","updated_at":"2025-10-25T05:04:07.007Z","avatar_url":"https://github.com/tmabraham.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"Unpaired image-to-image translation\n================\n\n\u003c!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! --\u003e\n\nThis is a package for training and testing unpaired image-to-image\ntranslation models. It currently only includes the\n[CycleGAN](https://junyanz.github.io/CycleGAN/),\n[DualGAN](https://arxiv.org/abs/1704.02510), and\n[GANILLA](https://arxiv.org/abs/2002.05638) models, but other models\nwill be implemented in the future.\n\nThis package uses [fastai](https://github.com/fastai/fastai) to\naccelerate deep learning experimentation. Additionally,\n[nbdev](https://github.com/fastai/nbdev) was used to develop the package\nand produce documentation based on a series of notebooks.\n\n\n[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.7889404.svg)](https://doi.org/10.5281/zenodo.7889404)\n\n## Install\n\nTo install, use `pip`:\n\n`pip install git+https://github.com/tmabraham/UPIT.git`\n\nThe package uses torch 1.7.1, torchvision 0.8.2, and fastai 2.3.0 (and\nits dependencies). It also requires nbdev 1.1.13 if you would like to\nadd features to the package. Finally, for creating a web app model\ninterface, gradio 1.1.6 is used.\n\n## How to use\n\nTraining a CycleGAN model is easy with UPIT! Given the paths of the\nimages from the two domains `trainA_path` and `trainB_path`, you can do\nthe following:\n\n``` python\nfrom upit.data.unpaired import *\nfrom upit.models.cyclegan import *\nfrom upit.train.cyclegan import *\n```\n\n``` python\ndls = get_dls(trainA_path, trainB_path)\ncycle_gan = CycleGAN(3,3,64)\nlearn = cycle_learner(dls, cycle_gan,opt_func=partial(Adam,mom=0.5,sqr_mom=0.999))\nlearn.fit_flat_lin(100,100,2e-4)\n```\n\nThe GANILLA model is only a different generator model architecture\n(that’s meant to strike a better balance between style and content), so\nthe same\n[`cycle_learner`](https://tmabraham.github.io/UPIT/train.cyclegan.html#cycle_learner)\nclass can be used.\n\n``` python\nfrom upit.models.ganilla import *\n```\n\n``` python\nganilla = GANILLA(3,3,64)\nlearn = cycle_learner(dls, ganilla,opt_func=partial(Adam,mom=0.5,sqr_mom=0.999))\nlearn.fit_flat_lin(100,100,2e-4)\n```\n\nFinally, we provide separate functions/classes for\n[`DualGAN`](https://tmabraham.github.io/UPIT/models.dualgan.html#dualgan)\nmodel and training:\n\n``` python\nfrom upit.models.dualgan import *\nfrom upit.train.dualgan import *\n```\n\n``` python\ndual_gan = DualGAN(3,64,3)\nlearn = dual_learner(dls, dual_gan, opt_func=RMSProp)\nlearn.fit_flat_lin(100,100,2e-4)\n```\n\nAdditionally, we provide metrics for quantitative evaluation of the\nmodels, as well as experiment tracking with Weights and Biases. Check\nthe [documentation](https://tmabraham.github.io/UPIT) for more\ninformation!\n\n## Citing UPIT\n\nIf you use UPIT in your research please use the following BibTeX entry:\n```\n@software{Abraham_UPIT_-_A,\n    author = {Abraham, Tanishq Mathew},\n    doi = {10.5281/zenodo.7889405},\n    title = {{UPIT - A fastai/PyTorch package for unpaired image-to-image translation.}},\n    url = {https://github.com/tmabraham/UPIT},\n    version = {0.2.3}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftmabraham%2Fupit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftmabraham%2Fupit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftmabraham%2Fupit/lists"}