For information about Faster R-CNN, see https://github.com/rbgirshick/py-faster-rcnn
This repository contains code to train a R-CNN network using the udacity dataset2. In order to train, some setup is required:
- Follow the instructions to setup py-faster-rcnn
- Put the image files of the dataset into data/MyData/data/Images
- Generate the annotation files using data/MyData/preprocess_data.py
This is the file structure myimdb.py expects:
data/
|-- MyData/
|-- labels.csv (Labels from the dataset)
|-- data/
|-- Images/
|-- *.jpg (Image files)
|-- Annotations/
|-- *.csv (Annotation files. Generated by preprocess_data.py
|-- ImageSets
|-- train.txt (.txt file with a list of all the images to train with. Generated by preprocess_data.py
models/
|-- mymodels/
|-- *.pt (Models files)
libs/
|-- datasets/
|-- myimdb.py (My image database class. Handles image and annotation file processing)
All the nessesary python files were also updated to Python 3. Some other changes to the python code were required, see here.
To train I used the following commands:
cd $FRCN_ROOT
./tools/train_faster_rcnn_alt_opt.py --gpu 0 --net_name mynet --weights data/imagenet_models/VGG_CNN_M_1024.v2.caffemodel --imdb myimdb_train --cfg models/mynet/config.yml