Metadata-Version: 2.1
Name: artificial-artwork
Version: 2.0.0
Summary: Create artificial artwork by transfering the appearance of one image (eg a famous painting) to another user-supplied image (eg your favourite photograph).
Home-page: https://github.com/boromir674/neural-style-transfer
License: AGPL-3.0-only
Keywords: artificial intelligence,neural style transfer,artificial art,deep learning,cli,gui
Author: Konstantinos Lampridis
Author-email: k.lampridis@hotmail.com
Maintainer: Konstantinos Lampridis
Maintainer-email: k.lampridis@hotmail.com
Requires-Python: >=3.10,<3.12
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: End Users/Desktop
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: GNU Affero General Public License v3
Classifier: Natural Language :: English
Classifier: Operating System :: MacOS
Classifier: Operating System :: POSIX :: Linux
Classifier: Operating System :: Unix
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Topic :: Artistic Software
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Scientific/Engineering :: Image Processing
Classifier: Topic :: Software Development
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: System :: Software Distribution
Classifier: Typing :: Typed
Provides-Extra: docs
Provides-Extra: gui
Provides-Extra: test
Requires-Dist: attrs (>=23.1.0,<24.0.0)
Requires-Dist: click (>=8.1.7,<9.0.0)
Requires-Dist: cython (>=3.0.2,<4.0.0)
Requires-Dist: griffe (>=1.5.1,<2.0.0) ; extra == "docs"
Requires-Dist: imageio (>=2.10.1,<2.11.0)
Requires-Dist: matplotlib (>=3.7,<3.8) ; extra == "gui"
Requires-Dist: mkdocs (>=1.5.3,<2.0.0) ; extra == "docs"
Requires-Dist: mkdocs-click (>=0.8.1,<0.9.0) ; extra == "docs"
Requires-Dist: mkdocs-gen-files (>=0.5.0,<0.6.0) ; extra == "docs"
Requires-Dist: mkdocs-literate-nav (>=0.6.1,<0.7.0) ; extra == "docs"
Requires-Dist: mkdocs-macros-plugin (>=1.0.5,<2.0.0) ; extra == "docs"
Requires-Dist: mkdocs-material (>=9.4.8,<10.0.0) ; extra == "docs"
Requires-Dist: mkdocs-mermaid2-plugin (>=1.1.1,<2.0.0) ; extra == "docs"
Requires-Dist: mkdocs-section-index (>=0.3.8,<0.4.0) ; extra == "docs"
Requires-Dist: mkdocstrings (>=0.26.2,<0.27.0) ; extra == "docs"
Requires-Dist: mkdocstrings-python (>=1.12.2,<2.0.0) ; extra == "docs"
Requires-Dist: numpy (>=1,<2)
Requires-Dist: protobuf (>=3.19.1,<4.0.0)
Requires-Dist: pymdown-extensions (>=10.4,<11.0) ; extra == "docs"
Requires-Dist: pytest (>=7.4.2,<8.0.0) ; extra == "test"
Requires-Dist: pytest-click (>=1.1.0,<2.0.0) ; extra == "test"
Requires-Dist: pytest-cov (>=4.1.0,<5.0.0) ; extra == "test"
Requires-Dist: pytest-explicit (>=1.0.1,<2.0.0) ; extra == "test"
Requires-Dist: pytest-xdist (>=3.3.1,<4.0.0) ; extra == "test"
Requires-Dist: scipy (>=1.4.1,<2.0.0)
Requires-Dist: software-patterns (>=2.0.0,<3.0.0)
Requires-Dist: tensorflow (>=2.2.0,<3.0.0)
Project-URL: Bug Tracker, https://github.com/boromir674/neural-style-transfer/issues
Project-URL: CI: Github Actions, https://github.com/boromir674/neural-style-transfer/actions
Project-URL: Changelog, https://github.com/boromir674/neural-style-transfer/blob/master/CHANGELOG.rst
Project-URL: Documentation, https://neural-style-transfer.readthedocs.io/
Project-URL: Repository, https://github.com/boromir674/neural-style-transfer
Project-URL: Source Code, https://github.com/boromir674/neural-style-transfer
Description-Content-Type: text/markdown

# 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/](https://boromir674.github.io/neural-style-transfer/)

<div style="display: flex; align-items: center; margin-bottom: 25px;">
    <img src="./tests/data/canoe_water_w300-h225.jpg" alt="Demo Content Image" style="vertical-align: middle;">
    <span style="margin: 0 10px; font-size: 24px; vertical-align: middle;">+</span>
    <img src="./tests/data/blue-red_w300-h225.jpg" alt="Demo Style Image" style="vertical-align: middle;">
    <span style="margin: 0 10px; font-size: 24px; vertical-align: middle;">=</span>
    <img src="./tests/data/canoe_water_w300-h225.jpg+blue-red_w300-h225.jpg-100-demo-gui-run-1.png" alt="Demo Gen Image" style="vertical-align: middle;">
</div>

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**

<!-- This package exposes a configurable NST algorithm via a convenient CLI program. -->

| Build | Package | Containerization | Code Quality |
|-------|---------|------------------|--------------|
| ![CI Pipeline Status][ci-pipeline-status] | ![PyPI][pypi] ![Wheel][wheel] ![Python Versions][python-versions] ![Commits Since][commits-since] | ![Docker][docker] ![Image Size][image-size] | ![Codacy][codacy] ![Code Climate][code-climate] ![Maintainability][maintainability] ![Scrutinizer][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:

```sh
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

```shell
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.

```shell
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).

```shell
sudo apt-get install python3.11-distutils
```

```shell
pip install artificial_artwork
```

Only python3.8 wheel is included atm.


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

```shell
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.


[ci-pipeline-status]: https://img.shields.io/github/actions/workflow/status/boromir674/neural-style-transfer/test.yaml?branch=main&label=build&logo=github-actions&logoColor=233392FF
[pypi]: https://img.shields.io/pypi/v/artificial-artwork?color=blue&label=pypi&logo=pypi&logoColor=%23849ed9
[wheel]: https://img.shields.io/pypi/wheel/artificial-artwork?logo=python&logoColor=%23849ed9
[python-versions]: https://img.shields.io/pypi/pyversions/artificial-artwork?color=blue&logo=python&logoColor=%23849ed9
[commits-since]: https://img.shields.io/github/commits-since/boromir674/neural-style-transfer/v2.0.0/main?color=blue&logo=Github
[docker]: https://img.shields.io/docker/v/boromir674/neural-style-transfer/latest?logo=docker&logoColor=%23849ED9
[image-size]: https://img.shields.io/docker/image-size/boromir674/neural-style-transfer/latest?logo=docker&logoColor=%23849ED9
[codacy]: https://app.codacy.com/project/badge/Grade/07b27ac547a94708aefc5e845d2b6d01
[code-climate]: https://api.codeclimate.com/v1/badges/2ea98633f88b75e87d1a/maintainability
[maintainability]: https://img.shields.io/codeclimate/tech-debt/boromir674/neural-style-transfer?logo=CodeClimate
[scrutinizer]: https://img.shields.io/scrutinizer/quality/g/boromir674/neural-style-transfer/main?logo=scrutinizer-ci


