Skip to content

Commit

Permalink
[NEW] Artificial Artwork v1.0.1-dev
Browse files Browse the repository at this point in the history
Neural Style Transfer v1.0.1-dev Release marked as a 'pre-release', since it only includes CI and Docs changes.
  • Loading branch information
boromir674 committed Oct 31, 2023
2 parents 3525aea + 3eec4b0 commit b25488e
Show file tree
Hide file tree
Showing 8 changed files with 266 additions and 110 deletions.
132 changes: 86 additions & 46 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
# set the matrix strategy to Full Matrix Stress Test if on master/main or stress-test branch or any tag
BRANCH_NAME=${GITHUB_REF_NAME}
if [[ $BRANCH_NAME == "master" || $BRANCH_NAME == "main" || $BRANCH_NAME == "stress-test" || $GITHUB_REF == refs/tags/* ]]; then
echo "matrix=$FULL_MATRIX_STRATEGY" >> $GITHUB_OUTPUT
echo "matrix=$UBUNTU_PY38_STRATEGY" >> $GITHUB_OUTPUT
else
echo "matrix=$UBUNTU_PY38_STRATEGY" >> $GITHUB_OUTPUT
fi
Expand All @@ -75,8 +75,13 @@ jobs:
matrix: ${{fromJSON(needs.set_github_outputs.outputs.matrix)}}
outputs:
SEMVER_PIP_FORMAT: ${{ steps.parse_version.outputs.SEMVER_PIP_FORMAT }}
# CI_COVERAGE_XML: ${{ steps.produce_coverage_xml_file.outputs.CI_COVERAGE_XML }}
# can be used in Other Jobs as for example
# needs: [test_suite]
# environment:
# name: ${{ needs.test_suite.outputs.CI_COVERAGE_XML }}
steps:
- run: echo "Platform -> ${{ matrix.platform }} , Python -> ${{ matrix.python-version }}"
- run: echo "[INFO] Platform/OS ${{ matrix.platform }} , Python -> ${{ matrix.python-version }}"
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
Expand All @@ -102,69 +107,104 @@ jobs:
WHEEL_VERSION="${WHEEL_VERSION}0"
fi
echo "==== $PARSED_VERSION --> $WHEEL_VERSION"
echo "PKG_VERSION=$WHEEL_VERSION" >> $GITHUB_ENV # to be used in the next step
# to be used in the next step
echo "PKG_VERSION=$WHEEL_VERSION" >> $GITHUB_ENV
echo "SEMVER_PIP_FORMAT=$WHEEL_VERSION" >> $GITHUB_OUTPUT # to be used in other jobs
## TEST SUITE: By Default executes only unit-tests (ie no integration, or network-dependent tests)
- name: Run Unit Tests
run: tox -vv -s false
env:
PLATFORM: ${{ matrix.platform }}
- name: "Combine Coverage (dev, sdist, wheel) & make Reports"
run: tox -e coverage --sitepackages -vv -s false
# if sdist tests ran, then we expect file to ahve been created
# .tox/${DIST_DIR}/cookiecutter_python-${PKG_VERSION}.tar.gz

- name: Rename Coverage Files
shell: bash
# if wheel tests ran, then we expect a file similar to below, to
# have been created. the file depends on the python version
# compiled (cpu architecture specific code)

# the below exaple is what to expect from 'pure python' build (
# meaning in theory there is no machine/cpu-specific code, no byte code,
# no compiled code
# .tox/${DIST_DIR}/cookiecutter_python-${PKG_VERSION}-py3-none-any.whl

- name: "Aggregate Code Coverage & make XML Reports"
id: produce_coverage_xml_file
env:
# just "destructure" (aka extract) needed values from the matrix, to use in step code
PLATFORM: ${{ matrix.platform }}
PY_VERSION: ${{ matrix.python-version }}
run: |
mv ./.tox/coverage.xml ./coverage-${{ matrix.platform }}-${{ matrix.python-version }}.xml
tox -e coverage --sitepackages -vv -s false
RUNNER_COVERAGE_XML_FILE_PATH="coverage-${PLATFORM}-${PY_VERSION}.xml"
mv ./.tox/coverage.xml "${RUNNER_COVERAGE_XML_FILE_PATH}"
# leverages ./scripts/post-tests-run.sh which returns the path of the XML Aggregated Coverage DataXML Filecoverage report
# chmod +x ./scripts/post-tests-run.sh
# RUNNER_COVERAGE_XML_FILE_PATH=$(./scripts/post-tests-run.sh "${PLATFORM}-${PY_VERSION}")
echo "CI_COVERAGE_XML=$RUNNER_COVERAGE_XML_FILE_PATH" >> $GITHUB_OUTPUT
echo "CI_COVERAGE_XML_THIS=$RUNNER_COVERAGE_XML_FILE_PATH" >> $GITHUB_ENV
- name: "Upload Test Coverage as Artifacts"
uses: actions/upload-artifact@v3
with:
name: all_coverage_raw
path: coverage-${{ matrix.platform }}-${{ matrix.python-version }}.xml
path: ${{ env.CI_COVERAGE_XML_THIS }}
# steps.produce_coverage_xml_file.outputs.retval
# path: coverage-${{ matrix.platform }}-${{ matrix.python-version }}.xml
if-no-files-found: error
# - name: Check for compliance with Python Best Practices
# shell: bash
# run: |
# DIST_DIR=dist
# echo "DIST_DIR=dist" >> $GITHUB_ENV
# mkdir ${DIST_DIR}
# mv ".tox/${DIST_DIR}/artificial_artwork-${PKG_VERSION}.tar.gz" "${DIST_DIR}"
# mv ".tox/${DIST_DIR}/artificial_artwork-${PKG_VERSION}-py3-none-any.whl" "${DIST_DIR}"
# tox -e check -vv -s false

- name: Check for compliance with Python Best Practices
shell: bash
run: |
DIST_DIR=dist
echo "DIST_DIR=dist" >> $GITHUB_ENV # can be uesd in a with body of a next step in the Job, as eg: path: ${{ env.DIST_DIR }}
mkdir ${DIST_DIR}
mv ".tox/${DIST_DIR}/artificial_artwork-${PKG_VERSION}.tar.gz" "${DIST_DIR}"
# mv ".tox/${DIST_DIR}/artificial_artwork-${PKG_VERSION}-py3-none-any.whl" "${DIST_DIR}"
tox -e check -vv -s false
# - name: Install documentation test dependencies
# if: ${{ matrix.platform == 'macos-latest' && matrix.python-version != '3.6' }}
# run: brew install enchant
# - name: Run Documentation Tests
# if: ${{ matrix.platform == 'ubuntu-latest' || matrix.python-version != '3.6' }}
# run: tox -e docs --sitepackages -vv -s false
# - name: Upload Source & Wheel distributions as Artefacts
# uses: actions/upload-artifact@v3
# with:
# name: dist-${{ matrix.platform }}-${{ matrix.python-version }}
# path: ${{ env.DIST_DIR }}
# if-no-files-found: error

# codecov_coverage_host:
# runs-on: ubuntu-latest
# needs: test_suite
# steps:
# - uses: actions/checkout@v3
# - name: Get Codecov binary
# run: |
# curl -Os https://uploader.codecov.io/latest/linux/codecov
# chmod +x codecov
# - name: Download Raw Coverage Data Artefacts
# uses: actions/download-artifact@v3
# with:
# name: all_coverage_raw
# - name: Upload Coverage Reports to Codecov
# run: |
# for file in coverage*.xml; do
# OS_NAME=$(echo $file | sed -E "s/coverage-(\w\+)-/\1/")
# PY_VERSION=$(echo $file | sed -E "s/coverage-\w\+-(\d\.)\+/\1/")
# ./codecov -f $file -e "OS=$OS_NAME,PYTHON=$PY_VERSION" --flags unittests --verbose
# echo "Sent to Codecov: $file !"
# done
- name: Upload Source & Wheel distributions as Artefacts
uses: actions/upload-artifact@v3
with:
name: ${{ env.DIST_DIR }}-${{ matrix.platform }}-${{ matrix.python-version }}
path: ${{ env.DIST_DIR }}
if-no-files-found: error


codecov_coverage_host:
runs-on: ubuntu-latest
needs: test_suite
env:
PACKAGE_DIST_VERSION: ${{ needs.test_suite.outputs.SEMVER_PIP_FORMAT }}
steps:
- uses: actions/checkout@v3
- name: Get Codecov binary
run: |
curl -Os https://uploader.codecov.io/latest/linux/codecov
chmod +x codecov
- name: Download Raw Coverage Data Artefacts
uses: actions/download-artifact@v3
with:
name: all_coverage_raw
- name: Upload Coverage Reports to Codecov
run: |
for file in coverage*.xml; do
OS_NAME=$(echo $file | sed -E "s/coverage-(\w\+)-/\1/")
PY_VERSION=$(echo $file | sed -E "s/coverage-\w\+-(\d\.)\+/\1/")
./codecov -f $file -e "OS=$OS_NAME,PYTHON=$PY_VERSION" --flags unittests --verbose
echo "Sent to Codecov: $file !"
done
# DOCKER BUILD AND PUBLISH ON DOCKERHUB
docker_build:
Expand Down Expand Up @@ -238,7 +278,7 @@ jobs:
name: ${{ needs.check_which_git_branch_we_are_on.outputs.ENVIRONMENT_NAME }}
env:
DIST_DIR: dist
PACKAGE_DIST_VERSION: ${{ needs.test_suite.outputs.SEMVER_PIP_FORMAT }}
PACKAGE_DIST_VERSION: ${{ needs.test_suite.outputs.SEMVER_PIP_FORMAT }} # required env var by deploy script (tox -e deploy)
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
PYPI_SERVER: ${{ vars.PYPI_SERVER }}
Expand Down
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
# Changelog


## 1.0.1-dev (2023-10-31)

Revive CI Pipeline

### Changes

##### documentation
- update badges refs and urls
- add CI Pipeline Status Badge in README
- show Demo Content Image + Style Image = Generated Image

##### ci
- Upload Code Coverage Data to Codecov.io, resulted from Test Suite runs


## 1.0.0 (2023-10-29)

- Prototype GUI Client
Expand Down
55 changes: 34 additions & 21 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ 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|
| =
| |Demo_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.
Expand All @@ -13,14 +17,13 @@ NST takes a `content` image (eg picture taken with your camera) and a `style` im

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


.. start-badges
.. list-table::
:stub-columns: 1

* - tests
- | |circleci| |codecov|
- | |ci_pipeline| |codecov|

* - package
- | |pypi| |wheel| |py_versions| |commits_since|
Expand All @@ -29,7 +32,7 @@ This Python package runs a Neural Style Tranfer algorithm on input `content` and
- | |docker| |image_size|

* - code quality
- |better_code_hub| |codacy| |code_climate| |maintainability| |scrutinizer|
- |codacy| |code_climate| |maintainability| |scrutinizer|



Expand Down Expand Up @@ -154,20 +157,24 @@ and the pretrained model are present. That way you can immediately start creatin

docker run -it --rm -v $NST_OUTPUT:/nst-output boromir674/neural-style-transfer $STYLE $CONTENT --iteratins 200 --location /nst-output

.. |ci_pipeline| image:: https://img.shields.io/github/actions/workflow/status/boromir674/neural-style-transfer/test.yaml?branch=master&label=build&logo=github-actions&logoColor=233392FF
:alt: CI Pipeline Status
:target: https://github.com/boromir674/neural-style-transfer/actions?query=branch%3Amaster++


.. |github_actions_ci| image:: https://img.shields.io/github/actions/workflow/status/boromir674/neural-style-transfer/test.yaml?link=https%3A%2F%2Fgithub.com%2Fboromir674%2Fneural-style-transfer%2Factionsbranch=master
:alt: GitHub Workflow Status
:target: https://github.com/boromir674/neural-style-transfer/actions?query=branch%3Amaster++

.. |circleci| image:: https://img.shields.io/circleci/build/github/boromir674/neural-style-transfer/master?logo=circleci
:alt: CircleCI
:target: https://circleci.com/gh/boromir674/neural-style-transfer/tree/master


.. |codecov| image:: https://codecov.io/gh/boromir674/neural-style-transfer/branch/master/graph/badge.svg?token=3POTVNU0L4
.. |codecov| image:: https://codecov.io/gh/boromir674/neural-style-transfer/branch/master/graph/badge.svg
:alt: Codecov
:target: https://app.codecov.io/gh/boromir674/neural-style-transfer/branch/master
:target: https://app.codecov.io/gh/boromir674/neural-style-transfer/tree/master



.. |pypi| image:: https://img.shields.io/pypi/v/artificial-artwork?color=blue&label=pypi&logo=pypi&logoColor=%23849ed9
:alt: PyPI
:target: https://pypi.org/project/artificial-artwork/
Expand All @@ -180,15 +187,14 @@ and the pretrained model are present. That way you can immediately start creatin
:alt: PyPI - Python Version
:target: https://pypi.org/project/artificial-artwork

.. |commits_since| image:: https://img.shields.io/github/commits-since/boromir674/neural-style-transfer/v1.0.0/master?color=blue&logo=Github
:alt: GitHub commits since tagged version (branch)
:target: https://github.com/boromir674/neural-style-transfer/compare/v1.0.0..master

.. |version| image:: https://img.shields.io/pypi/v/artificial-artwork.svg
:alt: PyPI Package latest master
:target: https://pypi.org/project/artificial-artwork

.. |commits_since| image:: https://img.shields.io/github/commits-since/boromir674/neural-style-transfer/v1.0.1-dev/master?color=blue&logo=Github
:alt: GitHub commits since tagged version (branch)
:target: https://github.com/boromir674/neural-style-transfer/compare/v1.0.1-dev..master

.. |better_code_hub| image:: https://bettercodehub.com/edge/badge/boromir674/neural-style-transfer?branch=master
:alt: Better Code Hub
:target: https://bettercodehub.com/

.. |codacy| image:: https://app.codacy.com/project/badge/Grade/07b27ac547a94708aefc5e845d2b6d01
:alt: Codacy
Expand All @@ -208,13 +214,7 @@ and the pretrained model are present. That way you can immediately start creatin



.. |version| image:: https://img.shields.io/pypi/v/topic-modeling-toolkit.svg
:alt: PyPI Package latest release
:target: https://pypi.org/project/topic-modeling-toolkit

.. |python_versions| image:: https://img.shields.io/pypi/pyversions/artificial-artwork.svg
:alt: Supported versions
:target: https://pypi.org/project/artificial-artwork/



Expand All @@ -223,4 +223,17 @@ and the pretrained model are present. That way you can immediately start creatin
:target: https://hub.docker.com/r/boromir674/neural-style-transfer

.. |image_size| image:: https://img.shields.io/docker/image-size/boromir674/neural-style-transfer/latest?logo=docker&logoColor=%23849ED9
:alt: Docker Image Size (tag)
:alt: Docker Image Size (tag)


.. |Demo_Content_Image| image:: ./tests/data/canoe_water_w300-h225.jpg
:width: 300
:alt: Demo Content Image

.. |Demo_Style_Image| image:: ./tests/data/blue-red_w300-h225.jpg
:width: 300
:alt: Demo Style Image

.. |Demo_Gen_Image| image:: ./tests/data/canoe_water_w300-h225.jpg+blue-red_w300-h225.jpg-100-demo-gui-run-1.png
:width: 300
:alt: Gen Image
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "artificial-artwork"
version = "1.0.0"
version = "1.0.1-dev"
description = "Create artificial artwork by transfering the appearance of one image (eg a famous painting) to another user-supplied image (eg your favourite photograph)."
authors = ["Konstantinos Lampridis <k.lampridis@hotmail.com>"]
maintainers = ["Konstantinos Lampridis <k.lampridis@hotmail.com>"]
Expand All @@ -23,11 +23,12 @@ include = [
"CHANGELOG.rst",
]


homepage = "https://github.com/boromir674/neural-style-transfer"
repository = "https://github.com/boromir674/neural-style-transfer"
documentation = "https://neural-style-transfer.readthedocs.io/"

keywords = ["artificial intelligence", "neural style transfer", "artificial art", "deep learning", "cli", "gui"]

classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
Expand Down
Loading

0 comments on commit b25488e

Please sign in to comment.