{"id":13563366,"url":"https://github.com/CompVis/brushstroke-parameterized-style-transfer","last_synced_at":"2025-04-03T20:30:45.811Z","repository":{"id":51086295,"uuid":"351868410","full_name":"CompVis/brushstroke-parameterized-style-transfer","owner":"CompVis","description":"TensorFlow implementation of our CVPR 2021 Paper \"Rethinking Style Transfer: From Pixels to Parameterized Brushstrokes\".","archived":false,"fork":false,"pushed_at":"2021-07-16T16:27:38.000Z","size":55935,"stargazers_count":165,"open_issues_count":1,"forks_count":18,"subscribers_count":16,"default_branch":"tensorflow_v1","last_synced_at":"2025-03-21T12:07:16.948Z","etag":null,"topics":["computer-vision","deep-learning","differentiable-rendering","style-transfer"],"latest_commit_sha":null,"homepage":"https://compvis.github.io/brushstroke-parameterized-style-transfer/","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/CompVis.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}},"created_at":"2021-03-26T17:55:50.000Z","updated_at":"2025-02-09T09:11:10.000Z","dependencies_parsed_at":"2022-09-03T13:01:32.804Z","dependency_job_id":null,"html_url":"https://github.com/CompVis/brushstroke-parameterized-style-transfer","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/CompVis%2Fbrushstroke-parameterized-style-transfer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CompVis%2Fbrushstroke-parameterized-style-transfer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CompVis%2Fbrushstroke-parameterized-style-transfer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CompVis%2Fbrushstroke-parameterized-style-transfer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CompVis","download_url":"https://codeload.github.com/CompVis/brushstroke-parameterized-style-transfer/tar.gz/refs/heads/tensorflow_v1","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247074313,"owners_count":20879229,"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":["computer-vision","deep-learning","differentiable-rendering","style-transfer"],"created_at":"2024-08-01T13:01:18.466Z","updated_at":"2025-04-03T20:30:43.546Z","avatar_url":"https://github.com/CompVis.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# Rethinking Style Transfer: From Pixels to Parameterized Brushstrokes (CVPR 2021)\n\n\u003cdiv align=\"center\"\u003e\u003cimg src=\"docs/img/title_figure.jpg\" alt=\"img\" width=\"1050\"\u003e\u003c/div\u003e\n\n### [Project page](https://compvis.github.io/brushstroke-parameterized-style-transfer/) | [Paper](https://arxiv.org/abs/2103.17185) | [Colab](https://colab.research.google.com/drive/1J9B6_G2DSWmaBWw9Ot80W9t7O6pWu8Kw?usp=sharing) | [Colab for Drawing App](https://colab.research.google.com/drive/1ALNRoZgCj35uJ3Xvs24-QDwwtCb2lm3P?usp=sharing)\n\nRethinking Style Transfer: From Pixels to Parameterized Brushstrokes.  \n[Dmytro Kotovenko*](https://scholar.google.de/citations?user=T_U8yxwAAAAJ\u0026hl=en), [Matthias Wright*](http://www.matthias-wright.com/), [Arthur Heimbrecht](http://www.aheimbrecht.de/), and [Björn Ommer](https://hci.iwr.uni-heidelberg.de/people/bommer).\u003cbr\u003e\n*\u0026nbsp;denotes equal contribution \u003cbr\u003e\n\n## Implementations\nWe provide implementations in [Tensorflow 1](https://github.com/CompVis/brushstroke-parameterized-style-transfer/tree/tensorflow_v1) and [Tensorflow 2](https://github.com/CompVis/brushstroke-parameterized-style-transfer/tree/tensorflow_v2). In order to reproduce the results from the paper, we recommend the [Tensorflow 1](https://github.com/CompVis/brushstroke-parameterized-style-transfer/tree/tensorflow_v1) implementation.\n\n## Installation\n1. Clone this repository:\n   ```sh\n   \u003e git clone https://github.com/CompVis/brushstroke-parameterized-style-transfer\n   \u003e cd brushstroke-parameterized-style-transfer\n   ```\n2. Install Tensorflow 1.14 (preferably with GPU support).  \n   If you are using [Conda](https://docs.conda.io/en/latest/index.html), this command will create a new environment and install Tensorflow as well as compatible CUDA and cuDNN versions.\n   ```sh\n   \u003e conda create --name tf14 tensorflow-gpu==1.14\n   \u003e conda activate tf14\n   ```\n3. Install requirements:\n   ```sh\n   \u003e pip install -r requirements.txt\n   ```\n\n## Basic Usage\n```python\nfrom PIL import Image\nimport model\n\ncontent_img = Image.open('images/content/golden_gate.jpg')\nstyle_img = Image.open('images/style/van_gogh_starry_night.jpg')\n\nstylized_img = model.stylize(content_img,\n                             style_img,\n                             num_strokes=5000,\n                             num_steps=100,\n                             content_weight=1.0,\n                             style_weight=3.0,\n                             num_steps_pixel=1000)\n\nstylized_img.save('images/stylized.jpg')\n```\nor open [Colab](https://colab.research.google.com/drive/1J9B6_G2DSWmaBWw9Ot80W9t7O6pWu8Kw?usp=sharing).\n\n## Drawing App\nWe created a [Streamlit](https://streamlit.io/) app where you can draw curves to control the flow of brushstrokes.\n\n\u003cdiv align=\"center\"\u003e\u003cimg src=\"docs/img/streamlit.jpg\" alt=\"img\" width=\"700\"\u003e\u003c/div\u003e\n\n#### Run drawing app on your machine\nTo run the app on your own machine:\n```sh\n\u003e CUDA_VISIBLE_DEVICES=0 streamlit run app.py\n```\n\n\nYou can also run the app on a remote server and forward the port to your local machine:\n[https://docs.streamlit.io/en/0.66.0/tutorial/run_streamlit_remotely.html](https://docs.streamlit.io/en/0.66.0/tutorial/run_streamlit_remotely.html)\n\n\n#### Run streamlit app from Colab\nIf you don't have access to GPUs we also created a [Colab](https://colab.research.google.com/drive/1ALNRoZgCj35uJ3Xvs24-QDwwtCb2lm3P?usp=sharing) from which you can start the drawing app. \n\n## Other implementations\n[PyTorch implementation](https://github.com/justanhduc/brushstroke-parameterized-style-transfer) by [justanhduc](https://github.com/justanhduc).\n\n## Citation\n```\n@article{kotovenko_cvpr_2021,\n    title={Rethinking Style Transfer: From Pixels to Parameterized Brushstrokes},\n    author={Dmytro Kotovenko and Matthias Wright and Arthur Heimbrecht and Bj{\\\"o}rn Ommer},\n    journal={CVPR},\n    year={2021}\n}\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCompVis%2Fbrushstroke-parameterized-style-transfer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FCompVis%2Fbrushstroke-parameterized-style-transfer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCompVis%2Fbrushstroke-parameterized-style-transfer/lists"}