All Projects → csvance → Keras Mobile Detectnet

csvance / Keras Mobile Detectnet

Licence: mit
Fast Object Detector for the Jetson Nano

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Keras Mobile Detectnet

Data generator object detection 2d
A data generator for 2D object detection
Stars: ✭ 73 (-16.09%)
Mutual labels:  object-detection
Vidvrd Helper
To keep updates with VRU Grand Challenge, please use https://github.com/NExTplusplus/VidVRD-helper
Stars: ✭ 81 (-6.9%)
Mutual labels:  object-detection
Yolo Custom Object Detector
Making custom object detector using Yolo (Java and Python)
Stars: ✭ 84 (-3.45%)
Mutual labels:  object-detection
Kaggle Rsna
Deep Learning for Automatic Pneumonia Detection, RSNA challenge
Stars: ✭ 74 (-14.94%)
Mutual labels:  object-detection
Tracktor
Python and OpenCV based object tracking software
Stars: ✭ 76 (-12.64%)
Mutual labels:  object-detection
Labelme
automatic tagging data, the training data prepare for mask-rcnn
Stars: ✭ 83 (-4.6%)
Mutual labels:  object-detection
Opencv Android Object Detection
This is sample code for object detection using OpenCV on android
Stars: ✭ 70 (-19.54%)
Mutual labels:  object-detection
Tensorflowios
A Real Time Object Detection application on iOS using Tensorflow and pre-trained COCO dataset models. Video frames are captured and inference is done locally using the provided mobilenet models. Both Swift and Objective-C projects.
Stars: ✭ 86 (-1.15%)
Mutual labels:  object-detection
Cnn Paper2
🎨 🎨 深度学习 卷积神经网络教程 :图像识别,目标检测,语义分割,实例分割,人脸识别,神经风格转换,GAN等🎨🎨 https://dataxujing.github.io/CNN-paper2/
Stars: ✭ 77 (-11.49%)
Mutual labels:  object-detection
Raster Vision
An open source framework for deep learning on satellite and aerial imagery.
Stars: ✭ 1,248 (+1334.48%)
Mutual labels:  object-detection
Tju Dhd
A newly built high-resolution dataset for object detection and pedestrian detection (IEEE TIP 2020)
Stars: ✭ 75 (-13.79%)
Mutual labels:  object-detection
Hand Detection.pytorch
FaceBoxes for hand detection in PyTorch
Stars: ✭ 76 (-12.64%)
Mutual labels:  object-detection
Gossipnet
Non-maximum suppression for object detection in a neural network
Stars: ✭ 83 (-4.6%)
Mutual labels:  object-detection
Votenet
Deep Hough Voting for 3D Object Detection in Point Clouds
Stars: ✭ 1,183 (+1259.77%)
Mutual labels:  object-detection
Fastai
R interface to fast.ai
Stars: ✭ 85 (-2.3%)
Mutual labels:  object-detection
Panet
PANet for Instance Segmentation and Object Detection
Stars: ✭ 1,170 (+1244.83%)
Mutual labels:  object-detection
Htcn
Implementation of "Harmonizing Transferability and Discriminability for Adapting Object Detectors" (CVPR 2020)
Stars: ✭ 82 (-5.75%)
Mutual labels:  object-detection
Rotated iou
Differentiable IoU of rotated bounding boxes using Pytorch
Stars: ✭ 85 (-2.3%)
Mutual labels:  object-detection
Frostnet
FrostNet: Towards Quantization-Aware Network Architecture Search
Stars: ✭ 85 (-2.3%)
Mutual labels:  object-detection
Gtavisionexport
Code to export full segmentations from GTA
Stars: ✭ 83 (-4.6%)
Mutual labels:  object-detection

Keras MobileDetectNet

Example

MobileDetectNet is an object detector which uses MobileNet CNN to predict bounding boxes. It was designed to be computationally efficient for deployment on embedded systems and easy to train with limited data. It was inspired by the simple yet effective design of DetectNet and enhanced with the anchor system from Faster R-CNN.

Network Arcitecture

Example

Training

python train.py --help

Label Format

MobileDetectNet uses the KITTI label format and directory structure. See here for more details

Preprocessing

Images are scaled between -1 and 1 to take advantage of transfer learning from pretrained MobileNet.

Anchors

MobileNet outputs a 7x7x256 from its last layer with a 224x224x3 input. In each of the 7x7 squares we place 9 anchors with combinations of the following settings:

  • Scale 1, 2, and 3
  • Aspect Ratio 1, 4/3, and 3/4

We set the anchor to 1 if a rectangle has > 0.3 IoU with the anchor. The bounding box generated is given to the box with the highest IoU over 0.3.

Due to the smaller network receptive size and low spacial dimension output of MobileNet, anchors partially outside the image can be used.

Augmentation

Training is done with imgaug utilizing Keras Sequences for multicore preprocessing and online data augmentation:

return iaa.Sequential([
    iaa.Fliplr(0.5),
    iaa.CropAndPad(px=(0, 112), sample_independently=False),
    iaa.Affine(translate_percent={"x": (-0.4, 0.4), "y": (-0.4, 0.4)}),
    iaa.SomeOf((0, 3), [
        iaa.AddToHueAndSaturation((-10, 10)),
        iaa.Affine(scale={"x": (0.9, 1.1), "y": (0.9, 1.1)}),
        iaa.GaussianBlur(sigma=(0, 1.0)),
        iaa.AdditiveGaussianNoise(scale=0.05 * 255)
    ])
])

Data augmentation is also used for validation for the purpose of making sure smaller objects are detected.

return iaa.Sequential([
    iaa.CropAndPad(px=(0, 112), sample_independently=False),
    iaa.Affine(translate_percent={"x": (-0.4, 0.4), "y": (-0.4, 0.4)}),
])


If a dataset contains many smaller bounding boxes or detecting smaller objects is not a concern, this should be adjusted for both train and validation augmentation.

Loss

Standard loss functions are used for everything other than the bounding box regression, which uses 10*class_true_(ij)*|y_pred_(ij) - y_true_(ij)| in order to not penalize the network for bounding box predictions without an object present and to normalize the loss against class loss. Class loss is binary crossentropy and region loss is mean absolute error.

Optimization

Nadam is the recomended optimizer. A base lr of 0.001 is used, and ReduceLROnPlateau callback reduces it during training. Generally the model should converge to an optimal solution within 50 epochs, depending on the amount of training data used.

Inference

python inference.py --help

TensorRT

A TF-TRT helper function has been intergrated into the model which allows for easy inference acceleration on the nVidia Jetson platform. In model.py MobileDetectNet.tftrt_engine() will create a TensorRT accelerated Tensorflow graph. An example of how to use it is included in inference.py.

Performance

Using an FP16 TF-TRT graph the model runs at ~55 FPS on the Jetson Nano in mode 1 (5W). The performance doesn't seem to be effected running it in mode 0 (10W).

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].