Machine learning based analysis of color usage by famous artists (like Jackson Pollock) in their paintings
This repo builds upon Andrea Lalenti's work, also available here
Clone this repository using the following command:
git clone https://github.com/smedury/color-usage-analysis-in-paintings.git
Switch working directory to project and install pip requirements using the following command:
cd color-usage-analysis-in-paintings
pip3 install -r requirements.txt
This project can analyse paintings of artists:
- Jackson Pollock
- Frida Kahlo
- Mark Rothko
- Henri Matisse
using kmeans clustering analysis.
There are 2 main scripts, one for each artist.
Run the following command to:
- gather images using scraper module
- analyze color usage using clustering (K-Means or DBSCAN)
- gather colors proportions per year analysis:
python3 main_<aritst_last_name>_<clustering_type>.py
For instance, to run kmeans cluster analysis for artist Frida Kahlo's painting:
python3 main_kahlo_kmeans.py
And to run kmeans cluster analysis for artist Jackson Pollock's paintings:
python3 main_pollock_kmeans.py
Output images can be found in folder named data, created in the project's root directory.
Top 20 colors used by the artist are identified through clustering. And their proportions are determined per painting and per year.
To generate a river diagram for color usage for an artist, run the following command. River diagram can be found inside the output folder with name: riverdiagram-totalcolors-usage.png
python3 generate_river_diagram.py
Note: Modify the input parameter in generate_river_diagram.py to fix any errors encountered:
line 22: riverdiagram(<desired_number>)
-
When installing on Windows 10 using Git bash terminal (with anaconda installed), you may encounter the following error:
building 'twisted.test.raiser' extension error: Microsoft Visual C++ 14.0 is required. Get it with "Build Tools for Visual Studio": https://visualstudio.microsoft.com/downloads/ ---------------------------------------- ERROR: Failed building wheel for Twisted
Install MS Visual Studio using available for free at this link