All Projects → liulei01 → Drbox

liulei01 / Drbox

Licence: other
A deep learning based algorithm to detect rotated object, for example, objects in remote sensing images

Projects that are alternatives of or similar to Drbox

Mtcnn
face detection and alignment with mtcnn
Stars: ✭ 66 (-82.59%)
Mutual labels:  caffe, detection
Maskyolo caffe
YOLO V2 & V3 , YOLO Combined with RCNN and MaskRCNN
Stars: ✭ 101 (-73.35%)
Mutual labels:  caffe, detection
Dlcv for beginners
《深度学习与计算机视觉》配套代码
Stars: ✭ 1,244 (+228.23%)
Mutual labels:  caffe, detection
Caffe Model
Caffe models (including classification, detection and segmentation) and deploy files for famouse networks
Stars: ✭ 1,258 (+231.93%)
Mutual labels:  caffe, detection
Raspberrypi Facedetection Mtcnn Caffe With Motion
MTCNN with Motion Detection, on Raspberry Pi with Love
Stars: ✭ 204 (-46.17%)
Mutual labels:  caffe, detection
Jacinto Ai Devkit
Training & Quantization of embedded friendly Deep Learning / Machine Learning / Computer Vision models
Stars: ✭ 49 (-87.07%)
Mutual labels:  caffe, detection
Php Opencv Examples
Tutorial for computer vision and machine learning in PHP 7/8 by opencv (installation + examples + documentation)
Stars: ✭ 333 (-12.14%)
Mutual labels:  caffe, detection
Picanet
Stars: ✭ 35 (-90.77%)
Mutual labels:  caffe, detection
Caffe Yolo9000
Caffe for YOLOv2 & YOLO9000
Stars: ✭ 164 (-56.73%)
Mutual labels:  caffe, detection
Mobilenet Ssd
Caffe implementation of Google MobileNet SSD detection network, with pretrained weights on VOC0712 and mAP=0.727.
Stars: ✭ 1,805 (+376.25%)
Mutual labels:  caffe, detection
Facemaskdetection
开源人脸口罩检测模型和数据 Detect faces and determine whether people are wearing mask.
Stars: ✭ 1,677 (+342.48%)
Mutual labels:  caffe, detection
crowd density segmentation
The code for preparing the training data for crowd counting / segmentation algorithm.
Stars: ✭ 21 (-94.46%)
Mutual labels:  caffe, detection
colorchecker-detection
Multiple ColorChecker Detection. This code implements a multiple colorChecker detection method, as described in the paper Fast and Robust Multiple ColorChecker Detection.
Stars: ✭ 51 (-86.54%)
Mutual labels:  caffe, detection
Android Object Detection
☕️ Fast-RCNN and Scene Recognition using Caffe
Stars: ✭ 295 (-22.16%)
Mutual labels:  caffe, detection
Detection
ASP.NET Core Detection with Responsive View for identifying details about client device, browser, engine, platform, & crawler. Responsive middleware for routing base upon request client device detection to specific view.
Stars: ✭ 335 (-11.61%)
Mutual labels:  detection
Mtcnn
全平台实时人脸检测和姿态估计,提供无需任何框架实现Realtime Face Detection and Head pose estimation on Windows、Ubuntu、Mac、Android and iOS
Stars: ✭ 351 (-7.39%)
Mutual labels:  caffe
Rectlabel Support
RectLabel - An image annotation tool to label images for bounding box object detection and segmentation.
Stars: ✭ 338 (-10.82%)
Mutual labels:  detection
Text Image Augmentation
Geometric Augmentation for Text Image
Stars: ✭ 333 (-12.14%)
Mutual labels:  detection
Tinybenchmark
Scale Match for Tiny Person Detection(WACV2020), Official link of the dataset
Stars: ✭ 364 (-3.96%)
Mutual labels:  detection
Foveabox
FoveaBox: Beyond Anchor-based Object Detector
Stars: ✭ 353 (-6.86%)
Mutual labels:  detection

DRBox

By Lei Liu (mail: [email protected])

Introduction

DRBox is used for detection tasks where the objects are orientated arbitrarily. This code show examples that DRBox is used to detect vehicles, ships and airplanes in remote sensing images. I'm also looking forward for its use in other problems.

image

The codes are modified from the original Caffe and SSD.

Citing DRBox

The article for this method can be downloaded here: arXiv:1711.09405. Please cite this work in your publications if it helps your research.

Contents

  1. Installation
  2. Preparation
  3. Train
  4. Deployment
  5. View Results
  6. Build Your Own Dataset

Installation

  1. DRBox is written in Caffe with some newly defined layers. So you should prepare nessasary environment for Caffe installation. DThen you can get the code:
git clone https://github.come/liulei01/drbox.git
  1. Matlab is also neccessary so that the results can be viewed.

  2. If you only want to apply our trained models directly to your applications, then you can ignore the following instruction and jump to Deployment.

  3. Build the code. Please follow Caffe instruction to install all necessary packages and build it.

# Modify Makefile.config according to your Caffe installation.
cp Makefile.config.example Makefile.config
make -j8
# Make sure to include $CAFFE_ROOT/python to your PYTHONPATH.
make py

Preparation

  1. Download fully convolutional reduced (atrous) VGGNet. By default, we assume the model is stored in $CAFFE_ROOT/models/VGGNet/

  2. Download the training data for DRBox at https://pan.baidu.com/s/1sliHG09 , extract them and place the files at the corresponding position of data/. (Tips: There are two folders named larger and smaller respectively, you can download files in either of them. This website would ask you to install a software to download files that larger than 200M, so if you want to download file from your browser directly, you should download the files in folder "smaller".)

  3. Run create_data.sh in each subfolders in data/ to create LMDB for training. For example, when you want to train a airplane detection network, then you can

cd $CAFFEROOT
./data/Airplane/create_data.sh

Train

DRBox is now designed as a single task network. So you should train it for each type of objects separately. The python codes are in examples/rbox/. If you want to train a airplane detection network, then you can start training by:

cd $CAFFEROOT
python examples/rbox/rbox_pascal_airplane.py

Training for vehicle is similar with airplane.

cd $CAFFEROOT
python examples/rbox/rbox_pascal_car.py

Before training for ship, you should replace src/caffe/util/rbox_util.cpp with src/caffe/util.rbox_util.cpp.ship and rebuilding the codes. The reason is that we ignore the head and tail of a ship to make the problem easier.

cd $CAFFEROOT
mv src/caffe/util/rbox_util.cpp src/caffe/util/rbox_util.cpp.old
mv src/caffe/util/rbox_util.cpp.ship src/caffe/util/rbox_util.cpp
make -j8
python examples/rbox/rbox_pascal_ship_opt.py

The trained models are stored in models/RBOX/.

Deployment

The codes for deployment are in examples/rbox/deploy.

  1. If you only want to apply a pre-trained models directly to your applications in any Caffe environment, then you can copy this folder to your own Caffe folder and run the following commands.
mv librbox.cpp.code librbox.cpp
g++ -o librbox.so -shared -fPIC librbox.cpp
cp deploy.py.general_example deploy.py
# you should modify the following file accordingly.
python deploy.py
  1. Otherwise, make sure that caffemodel file, deploy.prototxt file are generated during training. Then run the following commands:
mv librbox.cpp.code librbox.cpp
g++ -o librbox.so -shared -fPIC librbox.cpp
mv librbox.cpp librbox.cpp.code
cp deploy.py.example deploy.py
# you should modify the following file accordingly.
python deploy.py

View Results

The detection results are stored in a text file named like output.rbox.score. We provide a matlab function to view the results. In matlab, open examples/rbox/deploy/SelectRotatedTarget.m and run it. You are asked to select the demo tiff figure and the output.rbox.score file, then the results will be plotted. Press Z to zoom in and X to zoom out. In the first view, each result is plotted in a red circle, you can press Z to change them to rectangles.

A .rbox.score file contains several lines where each line corresponds to one bounding box. Each line contains 7 numbers. The first two numbers are position of the center point of the bounding box. Number 3-4 are width and height of the bounding box. The 5th is the label of the object, which is fixed to 1 recently because DRBox only provide one class of predictions. The 6th number is the angle of this bounding box in degrees. The 7th is the score. The detected objects are sorted with their scores.

Build Your Own Dataset

SelectRotatedTarget.m is not only a figure plot tool, but also a bounding box labeling tool to help you build your own dataset. Firstly, run this function in Matlab and select a image. Then, when it is asked to select a .rbox file, click cancel button then a empty .rbox file will be created. Press space key to switch into edit mode, then you can press H to see instructions on how to draw a rotatable bounding box on the image. When you click right on the mouse to quit the edit mode, the marked bounding boxes will be saved to the .rbox file.

.rbox file uses a similar format with .rbox.score file to record bounding boxes, unless that each line contains 6 numbers except the score value.

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