Implementation of Kaggle driver detection
- simple model
- vgg16 - input shape
224×224
- vgg19 - input shape
224×224
- inception v3 - input shape
299×299
- xception - input shape
299×299
Using kaggle
API:
./src/colab_config.sh
python train.py [...options]
python train.py --model vgg16 --width 224 --optimizer adam --lr 1e-5 --batch 16 --epochs 50
--model <model>
type of model used.<model>
one of the following:simple
,vgg16
,vgg19
,inception_v3
,xception
. Default ussimple.
--epochs <number>
<number>
- number of training epochs. Default is 20.--width <width>
Width of image, that will be input of model. Images from dataset are resized to this<width>
. Default is 150.--optimizer <optimizer>
Optimizer, used in train process.<optimizer>
one of the following:adam
,sgd
,rmsprop
--summary [True|False]
Print summary of model. Default isFalse
--lr <learning_rate>
Set learning rate for<optimizer>
. Default value is5e-5
--weight_path <path>
Path to weights. If specified, weight from file is loaded, if not - weights initialized randomly.--fc <count_of_layers>
Count of fully connected layers, used in fine-tuning. Default is 2.--fc_dim <dimension>
Dimension of fully connected layers. Default is 4096.--dropout <dropout>
Dropout after each fully-connected layer. If< 0
, than no dropout layers added. Default is 0.5.--batch <batch>
Batch size in train process. Default is 32.
Files predict.sh
and predict-all.sh
.
Second param: file name to saved weights in /content/drive/models
folder:
./predict.sh --path_to_model vgg-04-acc-0.9722-loss-0.0997.hdf5 --model vgg16 --width 224
For all saved models in folder /content/drive/models
make prediction and save to /content/drive/submissions
:
./predict-all.sh --model vgg16 --width 224
Training was running on Colaboratory Google Platform on GPU environment.