{"id":13627828,"url":"https://github.com/lyttonhao/Neural-Style-MMD","last_synced_at":"2025-04-17T00:32:37.581Z","repository":{"id":86343075,"uuid":"83523716","full_name":"lyttonhao/Neural-Style-MMD","owner":"lyttonhao","description":"MXNet Code For Demystifying Neural Style Transfer (IJCAI 2017)","archived":false,"fork":false,"pushed_at":"2017-05-12T02:23:55.000Z","size":5791,"stargazers_count":83,"open_issues_count":7,"forks_count":22,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-11-08T18:45:29.747Z","etag":null,"topics":["batch-normalization","maximum-mean-discrepancy","neural-style"],"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/lyttonhao.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}},"created_at":"2017-03-01T07:09:21.000Z","updated_at":"2024-01-04T16:11:54.000Z","dependencies_parsed_at":"2023-03-05T23:15:29.941Z","dependency_job_id":null,"html_url":"https://github.com/lyttonhao/Neural-Style-MMD","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/lyttonhao%2FNeural-Style-MMD","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lyttonhao%2FNeural-Style-MMD/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lyttonhao%2FNeural-Style-MMD/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lyttonhao%2FNeural-Style-MMD/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lyttonhao","download_url":"https://codeload.github.com/lyttonhao/Neural-Style-MMD/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249293082,"owners_count":21245679,"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":["batch-normalization","maximum-mean-discrepancy","neural-style"],"created_at":"2024-08-01T22:00:38.992Z","updated_at":"2025-04-17T00:32:35.761Z","avatar_url":"https://github.com/lyttonhao.png","language":"Python","funding_links":[],"categories":["\u003ca name=\"Vision\"\u003e\u003c/a\u003e2. Vision"],"sub_categories":["2.11 Images Generation"],"readme":"# Neural-Style-MMD\n\nThis repository holds the MXNet code for the paper\n\n\u003e\n**Demystifying Neural Style Transfer**,\nYanghao Li, Naiyan Wang, Jiaying Liu, and Xiaodi Hou,\nInternational Joint Conference on Artificial Intelligence (IJCAI), 2017\n\u003e\n[[Arxiv Preprint](https://arxiv.org/abs/1701.01036)]\n\n\n## Introduction\n\nNeural-Style-MMD presents a neural style transfer algorithm based on a new interpretation. Instead of using Gram matrix in original neural style transfer methods, this repo provides two methods to implement style transfer, including a Maximum Mean Discrepancy (MMD) loss and a Batch Normalization (BN) statistic loss. The paper also demonstrates the original matching Gram matrix is equivalent to the a specific polynomial MMD. Details could be found in the paper. Our implementation is based on the [neural-style example](https://github.com/dmlc/mxnet/tree/master/example/neural-style) of MXNet.\n\n## Prerequisites\n\nBefore running this code, you should make the following preparations:\n\n* Install MXNet following the [instructions](http://mxnet.io/get_started/index.html#setup-and-installation) and install the python interface. This repo is tested on commmit 01cde1.\n\n* Download the pre-trained VGG-19 model in the `model` folder:\n```shell\nwget https://github.com/dmlc/web-data/raw/master/mxnet/neural-style/model/vgg19.params\n```\n\n## Usage\n\nBasic Usage:\n```shell\npython neural-style.py --mmd-kernel linear --gpu 0 --style-weight 5.0 --content-image input/brad_pitt.jpg --style-image input/starry_night.jpg --output brad_pitt-starry_night --output-folder output_images\n```\nWe support 4 single transfer methods, including 3 mmd kernels, including linear, poly and Gaussian, and a BN Statistics Matching method. At the same time, the code supports fusing different transfer methods with specific weights.\n\n**Options**\n* `--mmd-kernel`: Specify MMD kernel (`linear`, `poly`, `Gaussian`), also their combination, e.g. `linear,poly`.\n* `--bn-loss`: Whether to use the BN method. \n* `--multi-weights`: The weights when fusing different transfer methods, e.g. `0.5,0.5`.\n* `--style-weight`: How much to weight the style loss term. It is equivalent to the balance factor gamma in the paper when we fix the `content-weight` as 1.0.\n\nYou can run `python neural-style.py` with `-h` to see more options.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flyttonhao%2FNeural-Style-MMD","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flyttonhao%2FNeural-Style-MMD","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flyttonhao%2FNeural-Style-MMD/lists"}