{"id":20503184,"url":"https://github.com/curt-park/style_transfer_keras","last_synced_at":"2026-04-10T01:45:58.072Z","repository":{"id":134252468,"uuid":"122803539","full_name":"Curt-Park/style_transfer_keras","owner":"Curt-Park","description":"Style Transfer with Keras","archived":false,"fork":false,"pushed_at":"2018-03-05T15:18:28.000Z","size":12137,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-16T07:30:04.049Z","etag":null,"topics":["convolutional-neural-networks","deep-learning","image-processing","keras","python","scipy","style-transfer"],"latest_commit_sha":null,"homepage":null,"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/Curt-Park.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-02-25T04:01:00.000Z","updated_at":"2018-10-17T05:17:36.000Z","dependencies_parsed_at":null,"dependency_job_id":"9590c710-2519-49eb-bbf0-99183aead504","html_url":"https://github.com/Curt-Park/style_transfer_keras","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/Curt-Park%2Fstyle_transfer_keras","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Curt-Park%2Fstyle_transfer_keras/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Curt-Park%2Fstyle_transfer_keras/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Curt-Park%2Fstyle_transfer_keras/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Curt-Park","download_url":"https://codeload.github.com/Curt-Park/style_transfer_keras/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242100015,"owners_count":20071642,"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":["convolutional-neural-networks","deep-learning","image-processing","keras","python","scipy","style-transfer"],"created_at":"2024-11-15T19:29:37.438Z","updated_at":"2025-12-07T01:01:51.438Z","avatar_url":"https://github.com/Curt-Park.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Style Transfer with Keras\n\nThis is a Keras implementation of style transfer techniques described in the following paper:\n- [Image Style Transfer Using Convolutional Neural Networks](https://www.cv-foundation.org/openaccess/content_cvpr_2016/papers/Gatys_Image_Style_Transfer_CVPR_2016_paper.pdf) by Leon A. Gatys, Alexander S. Ecker, Matthias Bethge\n\n## Differences from the paper\n\nAll differences are marked with comments that start with '! the original paper ...'\n- The CNN Model: VGG16 is used instead of VGG19. \n- The loss function for style representations: It is divided by (2. *  feature map size * channel number).\n- The initial canvas: a content image.\n\nThey make better results on my implementation rather than the settings suggested by the original paper, empirically.\n\n## Developed with\n- Keras 2.1.2\n- Python 3.6.3\n- Python packages: numpy, scipy, PIL\n\n## How to run\n```bash\npython style_transfer.py [options]\n```\n\n## Options\n```bash\n$ python style_transfer.py --help\nusage: style_transfer.py [-h] [--content CONTENT] [--style STYLE]\n                         [--output OUTPUT] [--iteration ITERATION]\n                         [--loss_ratio LOSS_RATIO]\n                         [--initialization {random,content,style}]\n                         [--save_image_every_nth SAVE_IMAGE_EVERY_NTH]\n                         [--verbose VERBOSE]\n\noptional arguments:\n  -h, --help            show this help message and exit\n  --content CONTENT     The path of the content image (Default: './images/content/tubingen.jpg')\n  --style STYLE         The path of the style image (Default: './images/style/shipwreck.jpg')\n  --output OUTPUT       The directory path for results (Default: './outputs/')\n  --iteration ITERATION\n                        How many iterations you need to run (Default: 1000)\n  --loss_ratio LOSS_RATIO\n                        The ratio between content and style -\u003e content / style (Default: 1e-3)\n  --initialization {random,content,style}\n                        The initial canvas (Default: 'content')\n  --save_image_every_nth SAVE_IMAGE_EVERY_NTH\n                        Save image every nth iteration (Default: 10)\n  --verbose VERBOSE     Print reports (Default: True)\n```\n\n## File descriptions\n```bash\n├── image/\n│   ├── content/ # content images\n│   ├── style/ # style images\n│   └── results/ # outcomes from style-transfer\n├── style_transfer.py\n└── utils.py\n```\n\n## Sample Results\nAll examples are obtained by default settings.\n\n### Reproduction\nThe attempt to reproduce Figure 3 of the paper, which renders a photograph of the Neckarfront in Tübingen, Germany in the style of 5 different paintings. + You can see the generating progress video by clicking the image.\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"images/content/tubingen.jpg\" height=\"192px\"\u003e\n\u003ca href=\"http://www.youtube.com/watch?feature=player_embedded\u0026v=t28Ph3AcW4s\n         \" target=\"_blank\"\u003e\u003cimg src=\"images/results/tubingen_shipwreck.jpg\" height=\"192px\"\u003e\u003c/a\u003e\n\u003ca href=\"http://www.youtube.com/watch?feature=player_embedded\u0026v=Mdw70lntGaI\n         \" target=\"_blank\"\u003e\u003cimg src=\"images/results/tubingen_starrynigt.jpg\" height=\"192px\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n\u003ca href=\"http://www.youtube.com/watch?feature=player_embedded\u0026v=aq217zlyBlc\n         \" target=\"_blank\"\u003e\u003cimg src=\"images/results/tubingen_kandinsky.jpg\" height=\"192px\"\u003e\u003c/a\u003e\n\u003ca href=\"http://www.youtube.com/watch?feature=player_embedded\u0026v=l-I0gU3CrG0\n         \" target=\"_blank\"\u003e\u003cimg src=\"images/results/tubingen_scream.jpg\" height=\"192px\"\u003e\u003c/a\u003e\n\u003ca href=\"http://www.youtube.com/watch?feature=player_embedded\u0026v=nIvjrYaG3q4\n         \" target=\"_blank\"\u003e\u003cimg src=\"images/results/tubingen_seatednude.jpg\" height=\"192px\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\nTop Row (left to right): [No style](images/content/tubingen.jpg), [The Shipwreck of the Minotaur](images/style/shipwreck.jpg), [The Starry Night](images/style/starry-night.jpg)\n\nBottom Row (left to right): [Composition VII](images/style/kandinsky.jpg), [The Scream](images/style/the_scream.jpg), [Seated Nude](images/style/seated-nude.jpg)\n\n### More trials\nThese are more trials on my son's photo. As above, the generating progress videos will be played by clicking the images.\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"images/content/my_son.JPG\" height=\"192px\"\u003e\n\u003ca href=\"http://www.youtube.com/watch?feature=player_embedded\u0026v=WLvGm49B5Vo\n         \" target=\"_blank\"\u003e\u003cimg src=\"images/results/myson_girlbeforeamirror.jpg\" height=\"192px\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n\u003ca href=\"http://www.youtube.com/watch?feature=player_embedded\u0026v=AqL7rVArnjk\n         \" target=\"_blank\"\u003e\u003cimg src=\"images/results/myson_hokusai.jpg\" height=\"192px\"\u003e\u003c/a\u003e\n\u003ca href=\"http://www.youtube.com/watch?feature=player_embedded\u0026v=q1WJWg8HRQg\n         \" target=\"_blank\"\u003e\u003cimg src=\"images/results/myson_hunminjungum.jpg\" height=\"192px\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\nTop Row (left to right): [No style](images/content/my_son.JPG), [Girl before a mirror](images/style/girl_before_a_mirror.jpg)\n\nBottom Row (left to right): [Hokusai](images/style/hokusai.jpg), [훈민정음](images/style/hunminjungum.jpg)\n\n## References\n### Paper\n- [Image Style Transfer Using Convolutional Neural Networks](https://www.cv-foundation.org/openaccess/content_cvpr_2016/papers/Gatys_Image_Style_Transfer_CVPR_2016_paper.pdf) by Leon A. Gatys, Alexander S. Ecker, Matthias Bethge\n\n### Implementation\n- [Keras examples](https://github.com/keras-team/keras/blob/master/examples/neural_style_transfer.py) by Keras Team\n- [Keras based Neural Style Transfer](https://github.com/giuseppebonaccorso/Neural_Artistic_Style_Transfer) by giuseppebonaccorso\n- [Fast AI's Deep learning course](https://github.com/fastai/courses/blob/master/deeplearning2/neural-style.ipynb) by Fast AI\n- [Tensorflow Style-Transfer](https://github.com/hwalsuklee/tensorflow-style-transfer) by Hwalsuk Lee\n- [TensorFlow (Python API) implementation of Neural Style](https://github.com/cysmith/neural-style-tf) by cysmith\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcurt-park%2Fstyle_transfer_keras","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcurt-park%2Fstyle_transfer_keras","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcurt-park%2Fstyle_transfer_keras/lists"}