- python 2.7
- easydict
- joblib
- numpy
- opencv-python
- Pillow
- tensorflow-gpu
-
Download KITTI object detection dataset. Put them under
$fire-FRD-CNN_ROOT/data/KITTI/
. Unzip them, then you will get two directories:$fire-FRD-CNN_ROOT/data/KITTI/training/
and$fire-FRD-CNN_ROOT/data/KITTI/testing/
. -
Now we need to split the training data into a training set and a vlidation set.
cd $fire-FRD-CNN_ROOT/data/KITTI/ mkdir ImageSets cd ./ImageSets ls ../training/image_2/ | grep ".png" | sed s/.png// > trainval.txt
trainval.txt
contains indices to all the images in the training data. In our experiments, we randomly split half of indices intrainval.txt
intotrain.txt
to form a training set and rest of them intoval.txt
to form a validation set. For your convenience, we provide a script to split the train-val set automatically. Simply runcd $fire-FRD-CNN_ROOT/data/ python random_split_train_val.py
then you should get the
train.txt
andval.txt
under$fire-FRD-CNN_ROOT/data/KITTI/ImageSets
.When above two steps are finished, the structure of
$fire-FRD-CNN_ROOT/data/KITTI/
should at least contain:$SQDT_ROOT/data/KITTI/ |->training/ | |-> image_2/00****.png | L-> label_2/00****.txt |->testing/ | L-> image_2/00****.png L->ImageSets/ |-> trainval.txt |-> train.txt L-> val.txt
-
Next, download the CNN model pretrained for ImageNet classification:
cd $fire-FRD-CNN_ROOT/data/ # SqueezeNet wget https://www.dropbox.com/s/fzvtkc42hu3xw47/SqueezeNet.tgz tar -xzvf SqueezeNet.tgz
-
Now we can start training. Training script can be found in
$fire-FRD-CNN_ROOT/scripts/train.sh
, which contains commands to train the model: fire-FRD-CNNcd $fire-FRD-CNN_ROOT/ ./scripts/train.sh -net fire-FRD-CNN -train_dir /home/scott/logs/fire-FRD-CNN -gpu 0
Training logs are saved to the directory specified by
-train_dir
. GPU id is specified by-gpu
. Network to train is specificed by-net
-
Before evaluation, you need to first compile the official evaluation script of KITTI dataset
cd $fire-FRD-CNN/src/dataset/kitti-eval make
-
Then, you can launch the evaluation script (in parallel with training) by
cd $fire-FRD-CNN/ ./scripts/eval.sh -net fire-FRD-CNN -eval_dir /home/scott/logs/fire-FRD-CNN -image_set (train|val) -gpu 1