{"id":31750530,"url":"https://github.com/emla2805/arbitrary-style-transfer","last_synced_at":"2025-10-09T15:52:52.722Z","repository":{"id":39729006,"uuid":"255267844","full_name":"emla2805/arbitrary-style-transfer","owner":"emla2805","description":"Tensorflow 2 implementation of Arbitrary Style Transfer in Real-time with Adaptive Instance Normalization","archived":false,"fork":false,"pushed_at":"2023-03-25T00:14:34.000Z","size":159661,"stargazers_count":8,"open_issues_count":2,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2023-08-21T15:11:55.174Z","etag":null,"topics":["deep-learning","generative-art","neural-style","style-transfer","tensorflow"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/emla2805.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-04-13T08:10:30.000Z","updated_at":"2023-08-21T15:11:55.175Z","dependencies_parsed_at":"2022-09-20T09:57:13.888Z","dependency_job_id":null,"html_url":"https://github.com/emla2805/arbitrary-style-transfer","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"purl":"pkg:github/emla2805/arbitrary-style-transfer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emla2805%2Farbitrary-style-transfer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emla2805%2Farbitrary-style-transfer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emla2805%2Farbitrary-style-transfer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emla2805%2Farbitrary-style-transfer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/emla2805","download_url":"https://codeload.github.com/emla2805/arbitrary-style-transfer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emla2805%2Farbitrary-style-transfer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279001642,"owners_count":26083147,"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","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["deep-learning","generative-art","neural-style","style-transfer","tensorflow"],"created_at":"2025-10-09T15:52:50.691Z","updated_at":"2025-10-09T15:52:52.717Z","avatar_url":"https://github.com/emla2805.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Arbitrary Style Transfer - AdaIN\n\nTensorflow 2 implementation of [Arbitrary Style Transfer in Real-time with Adaptive Instance Normalization ](https://arxiv.org/abs/1703.06868)\nwhich introduces the _adaptive instance normalization_ (AdaIN) layer, allowing for style transfer of arbitrary style images. \n\nThis implementation is based on the original [Torch implementation](https://github.com/xunhuang1995/AdaIN-style)\nand also on the great unofficial [pytorch implementation](https://github.com/naoto0804/pytorch-AdaIN).\n\n## Examples\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"images/content/avril_cropped.jpg\" width=\"140px\"\u003e\n  \u003cimg src=\"images/style/impronte_d_artista_cropped.jpg\" width=\"140px\"\u003e\n  \u003cimg src=\"images/output/avril_stylized.jpg\" width=\"140px\"\u003e\n  \n  \u003cimg src=\"images/content/cornell_cropped.jpg\" width=\"140px\"\u003e\n  \u003cimg src=\"images/style/woman_with_hat_matisse_cropped.jpg\" width=\"140px\"\u003e\n  \u003cimg src=\"images/output/cornell_stylized.jpg\" width=\"140px\"\u003e\n\u003c/div\u003e\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"images/content/stockholm_cropped.jpg\" width=\"140px\"\u003e\n  \u003cimg src=\"images/style/ashville_cropped.jpg\" width=\"140px\"\u003e\n  \u003cimg src=\"images/output/stockholm_stylized.jpg\" width=\"140px\"\u003e\n  \n  \u003cimg src=\"images/content/sailboat_cropped.jpg\" width=\"140px\"\u003e\n  \u003cimg src=\"images/style/sketch_cropped.png\" width=\"140px\"\u003e\n  \u003cimg src=\"images/output/sailboat_stylized.jpg\" width=\"140px\"\u003e\n\u003c/div\u003e\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"images/content/modern_cropped.jpg\" width=\"140px\"\u003e\n  \u003cimg src=\"images/style/goeritz_cropped.jpg\" width=\"140px\"\u003e\n  \u003cimg src=\"images/output/modern_stylized.jpg\" width=\"140px\"\u003e\n  \n  \u003cimg src=\"images/content/lenna_cropped.jpg\" width=\"140px\"\u003e\n  \u003cimg src=\"images/style/en_campo_gris_cropped.jpg\" width=\"140px\"\u003e\n  \u003cimg src=\"images/output/lenna_stylized.jpg\" width=\"140px\"\u003e\n\u003c/div\u003e\n\n## Requirements\n\nCreate a Python 3.7 virtual environment and activate it:\n\n```bash\nvirtualenv -p python3.7 venv\nsource ./venv/bin/activate\n```\n\nNext, install the required dependencies:\n\n```bash\npip install -r requirements.txt\n```\n\n## Usage\n\nTo style an image using a pre-trained model specify the content and style image as well\nas the directory of the model checkpoint.\n\n### Style image\n\n```bash\npython style.py \\\n    --log-dir model/ \\\n    --content-image images/content/avril_cropped.jpg \\\n    --style-image images/style/impronte_d_artista_cropped.jpg \\\n    --output-image images/output/avril_stylized.jpg \\\n    --alpha 1.0\n```\n\nThe `alpha` parameter makes it possible to control the level of \nstylization of the content image. Varying `alpha` between 0 and 1 (default):\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"images/content/chicago_cropped.jpg\" width=\"256px\" align=\"top\"\u003e\n  \u003cimg src=\"images/output/chicago_varying_alpha.gif\" width=\"256px\" align=\"top\"\u003e\n  \u003cimg src=\"images/style/ashville_cropped.jpg\" width=\"256px\" align=\"top\"\u003e\n\u003c/div\u003e\n \n\n### Train model\n\nTraining requires both the [MSCOCO](http://mscoco.org/dataset/#download) and the WikiArt datasets, the first one\nis automatically downloaded and converted to tfrecords using [Tensorflow datasets](https://www.tensorflow.org/datasets).\nThe style images however needs to be downloaded from [here](https://www.kaggle.com/c/painter-by-numbers).\n\nTo start training, simply run:\n\n```bash\npython train.py \\\n    --style-dir WIKIART_IMAGE_DIR \\\n    --log-dir model/\n```\nwhere `WIKIART_IMAGE_DIR` is the location of the WikiArt images.\nTraining `160 000` steps with default parameters takes about 6 hours on a Tesla P100 GPU.\n\nTo track metrics and see style progress, start `Tensorboard`\n\n```bash\ntensorboard --logdir model/\n```\n\nand navigate to [localhost:6006](localhost:6006).\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femla2805%2Farbitrary-style-transfer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Femla2805%2Farbitrary-style-transfer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femla2805%2Farbitrary-style-transfer/lists"}