All Projects → Pratik-Chhajer → Predicting-Photography-Aesthetics-with-CNNs

Pratik-Chhajer / Predicting-Photography-Aesthetics-with-CNNs

Licence: MIT License
Using Convolutional Neural Networks to predict aesthetics of photographs

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Predicting-Photography-Aesthetics-with-CNNs

Hands-On-Deep-Learning-Algorithms-with-Python
Hands-On Deep Learning Algorithms with Python, By Packt
Stars: ✭ 76 (+375%)
Mutual labels:  cnn-architecture
cgp-cnn-design
Using Cartesian Genetic Programming to find an efficient Convolutional Neural Network architecture
Stars: ✭ 25 (+56.25%)
Mutual labels:  cnn-architecture
LBCNN
Local Binary Convolutional Neural Network for Facial Expression Recognition of Basic Emotions in Python using the TensorFlow framework
Stars: ✭ 21 (+31.25%)
Mutual labels:  cnn-architecture
pyTorch-text-classification
pyTorch-text-classification
Stars: ✭ 15 (-6.25%)
Mutual labels:  cnn-architecture

Predicting Photography Aesthetics with CNNs

Dataset and Model

First download dataset from here and models from here and place it as shown in below directory structure.

Dataset source: AADB Datset

Code Structure

  - Predicting-Photography-Aesthetics-with-CNNs
  	| --- accuracy
		| --- accuracy1.txt
		| --- accuracy2.txt
		| --- accuracy3.txt
	| --- model
		| --- model1.h5
		| --- model2.h5
		| --- model3.h5
	| --- dataset
		| --- training
		| --- testing
	| --- scripts
		| --- evaluate.py
		| --- main.py
		| --- model1.py
		| --- model2.py
		| --- model3.py
	| --- test_images
		| --- image1_name.jpg
		| --- image2_name.jpg
		| --- image3_name.jpg
		| --- image4_name.jpg
	| --- testing.txt
	| --- training.txt
	| --- requirements.txt

Installation

First, clone the repository

Next, install the required python3 packages:

pip3 install -r requirements.txt

Now to classify any new images put all your image inside folder named test_images and run below code:-

python3 scripts/main.py

It will give output like this:-

image1_name 	 3
image2_name 	 2
image3_name 	 2
image4_name 	 5

From above output we can see that image1_name has been given 1 star(Poor) and image4_name has been given 5 star(excellent)

To evaluate our CNN models run:-

python3 scripts/evaluate.py

This will read all three models saved in model named folder and output something like this:-

Reading Model 1
Evaluating Mdel 1
800/800 [==============================] - 6s 8ms/step
Test loss for Model 1: 1.76433014154
Test accuracy for Model 1: 0.35
############################################
Reading Model 2
Evaluating Model 2
800/800 [==============================] - 8s 10ms/step
Test loss for Model 2: 1.43449003458
Test accuracy for Model 2: 0.36375
############################################
Reading Model 3
Evaluating Mdel 3
800/800 [==============================] - 4s 5ms/step
Test loss for Model 3: 1.43597866058
Test accuracy for Model 3: 0.41375
############################################ 

To build all three models again run(Already done, not required as this will take more than 8 hours):-

python3 scripts/model1.py
python3 scripts/model2.py
python3 scripts/model3.py

This will generate our three models named

model1.h5
model2.h5
model3.h5

Accuracy folder contains three files each stroing accuracy of each model for ensemble.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].