Skip to main content

Create artificial artwork by transfering the appearance of one image (eg a famous painting) to another user-supplied image (eg your favourite photograph).

Project description

Neural Style Transfer - CLI

Create artificial artwork by transfering the appearance of one image (eg a famous painting) to another user-supplied image (eg your favourite photograph).

Demo Content Image + Demo Style Image
=
Gen Image

Uses a Neural Style Transfer algorithm to transfer the appearance, which you can run though a CLI program.

Neural Style Tranfer (NST) is an algorithm that applies the style of an image to the contents of another and produces a generated image. The idea is to find out how someone, with the painting style shown in one image, would depict the contents shown in another image.

NST takes a content image (eg picture taken with your camera) and a style image (eg a picture of a Van Gogh painting) and produces the generated image.

This Python package runs a Neural Style Tranfer algorithm on input content and style images to produce generated images.

build

CI Pipeline Status Documentation Status Codecov

package

PyPI PyPI - Wheel PyPI - Python Version GitHub commits since tagged version (branch)

containerization

Docker Image Version (tag latest semver) Docker Image Size (tag)

code quality

Codacy Maintainability Technical Debt Scrutinizer code quality

Overview

This package exposes a configurable NST algorithm via a convenient CLI program.

Key features of the package:

  • Selection of style layers at runtime

  • Iterative Learning Algorithm using the VGG Deep Neural Network

  • Selection of iteration termination condition at runtime

  • Fast minimization of loss/cost function with parallel/multicore execution, using Tensorflow

  • Persisting of generated images

Quick-start

Run a demo NST, on sample Content and Style Images:
mkdir art
export NST_HOST_MOUNT="$PWD/art"

docker-compose up

# Process runs, in containerized environment, and exits.
Check out your Generated Image!
Artificial Artwork: art/canoe_water_w300-h225.jpg+blue-red_w300-h225.jpg-100.png
xdg-open art/canoe_water_w300-h225.jpg+blue-red_w300-h225.jpg-100.png

Usage

Run the nst CLI with the –help option to see the available options.

docker run boromir674/neural-style-transfer:1.0.2 --help

Development

Installation

Install nst CLI and artificial_artwork python package from pypi`:

pip install artificial_artwork

Only python3.8 wheel is included atm.

Sample commands to install the NST CLI from source, using a terminal:

git clone https://github.com/boromir674/neural-style-transfer.git

pip install ./neural-style-transfer
The Neural Style Transfer - CLI heavely depends on Tensorflow (tf) and therefore it is crucial that tf is installed correctly in your Python environment.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

artificial_artwork-1.1.0.tar.gz (1.4 MB view hashes)

Uploaded Source

Built Distribution

artificial_artwork-1.1.0-py3-none-any.whl (69.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page