Goal of the project is developing a machine learning algorithm which is able to estimate the year in which a painting has been created, based on its appearance only.
This code has been developed as Capstone Project for the Coursera's Advanced Data Science with IBM Specialization.
Results can be visualized using this Notebook.
From the command prompt, type:
pip install -r requirements.txt
Pretrained model can be tested downloading the weights from this link.
The weights should be unzipped in ./models_pretrained
folder.
Then:
cd src
python ./test.py
Input image path, pretrained model path and model architecture can be modified. Please take a look at:
python ./test.py --help
Data can be downloaded from Painter by Numbers Kaggle competition, after registering to Kaggle and joining the competition.
- Copy
all_data_info.csv
in./data/
folder; - Extract the images in
./data/train
and./data/test
folders.
Model can be trained calling the train.py
script in ./src/
folder:
cd src
python ./train.py
Training parameters, input and output directories can be modified. Please take a look at:
python ./train.py --help
In particular, model can be trained fine tuning Resnet152 (default) or SqueezeNet. In case SqueezeNet is preferred, run:
python ./train.py --select_squeezenet=True
Network training can be monitored via Tensorboard and it is updated once per epoch:
tensorboard --logdir=runs