Skip to content
No description, website, or topics provided.
Python OpenEdge ABL
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
README.md
class_dataloader.py
features_generator.py
main.py
model.py
scaleParams.P
trainer.py
utils.py

README.md

Style Classification

This project aims at classify paintings according to their style. We reached 68% of accuracy on a test set of 20% of the images while trying to distinguish impressionism from realism.

We used a deep learning approach, with transfer learning from a VGG19 and a residual neural network (ResNet18).

Getting Started

Run on the cloud

Use the drive directly

Run the Notebook Art Classification project on the drive.

Run locally

The data

Download the data from these URL:

(You need to have a kaggle account and to approve the project)

Unzip the files in the directory raw_data, organisation of the directory should be:

├── raw_data
│   ├── train_1
│   ├── train_2
│   └── train_info.csv
├── data
│   ├── classif_class1_class2
│   │   ├── train
│   │   └── valid
│   ├── resnet
│   └── vgg16
├── main.py
├── class_dataloader.py
├── features_generator.py
├── model.py
├── trainer.py
├── utils.py
└── scaleParams.P

The data folder will be generated automatically by the DataLoader. The file scaleParams.P will be generated automatically by the Dataloader. The folders resnet and vgg16 will be generated automatically by the FeaturesGenerator.

The training:

# compute features
python main.py -o False -rd raw_data -dd data -m resnet -sc True -gf True 
# train
python main.py -dd data

Parameters available:

'-gpu', '--use_gpu'          Whether to use GPU or not, default = False
'-o', '--is_organised'       Whether the directory is already organised or not, default = True
'-c', '--class_names'        Painting styles to classify, default = ['impressionism', 'realism']
'-rd','--raw_data_dir'       Name of the raw_data directory where the dataset has been unziped, default = 'None'
'-dd', '--data_dir'          Name of the data directory, compulsory
'-sc', '--computeScalingFromScratch' False to use directly scalesParams.P to normalize the data, True to compute them from scratch, default = 'False'
'-m', '--model'              Name of the model to use, either 'resnet' (ResNet18) or 'vgg16'
'-gf', '--generate_features' False to use the features already computed, True to compute them from scratch, default = False

Acknowledgments

You can’t perform that action at this time.