All Projects → Kelicious → faster_rcnn

Kelicious / faster_rcnn

Licence: MIT license
An implementation of Faster R-CNN applied to vehicle detection.

Programming Languages

Jupyter Notebook
11667 projects
python
139335 projects - #7 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to faster rcnn

Traffic Rule Violation Detection System
Stars: ✭ 174 (+690.91%)
Mutual labels:  vehicle-detection
machine learning course
Artificial intelligence/machine learning course at UCF in Spring 2020 (Fall 2019 and Spring 2019)
Stars: ✭ 47 (+113.64%)
Mutual labels:  keras-tensorflow
uncertainty-wizard
Uncertainty-Wizard is a plugin on top of tensorflow.keras, allowing to easily and efficiently create uncertainty-aware deep neural networks. Also useful if you want to train multiple small models in parallel.
Stars: ✭ 39 (+77.27%)
Mutual labels:  keras-tensorflow
TF2DeepFloorplan
TF2 Deep FloorPlan Recognition using a Multi-task Network with Room-boundary-Guided Attention. Enable tensorboard, quantization, flask, tflite, docker, github actions and google colab.
Stars: ✭ 98 (+345.45%)
Mutual labels:  keras-tensorflow
Kervolution
Kervolution implementation using TF2.0
Stars: ✭ 20 (-9.09%)
Mutual labels:  keras-tensorflow
vehicle-detection
Detect vehicles in a video
Stars: ✭ 88 (+300%)
Mutual labels:  vehicle-detection
Self Driving Car
Udacity Self-Driving Car Engineer Nanodegree projects.
Stars: ✭ 2,103 (+9459.09%)
Mutual labels:  vehicle-detection
Machine-Learning-Notebooks
15+ Machine/Deep Learning Projects in Ipython Notebooks
Stars: ✭ 66 (+200%)
Mutual labels:  keras-tensorflow
WGAN GP
Keras model and tensorflow optimization of 'improved Training of Wasserstein GANs'
Stars: ✭ 16 (-27.27%)
Mutual labels:  keras-tensorflow
CRNN-OCR-lite
Lightweight CRNN for OCR (including handwritten text) with depthwise separable convolutions and spatial transformer module [keras+tf]
Stars: ✭ 130 (+490.91%)
Mutual labels:  keras-tensorflow
COVID-19-DETECTION
Detect Covid-19 with Chest X-Ray Data
Stars: ✭ 43 (+95.45%)
Mutual labels:  keras-tensorflow
Xtreme-Vision
A High Level Python Library to empower students, developers to build applications and systems enabled with computer vision capabilities.
Stars: ✭ 77 (+250%)
Mutual labels:  keras-tensorflow
KerasMNIST
Keras MNIST for Handwriting Detection
Stars: ✭ 25 (+13.64%)
Mutual labels:  keras-tensorflow
Vehicle detection recognition
This is a Matlab lesson design for vehicle detection and recognition. Using cifar-10Net to training a RCNN, and finetune AlexNet to classify. Thanks to Cars Dataset:http://ai.stanford.edu/~jkrause/cars/car_dataset.html
Stars: ✭ 183 (+731.82%)
Mutual labels:  vehicle-detection
deep-blueberry
If you've always wanted to learn about deep-learning but don't know where to start, then you might have stumbled upon the right place!
Stars: ✭ 17 (-22.73%)
Mutual labels:  keras-tensorflow
Opencv Lane Vehicle Track
OpenCV implementation of lane and vehicle tracking
Stars: ✭ 162 (+636.36%)
Mutual labels:  vehicle-detection
car-detection-model-prediction
No description or website provided.
Stars: ✭ 18 (-18.18%)
Mutual labels:  vehicle-detection
cnn-visualization-keras-tf2
Filter visualization, Feature map visualization, Guided Backprop, GradCAM, Guided-GradCAM, Deep Dream
Stars: ✭ 21 (-4.55%)
Mutual labels:  keras-tensorflow
GTAV-Self-driving-car
Self driving car in GTAV with Deep Learning
Stars: ✭ 15 (-31.82%)
Mutual labels:  keras-tensorflow
NeuralNetworks
Implementation of a Neural Network that can detect whether a video is in-game or not
Stars: ✭ 64 (+190.91%)
Mutual labels:  keras-tensorflow

Residual Networks for Vehicle Detection

This project is a Keras implementation of Faster-RCNN. It can use VGG16, ResNet-50, or ResNet-101 as the base architecture. It has been trained on the PASCAL VOC 2007/2012 object detection image sets, as well as the KITTI 2D object detection set for self-driving vehicles.

See the Project Report for more information on implementation details.

Video Demo

ResNet-50 Demo

Sample Outputs

KITTI Test Image 000018 KITTI Image 007000 KITTI Image 006800

Getting Started

You will need Conda and Python 3.5 to install this project. Clone the repo and create a conda environment using the environment.yml file. On MacOS:

conda env create -f environment.yml

On Linux:

conda env create -f environment.ec2.yml

Activate the environment:

source activate faster_rcnn

Download ResNet-101 weights to models/resnet101_weights_tf.h5 if it's not already there.

Acquiring Training/Test Data

PASCAL VOC Data

Download the PASCAL VOC training set. To evaluate trained models' performance, you will also need the test set.

KITTI Data

Download the KITTI 2D Object Detection training set.

Then convert the dataset to the PASCAL VOC format by using the VOD Converter. There are no annotations for the test set so you will have to split the training set into a smaller training set and validation set. Do so by creating your own train.txt and val.txt in ImageSets/Main under the root data directory.

Training Models

PASCAL VOC

Models are trained in 4 steps. With the conda environment activated, the following example shows how to train a PASCAL VOC model on the 2007/2012 trainval set.

python faster_rcnn/train_rpn_step1.py --voc_paths $VOC_ROOT/VOC2007/,$VOC_ROOT/VOC2012/ --phases 60000:1e-3,20000:1e-4 --optimizer sgd --img_set trainval --network resnet50 --anchor_scales 128,256,512 --resize_dims 600,1000 --save_weights_dest models/rpn_weights_r50_fullreg_step1_voc20072012_trainval.h5 --save_model_dest models/rpn_model_r50_fullreg_step1_voc20072012_trainval.h5 2>&1 | tee train_r50_rpn_step1_tmp
python faster_rcnn/train_det_step2.py models/rpn_weights_r50_fullreg_step1_voc20072012_trainval.h5 --voc_paths $VOC_ROOT/VOC2007/,$VOC_ROOT/VOC2012/ --phases 60000:1e-3,20000:1e-4 --optimizer sgd --img_set trainval --network resnet50 --anchor_scales 128,256,512 --resize_dims 600,1000 --save_weights_dest models/detector_weights_r50_fullreg_step2_voc20072012_trainval.h5 --save_model_dest models/detector_model_r50_fullreg_step2_voc20072012_trainval.h5 2>&1 | tee train_r50_det_step2_tmp
python faster_rcnn/train_rpn_step3.py --step2_weights_path models/detector_weights_r50_fullreg_step2_voc20072012_trainval.h5 --voc_paths $VOC_ROOT/VOC2007/,$VOC_ROOT/VOC2012/ --phases 60000:1e-3,20000:1e-4 --optimizer sgd --img_set trainval --network resnet50 --anchor_scales 128,256,512 --resize_dims 600,1000 --save_weights_dest models/rpn_weights_r50_fullreg_step3_voc20072012_trainval.h5 --save_model_dest models/rpn_model_r50_fullreg_step3_voc20072012_trainval.h5 2>&1 | tee train_r50_rpn_step3_tmp
python faster_rcnn/train_det_step4.py models/rpn_weights_r50_fullreg_step3_voc20072012_trainval.h5 --voc_paths $VOC_ROOT/VOC2007/,$VOC_ROOT/VOC2012/ --phases 60000:1e-3,20000:1e-4 --optimizer sgd --img_set trainval --network resnet50 --anchor_scales 128,256,512 --resize_dims 600,1000 --save_weights_dest models/detector_weights_r50_fullreg_step4_voc20072012_trainval.h5 --save_model_dest models/detector_model_r50_fullreg_step4_voc20072012_trainval.h5 --save_rpn_model_dest models/rpn_model_r50_fullreg_step3_voc20072012_trainval.h5 2>&1 | tee train_r50_det_step4_tmp

KITTI

To train KITTI models, an extra --kitti argument is needed to use the right object classes.

python faster_rcnn/train_rpn_step1.py --voc_paths $KITTI_ROOT --phases 60000:1e-3,20000:1e-4 --optimizer sgd --img_set train --network resnet50 --anchor_scales 16,32,64,128,256,512 --resize_dims 600,1500 --save_weights_dest models/rpn_weights_r50_fullreg_step1_kitti_train.h5 --save_model_dest models/rpn_model_r50_fullreg_step1_kitti_train.h5 2>&1 | tee train_r50_rpn_step1_tmp
python faster_rcnn/train_det_step2.py models/rpn_weights_r50_fullreg_step1_kitti_train.h5 --voc_paths $KITTI_ROOT --kitti --phases 60000:1e-3,20000:1e-4 --optimizer sgd --img_set train --network resnet50 --anchor_scales 16,32,64,128,256,512 --resize_dims 600,1500 --save_weights_dest models/detector_weights_r50_fullreg_step2_kitti_train.h5 --save_model_dest models/detector_model_r50_fullreg_step2_kitti_train.h5 2>&1 | tee train_r50_det_step2_tmp
python faster_rcnn/train_rpn_step3.py --step2_weights_path models/detector_weights_r50_fullreg_step2_kitti_train.h5 --voc_paths $KITTI_ROOT --phases 60000:1e-3,20000:1e-4 --optimizer sgd --img_set train --network resnet50 --anchor_scales 16,32,64,128,256,512 --resize_dims 600,1500 --save_weights_dest models/rpn_weights_r50_fullreg_step3_kitti_train.h5 --save_model_dest models/rpn_model_r50_fullreg_step3_kitti_train.h5 2>&1 | tee train_r50_rpn_step3_tmp
python faster_rcnn/train_det_step4.py models/rpn_weights_r50_fullreg_step3_kitti_train.h5 --voc_paths $KITTI_ROOT --kitti --phases 60000:1e-3,20000:1e-4 --optimizer sgd --img_set train --network resnet50 --anchor_scales 16,32,64,128,256,512 --resize_dims 600,1500 --save_weights_dest models/detector_weights_r50_fullreg_step4_kitti_train.h5 --save_model_dest models/detector_model_r50_fullreg_step4_kitti_train.h5 --save_rpn_model_dest models/rpn_model_r50_fullreg_step3_kitti_train.h5 2>&1 | tee train_r50_det_step4_tmp

Evaluating Trained Models

PASCAL VOC

To make predictions:

python faster_rcnn/voc_dets.py models/voc_r50_fullreg_trainval/rpn_model_r50_fullreg_step3_voc20072012_trainval.h5 models/voc_r50_fullreg_trainval/detector_model_r50_fullreg_step4_voc20072012_trainval.h5 --voc_path $VOC_TEST_ROOT/VOC2007/ --det_threshold 0.0 --resize_dims 600,1000 --img_set test --network resnet50 --out_dir ./tmpout/ 2>&1 | tee test_r50_det_tmp

To evaluate predictions against ground truth data:

python faster_rcnn/eval_dets.py --dets_path ./tmpout --voc_path $VOC_TEST_ROOT/VOC2007/ --img_set test

KITTI

To make predictions:

python faster_rcnn/voc_dets.py models/kitti_r50_fullreg_train/rpn_model_r50_fullreg_step3_kitti_train.h5 models/kitti_r50_fullreg_train/detector_model_r50_fullreg_step4_kitti_train.h5 --voc_path $KITTI_ROOT --kitti --det_threshold 0.0 --resize_dims 600,1500 --anchor_scales 16,32,64,128,256,512 --img_set val --network resnet50 --out_dir ./tmpout/ 2>&1 | tee test_r50_det_tmp

To evaluate predictions against ground truth data:

python faster_rcnn/eval_dets.py --dets_path ./tmpout --voc_path $KITTI_ROOT --kitti --img_set val
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].