- Train the model with
train_resnet50.py. This will save the best epoch incheckpoint.torch. - Export features with
predict_resnet50.py. This will save anattributes.csvcontaining infos about all the tasks of the current dataset used and if the image was used in train or test for each features and a matrixfeatures.npy. - Reduce feature dimension with
dim_reduction.py. The result will be csv files for every reduction dimension chosen. They will have this form{dataset}_{task}_{dim_reduction}.csv. Each of them will be consisting inattributes.csvcompleted with the two selected features fromfeatures.npyafter dimension reduction applied on it. - Plot the features with selected colors with
feature_plots.py.
The file train_util.py contains utilitaries functions mostly used to manipulate the neural network.
The file construct_splits permits to construct train and val folder for each task containing subfolder for each class. This enables the use of ImageFolder from PyTorch. The function does not use extraspace as it makes use of hard links.
-
Download Wikiart here
-
Put your Wikiart images in
static/images/wikiart/data