Gabrock94 / pyaesthetics

A python package to estimate visual features about the aesthetic appearance of still images.
GNU General Public License v3.0
35 stars 7 forks source link
aesthetic aesthetic-visual-analysis aesthetics aesthetics-evaluation appearance-features apperance feature-extraction human-computer-interaction image image-processing python user-interface webdesign website

Logo

pyaesthetics

GitHub release PyPI PyPI pyversions PyPI status PyPI downloads Downloads Documentation Status DOI

Pyaesthetics (formlerly known as PrettyWebsite) is a python package designed to estimate visual features concerning the aesthetic appearance of a still image.

Features

The module can estimate the following features:

Installation

pyaesthetics can be installed using pip:

pip install pyaesthetics

Tesseract and pytesseract

Tesseract and pytesseract are also required. To install tesseract please visit: https://tesseract-ocr.github.io/tessdoc/Installation.html

Updating the package

To update the package via pip, you can use:

pip install --user --upgrade pyaesthetics

Example

pyaeshtetics modules can be used one at the time to estimate one specific feature, or they can be automatically called using an automated entrypoint that calls all the available modules at once.

Example 1: one single feature (e.g. Brigthness BT601)

#load only the neede functions from the specific module
from pyaesthetics.brightness import relativeluminance_bt601
from pyaeshtetics.utils import sRGB2RGB
import cv2 #to open and handle images

#define the path to a sample image
path_to_img = "/path/to/image/image.jpg"

#load the image
img = cv2.imread(path_to_img)

#convert the image to the RGB colorscheme
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
img = sRGB2RGB(img)
print(relativeluminance_bt601(img))

Example 2: Complete analysis

import pyaesthetics

#define the path to a sample image
path_to_img = "/path/to/image/image.jpg"

#perform a subset of the analysis using standard parameters
results = pyaesthetics.analysis.analyze_image(path_to_img, method="fast")
print(results)

Or for a faster analysis:

import pyaesthetics

#define the path to a sample image
path_to_img = "/path/to/image/image.jpg"

#perform a subset of the analysis using standard parameters
results = pyaesthetics.analysis.analyze_image(path_to_img, method="complete")
print(results)

Documentation

The updated documentation of pyaesthetics, its modules, as well as a getting started guide and a list of examples can be found on Read the Docs. The documentation of each release version of CLIMADA can be accessed separately through the drop-down menu at the bottom of the left sidebar.

Requirements

In order to work correctly, pyaesthetics requires the installation of the following packages.

Contacts

For questions, suggestions, or advices, you can reach out at: giulio.gabrieli@iit.it or giulio@duck.com

Scientific Publications that used pyaesthetic

Pyaesthetics has been used in different scientific publication. The most relevant works are listed below.

Peer-reviewed articles

Theses

Presentation

Contribution Guidelines for pyaesthetics

We welcome contributions to the pyaesthetics project! Whether you want to help with code, documentation, or examples, your input is valuable. Here’s how you can contribute:

How to Contribute

  1. Fork the Repository:

    • Click the "Fork" button on the top right corner of the repository page to create your own copy of the project.
  2. Clone the Repository:

    • Clone your fork to your local machine:
      git clone https://github.com/your-username/pyaesthetics.git
      cd pyaesthetics
  3. Create a Branch:

    • Create a new branch for your changes:
      git checkout -b your-branch-name

Types of Contributions

  1. Code Contributions:

    • Bug Fixes: Help us fix bugs and improve the stability of the project.
    • New Features: Implement new features or enhance existing ones.
    • Performance Improvements: Optimize code for better performance and efficiency.
  2. Documentation:

    • Improve existing documentation or add new sections to help users understand and use the project more effectively.
  3. Examples:

    • Create and share examples to demonstrate how to use various features of the pyaesthetics package.

Submitting Your Contribution

  1. Commit Your Changes:

    • Make sure your commits are clear and concise. Follow good commit message practices.
      git add .
      git commit -m "Description of your changes"
  2. Push to Your Fork:

    • Push your changes to your forked repository:
      git push origin your-branch-name
  3. Create a Pull Request:

    • Go to the original repository and click on the "New Pull Request" button.
    • Select your fork and branch as the source, and the original repository and branch as the target.
    • Provide a clear and descriptive title and description for your pull request.

Code Review Process

  1. Review:

    • Your pull request will be reviewed by the maintainers. They may request changes or ask for additional information.
  2. Update:

    • Make any requested changes and update your pull request.
  3. Merge:

    • Once your pull request is approved, it will be merged into the main branch.

Additional Notes

Sponsorship

The project has received a one-shot sponsorship for open-source projects by Gitkraken.