Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sfp932705/pastafy
Pastafy yourself and even friends using neural network style transfer.
https://github.com/sfp932705/pastafy
cnn keras keras-tensorflow neural-networks python style-transfer style-transfer-cnn
Last synced: 29 days ago
JSON representation
Pastafy yourself and even friends using neural network style transfer.
- Host: GitHub
- URL: https://github.com/sfp932705/pastafy
- Owner: sfp932705
- License: other
- Created: 2020-09-14T21:22:32.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2020-09-15T14:22:02.000Z (about 4 years ago)
- Last Synced: 2024-09-27T21:01:16.885Z (about 1 month ago)
- Topics: cnn, keras, keras-tensorflow, neural-networks, python, style-transfer, style-transfer-cnn
- Language: Python
- Homepage:
- Size: 3.46 MB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- Changelog: HISTORY.rst
- Contributing: CONTRIBUTING.rst
- License: LICENSE
Awesome Lists containing this project
README
=======
Pastafy
=======.. image:: https://img.shields.io/pypi/v/pastafy.svg
:target: https://pypi.python.org/pypi/pastafy.. image:: https://img.shields.io/travis/sfp932705/pastafy.svg
:target: https://travis-ci.com/sfp932705/pastafy.. image:: https://readthedocs.org/projects/pastafy/badge/?version=latest
:target: https://pastafy.readthedocs.io/en/latest/?badge=latest
:alt: Documentation StatusPastafy anyone.
Ever pictured yourself in a pasta version? Maybe your puppy? Well now you can! Simply select a picture of yourself and a pasta style you may wish to apply.
* Free software: GNU General Public License v3
* Documentation: https://pastafy.readthedocs.io.Features
--------Pastafy brings artificial neural network style transfer from one image to another as described in `A Neural Algorithm of Artistic Style `_.
Quick Use
---------After installation process is complete, call pastafy from the command line. To see a list of available options type:
pastafy -h
-h, - -help show this help message and exit
-g GPU, - -gpu GPU Whether to use GPU or not. Defaults to False.
-i IMG IMG, - -images IMG IMG Images to be used. First one should be the content image (you) and second one the style (kitty). Alternatively, you could specify any desired content and style.
-n ITERS, - -number ITERS Number of iterations. Defaults to 10.
-l LAYER, - -layer LAYER Feature layer to be extracted. Defaults to 4.
-o OUTPUT, - -output OUTPUT Name of output image. Defaults to a concatenation of style image name and content image name.
-r RATIO, - -ratio RATIO Ratio of the weights assigned to the style and content image (Alpha Beta ratio). Defaults to 0.01.
|
|Running *pastafy -i me.jpeg images/pasta.jpg -n 10 -r 0.00001 -l 1* results in the following image:
.. image:: docs/images/cropped_result.png
:align: center|
Play around with the ratio values (keep low) and the feature layer to extract. The more iterations, the more style is applied to the image.
The following images are the results of different layer extractions (1,3,6), from top to bottom, and different ratios (0.001, 0.0001, 0.00001, 0.000001), from left to right.
Notice how the ratio and depth of the layer extracted from the network influence on the style Vs content control?.. image:: docs/images/cropped_results.png
:align: center|
Alternatively, you could use pastafy to transfer styles from famous paintings to other images. Below are some results obtained. The original images are the left-most ones and different styles are applied to these.
.. image:: docs/images/cropped_others.png
:align: centerCredits
-------This package was created with Cookiecutter_ and the `audreyr/cookiecutter-pypackage`_ project template.
Inspired by the `Data Science Group `_.
.. _Cookiecutter: https://github.com/audreyr/cookiecutter
.. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage