Fast R-CNN Torch Implementation
This is a torch implementation of the Fast R-CNN proposed by Girshick et .al. [1].
nn, inn, cudnn, image, matio, optim, paths
For running the demo you only need to download the weights of the Fast R-CNN network. Please run
./scripts/get_frcnn_models.shto get the trained Fast R-CNN models (currently AlexNet trained on VOC2007 trainval set). After downloading the weights file you can run the demo in the terminal as follows:
lua qlua demo.luaAfter running this file you should see the following detections:
For training the Fast R-CNN network, you should download the pre-trained models, object proposals, and the Pascal VOC dataset. You can download the pre-trained AlexNet model and object proposals for VOC by running
./scripts/get_imgnet_models.shand
./scripts/get_proposals.sh. Please download the VOC Devkit training data as well.
Now you can train the model by calling
th main_train.lua. However, you should specify the required options appropriately. For a list of complete options run
th main_train.lua -help.
-dataset_path 'path to the directory'(the default is
./data/datasets/) and the name of the VOC devkit folder by setting
-dataset 'name of the root folder'(the default is
voc_2007).
-train_img_set 'train'.
./modelsfolder and pass its location by setting the
-model_def 'path to the model definition'option. In that case, you probably need to specify the appropriate pre-trained model for fine-tuning by passing the pre-trained path by setting the
-pre_trained_file 'path to the pre-trained file'.
./data/trained_models/. You can change this directory by passing the
-save_path 'your new path to save the models'option.
./data/log/. You can change it by passing
-log_path 'new path for saving the log files'.
Currently, you need Matlab to use the VOC evaluation functions. Please download the VOC2007 test data if you want to test on the test set. You can test your trained model by running
th main_test.luaand passing the required options: * Pass the path to your trained model by setting
-model_weights 'path to the file containing the weights of your trained model'and declare your model definition by passing the
-model_def 'path to the model definition'(if you are testing a model other than AlexNet). * Set the path to the parent directory of the VOC devkit directory by passing the
-dataset_path 'path to the directory'and the name of the VOC devkit root directory by passing the
-dataset 'name of the root folder'. * You can change the test imageset by passing
-test_img_set 'your test set'.