{"id":13784208,"url":"https://github.com/naoto0804/pytorch-AdaIN","last_synced_at":"2025-05-11T19:32:32.712Z","repository":{"id":40693742,"uuid":"112338125","full_name":"naoto0804/pytorch-AdaIN","owner":"naoto0804","description":"Unofficial pytorch implementation of 'Arbitrary Style Transfer in Real-time with Adaptive Instance Normalization' [Huang+, ICCV2017]","archived":true,"fork":false,"pushed_at":"2024-01-23T00:48:00.000Z","size":7980,"stargazers_count":1093,"open_issues_count":3,"forks_count":212,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-01-18T20:36:37.214Z","etag":null,"topics":["cnn","instance-normalization","pytorch","style-transfer"],"latest_commit_sha":null,"homepage":"","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/naoto0804.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-11-28T13:21:19.000Z","updated_at":"2025-01-09T15:30:18.000Z","dependencies_parsed_at":"2024-08-03T19:02:52.743Z","dependency_job_id":"885bcde1-a7ce-4713-95a5-072afb158153","html_url":"https://github.com/naoto0804/pytorch-AdaIN","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naoto0804%2Fpytorch-AdaIN","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naoto0804%2Fpytorch-AdaIN/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naoto0804%2Fpytorch-AdaIN/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naoto0804%2Fpytorch-AdaIN/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/naoto0804","download_url":"https://codeload.github.com/naoto0804/pytorch-AdaIN/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253621264,"owners_count":21937496,"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":["cnn","instance-normalization","pytorch","style-transfer"],"created_at":"2024-08-03T19:00:37.199Z","updated_at":"2025-05-11T19:32:31.698Z","avatar_url":"https://github.com/naoto0804.png","language":"Python","funding_links":[],"categories":["Python","2017"],"sub_categories":[],"readme":"# pytorch-AdaIN\n\nThis is an unofficial pytorch implementation of a paper, Arbitrary Style Transfer in Real-time with Adaptive Instance Normalization [Huang+, ICCV2017].\nI'm really grateful to the [original implementation](https://github.com/xunhuang1995/AdaIN-style) in Torch by the authors, which is very useful.\n\n![Results](results.png)\n\n## Requirements\nPlease install requirements by `pip install -r requirements.txt`\n\n- Python 3.5+\n- PyTorch 0.4+\n- TorchVision\n- Pillow\n\n(optional, for training)\n- tqdm\n- TensorboardX\n\n## Usage\n\n### Download models\nDownload decoder.pth / vgg_normalized.pth from [release](https://github.com/naoto0804/pytorch-AdaIN/releases/tag/v0.0.0) and put them under `models/`.\n\n### Test\nUse `--content` and `--style` to provide the respective path to the content and style image.\n```\nCUDA_VISIBLE_DEVICES=\u003cgpu_id\u003e python test.py --content input/content/cornell.jpg --style input/style/woman_with_hat_matisse.jpg\n```\n\nYou can also run the code on directories of content and style images using `--content_dir` and `--style_dir`. It will save every possible combination of content and styles to the output directory.\n```\nCUDA_VISIBLE_DEVICES=\u003cgpu_id\u003e python test.py --content_dir input/content --style_dir input/style\n```\n\nThis is an example of mixing four styles by specifying `--style` and `--style_interpolation_weights` option.\n```\nCUDA_VISIBLE_DEVICES=\u003cgpu_id\u003e python test.py --content input/content/avril.jpg --style input/style/picasso_self_portrait.jpg,input/style/impronte_d_artista.jpg,input/style/trial.jpg,input/style/antimonocromatismo.jpg --style_interpolation_weights 1,1,1,1 --content_size 512 --style_size 512 --crop\n```\n\nSome other options:\n* `--content_size`: New (minimum) size for the content image. Keeping the original size if set to 0.\n* `--style_size`: New (minimum) size for the content image. Keeping the original size if set to 0.\n* `--alpha`: Adjust the degree of stylization. It should be a value between 0.0 and 1.0 (default).\n* `--preserve_color`: Preserve the color of the content image.\n\n\n### Train\nUse `--content_dir` and `--style_dir` to provide the respective directory to the content and style images.\n```\nCUDA_VISIBLE_DEVICES=\u003cgpu_id\u003e python train.py --content_dir \u003ccontent_dir\u003e --style_dir \u003cstyle_dir\u003e\n```\n\nFor more details and parameters, please refer to --help option.\n\nI share the model trained by this code as `iter_1000000.pth\n` at [release](https://github.com/naoto0804/pytorch-AdaIN/releases/tag/v0.0.0).\n\n## References\n- [1]: X. Huang and S. Belongie. \"Arbitrary Style Transfer in Real-time with Adaptive Instance Normalization.\", in ICCV, 2017.\n- [2]: [Original implementation in Torch](https://github.com/xunhuang1995/AdaIN-style)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnaoto0804%2Fpytorch-AdaIN","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnaoto0804%2Fpytorch-AdaIN","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnaoto0804%2Fpytorch-AdaIN/lists"}