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

Create artificial artwork by transferring the appearance of one image (ie a famous painting) to another user-supplied image (e.g. your favorite photo).

Documentation: https://boromir674.github.io/neural-style-transfer/

Demo Content Image + Demo Style Image = Demo Gen Image

Uses a Neural Style Transfer algorithm to transfer the style (aka appearance), from one image, into the contents of another.

Neural Style Transfer (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 as INPUT a Content image (e.g. a picture taken with your camera) and a Style image (e.g. a Van Gogh painting) and Generates a new image.

Overview

This project provides an NST algorithm through

  • the artificial_artwork Python package (aka module)
  • the nst CLI
  • the boromir674/neural-style-transfer Docker image
Build Package Containerization Code Quality
CI Pipeline Status PyPI Wheel Python Versions Commits Since Docker Image Size Codacy Code Climate Maintainability Scrutinizer

Features

  • VGG-19 Convolutional Neural Network, as Image model
  • Selection of style layers at runtime
  • Efficient Iterative Learning Algorithm, with tensorflow
  • Fast minimization of loss/cost function with parallel/multicore execution
  • Selection of Algorithm Termination Condition/Criteria, at runtime
  • Periodic persistance of Generated image, during Learning loop

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:

Note: Installation on Debian-based Distros for Python 3.11 require distutils which is not included in python3.11 standard distribution (but included in python3.10).

sudo apt-get install python3.11-distutils
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-2.0.0.tar.gz (1.4 MB view details)

Uploaded Source

Built Distribution

artificial_artwork-2.0.0-py3-none-any.whl (76.4 kB view details)

Uploaded Python 3

File details

Details for the file artificial_artwork-2.0.0.tar.gz.

File metadata

  • Download URL: artificial_artwork-2.0.0.tar.gz
  • Upload date:
  • Size: 1.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.0 importlib_metadata/8.5.0 packaging/24.2 pkginfo/1.11.2 requests/2.32.3 requests-toolbelt/1.0.0 tqdm/4.67.0 CPython/3.10.12

File hashes

Hashes for artificial_artwork-2.0.0.tar.gz
Algorithm Hash digest
SHA256 a941f19ce93cddfb873bd9ce238650ba985135a5ac558f230aaa9610903f5b6b
MD5 15622045a49e2837d42fbe88fa734a39
BLAKE2b-256 cb3a3a90b05f6dd31e54e463aad48f8cc35b7f24843a011c60796de674fd81bf

See more details on using hashes here.

File details

Details for the file artificial_artwork-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: artificial_artwork-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 76.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.0 importlib_metadata/8.5.0 packaging/24.2 pkginfo/1.11.2 requests/2.32.3 requests-toolbelt/1.0.0 tqdm/4.67.0 CPython/3.10.12

File hashes

Hashes for artificial_artwork-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4c6fba3d134b611b42bfad52a470165bf07955e4164104cdfcbf5345c09a7ef0
MD5 498b5b8b8b3fd546ecbcce2e2ec036cf
BLAKE2b-256 220854f8b5b800b3ad567cd5426d39c8b9a8854e2562bf4934b0729562c2b7d3

See more details on using hashes here.

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