{ "info": { "author": "ProGamerGov", "author_email": "", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: End Users/Desktop", "Intended Audience :: Science/Research", "Operating System :: OS Independent", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", "Topic :: Artistic Software" ], "description": "# Neural-Tools\nTools made for usage alongside artistic style transfer projects based on the [Controlling Perceptual Factors in Neural Style Transfer](https://arxiv.org/abs/1611.07865) research paper by Leon A. Gatys, Alexander S. Ecker, Matthias Bethge, Aaron Hertzmann, and Eli Shechtman.\n\n**In-depth information about how to perform Scale Control and Color Control, including the Neural-Style parameters used in the examples, can be found on the [wiki](https://github.com/ProGamerGov/Neural-Tools/wiki).** The Color Control feature is broken down into two different features known as Luminance-Only Style Transfer, and Color Matching. The Scale Control feature focuses on separating style image content/shapes, and style image textures. \n\n# Linear Color Transfer\n\nThe `match_color` function's code comes from the very talented Leon Gatys' code [here](https://github.com/leongatys/NeuralImageSynthesis/blob/master/ExampleNotebooks/ScaleControl.ipynb). This script was developed to help enable Scale Control in [Neural-Style](https://github.com/jcjohnson/neural-style), but it can be used for anything else that requires linear color transfer. Supported image formats include: `jpg`, `jpeg`, `png`, `tiff`, etc...\n\nScale Control examples made with [Neural-Style](https://github.com/jcjohnson/neural-style), can be viewed [here](https://github.com/ProGamerGov/Neural-Tools/wiki/Scale-Control-Examples).\n\n### Dependencies: \n\n`sudo apt-get install python-skimage`\n\n`sudo pip install numpy`\n\n`sudo pip install scipy`\n\n### Usage: \n\nBasic usage: \n\n```\npython linear-color-transfer.py --target_image target.png --source_image source.png\n```\n\nAdvanced usage: \n\n```\npython linear-color-transfer.py --target_image target.png --source_image source.png --output_image output.png --mode pca --eps 1e-5\n```\n\n### Parameters: \n\n* `--target_image`: The image you are transfering color to. Ex: `target.png`\n\n* `--source_image`: The image you are transfering color from. Ex: `source.png`\n\n* `--output_image`: The name of your output image. Ex: `output.png`\n\n* `--mode`: The color transfer mode. Options are `pca`, `chol`, or `sym`.\n\n* `--eps`: Your epsilon value in scientific notation or normal notation. Ex: `1e-5` or `0.00001`.\n\n### Examples: \n\n**Source Image:** \n\n![](https://i.imgur.com/eoX7f3Il.jpg)\n\n**Target Image:** \n\n![](https://i.imgur.com/7FPCSril.jpg)\n\n**Output Image:** \n\n![](https://i.imgur.com/STZ0Mspl.png)\n\n**[See here for how to use this script for Scale Control](https://github.com/ProGamerGov/Neural-Tools/wiki/Scale-Control-Examples)**.\n\n![](https://i.imgur.com/fsqGmJfl.png)\n\n\n### Linear Color Transfer is also used for Color Matching Style Transfer:\n\n![](https://i.imgur.com/6xf5c9yl.jpg)\n\n\nSee [here on the wiki](https://github.com/ProGamerGov/Neural-Tools/wiki/Color-Matching), for more details on Color Matching Style Transfer.\n\n---\n\n---\n\n# Luminance Transfer\n\nThis script was developed to help enable colour control in [Neural-Style](https://github.com/jcjohnson/neural-style), also known as \"Luminance Transfer\". This script uses code from Leon Gatys' code [here](https://github.com/leongatys/NeuralImageSynthesis/blob/master/ExampleNotebooks/ColourControl.ipynb). Supported image formats include: `jpg`, `jpeg`, `png`, `tiff`, etc...\n\nLuminance transfer/Color Control examples made with [Neural-Style](https://github.com/jcjohnson/neural-style), can be found [here](https://github.com/ProGamerGov/Neural-Tools/wiki/Color-Control-Examples).\n\n### How It Works: \n\nCurrently, all available models are trained on images with the RGB/BGR color space. An image's luminance can represented in the form of gray scale color space image, which can be converted to RGB format for Neural-Style. After the gray scale images are run through Neural-Style, re-applying the color to your output is done with the use of the LUV color space.\n\nBasically due to pre-trained model limitations, gray scale images are used to transfer luminance, and a color space supporting luminance is used to transfer the colors back to the finished output. \n\n### Dependencies: \n\n`sudo apt-get install python-skimage`\n\n`sudo pip install numpy`\n\n`sudo pip install scipy`\n\n### Usage:\n\nBasic usage: \n\n```\npython lum-transfer.py --content_image content.png --style_image style.png\n```\n\nAdvanced usage: \n\n```\npython lum-transfer.py --cp_mode lum --content_image content.png --style_image style.png --org_content content.png --output_style_image output_style.png --output_content_image output_content.png\n```\n\n### Parameters: \n\nThe required input images and the output images, are dependent on the `--cp_mode` option that you choose: \n\n* `--cp_mode`: The script's mode. Options are `lum`, `lum2`, `match`, `match_style`.\n\n\n**Mode: `lum`**\n\n\n* `--content_image`: Your content image. Ex: `content.png`\n\n* `--style_image`: Your style image. Ex: `style.png`\n\n* `--org_content`: Your original unmodified content image. Ex: `original_content.png`\n\n* `--output_content_image`: The name of your output content image. Ex: `content_output.png`\n\n* `--output_style_image`: The name of your output style image. Ex: `style_output.png`\n\n**Mode: `match`**\n\n* `--content_image`: Your content image. Ex: `content.png`\n\n* `--style_image`: Your style image. Ex: `style.png`\n\n* `--output_style_image`: The name of your output style image. Ex: `style_output.png`\n\n**Mode: `match_style`**\n\n* `--content_image`: Your content image. Ex: `content.png`\n\n* `--style_image`: Your style image. Ex: `style.png`\n\n* `--output_content_image`: The name of your output content image. Ex: `content_output.png`\n\n**Mode: `lum2`**\n\n* `--output_lum2`: The name of your output image from Neural-Style. Ex: `out.png`\n\n* `--org_content`: Your original unmodified content image. Ex: `original_content.png`\n\n* `--output_image`: The name of your output image. Ex: `output.png`\n\n### Examples:\n\n**The style image is adjusted to match the content image:**\n\n![](https://i.imgur.com/Q7phTmel.png)\n\n![](https://i.imgur.com/dRf3yZHl.png)\n\n**After Neural-Style:**\n\n![](https://i.imgur.com/hpW8zufl.png)\n\n**Final ouput image:** \n\n![](https://i.imgur.com/o5HDDtDl.png)\n\n---\n\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/ProGamerGov/Neural-Tools", "keywords": "histogram matching histogram-matching luminance transfer luminance-transfer linear-color-transfer linear color colour", "license": "", "maintainer": "", "maintainer_email": "", "name": "neural-tools", "package_url": "https://pypi.org/project/neural-tools/", "platform": "", "project_url": "https://pypi.org/project/neural-tools/", "project_urls": { "Homepage": "https://github.com/ProGamerGov/Neural-Tools" }, "release_url": "https://pypi.org/project/neural-tools/0.0.2.dev1/", "requires_dist": [ "numpy", "scipy", "scikit-image", "pillow" ], "requires_python": "", "summary": "Luminance and histogram matching tools", "version": "0.0.2.dev1" }, "last_serial": 5621307, "releases": { "0.0.1.dev1": [ { "comment_text": "", "digests": { "md5": "a0fb07b700cad01608e8245553cfd96e", "sha256": "8374bc9bcd14b3105ad13cfe04540d7c23603fd5ab54356f630f8fc8824e20b4" }, "downloads": -1, "filename": "neural_tools-0.0.1.dev1-py3-none-any.whl", "has_sig": false, "md5_digest": "a0fb07b700cad01608e8245553cfd96e", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6575, "upload_time": "2019-08-01T16:57:43", "url": "https://files.pythonhosted.org/packages/e0/8e/6005d86c49e8acaa304773ecdc58b637881726b39d6a68ea52f9dc9c2927/neural_tools-0.0.1.dev1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c005f9676a9905ea3bb3eb684a8e0144", "sha256": "50830454e4d0e70119a63a029569159cced0e74b93a344bba6625e7c547265ff" }, "downloads": -1, "filename": "neural-tools-0.0.1.dev1.tar.gz", "has_sig": false, "md5_digest": "c005f9676a9905ea3bb3eb684a8e0144", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5350, "upload_time": "2019-08-01T16:57:45", "url": "https://files.pythonhosted.org/packages/33/6f/7c4c22dd56a06de12e7ebcb2224d4b5815c8d49f9d4c1de203d6bf17cd60/neural-tools-0.0.1.dev1.tar.gz" } ], "0.0.2.dev1": [ { "comment_text": "", "digests": { "md5": "da3c15a9812f733d2cd9fc6aca58fee8", "sha256": "25a4a4f4c00dcf4f44a80b4133d0310f113e9b441550bb4770e2fc1e8afe8084" }, "downloads": -1, "filename": "neural_tools-0.0.2.dev1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "da3c15a9812f733d2cd9fc6aca58fee8", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 6588, "upload_time": "2019-08-01T23:49:42", "url": "https://files.pythonhosted.org/packages/64/34/a76533eed138f102551f55721ecc605191c7ef4c6cd1e30bd0474d000cff/neural_tools-0.0.2.dev1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a194a6c23b25073f1ce6464d7fa47587", "sha256": "0572d1af90b65ea77cae1ba0da89dae637867a3a67cc0441c318d9c98ab3d246" }, "downloads": -1, "filename": "neural-tools-0.0.2.dev1.tar.gz", "has_sig": false, "md5_digest": "a194a6c23b25073f1ce6464d7fa47587", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5369, "upload_time": "2019-08-01T23:49:44", "url": "https://files.pythonhosted.org/packages/1b/ff/df1796ab17a06dfbc7e12f5729f45807678a711e83f636897601ceb6b6a2/neural-tools-0.0.2.dev1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "da3c15a9812f733d2cd9fc6aca58fee8", "sha256": "25a4a4f4c00dcf4f44a80b4133d0310f113e9b441550bb4770e2fc1e8afe8084" }, "downloads": -1, "filename": "neural_tools-0.0.2.dev1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "da3c15a9812f733d2cd9fc6aca58fee8", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 6588, "upload_time": "2019-08-01T23:49:42", "url": "https://files.pythonhosted.org/packages/64/34/a76533eed138f102551f55721ecc605191c7ef4c6cd1e30bd0474d000cff/neural_tools-0.0.2.dev1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a194a6c23b25073f1ce6464d7fa47587", "sha256": "0572d1af90b65ea77cae1ba0da89dae637867a3a67cc0441c318d9c98ab3d246" }, "downloads": -1, "filename": "neural-tools-0.0.2.dev1.tar.gz", "has_sig": false, "md5_digest": "a194a6c23b25073f1ce6464d7fa47587", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5369, "upload_time": "2019-08-01T23:49:44", "url": "https://files.pythonhosted.org/packages/1b/ff/df1796ab17a06dfbc7e12f5729f45807678a711e83f636897601ceb6b6a2/neural-tools-0.0.2.dev1.tar.gz" } ] }