All Projects → vacancy → Preciseroipooling

vacancy / Preciseroipooling

Licence: mit
Precise RoI Pooling with coordinate gradient support, proposed in the paper "Acquisition of Localization Confidence for Accurate Object Detection" (https://arxiv.org/abs/1807.11590).

Projects that are alternatives of or similar to Preciseroipooling

Centernet2
Two-stage CenterNet
Stars: ✭ 496 (-28.01%)
Mutual labels:  object-detection
Simplecvreproduction
Reproduce simple cv project including attention module, classification, object detection, segmentation, keypoint detection, tracking 😄 etc.
Stars: ✭ 602 (-12.63%)
Mutual labels:  object-detection
Retinanet Examples
Fast and accurate object detection with end-to-end GPU optimization
Stars: ✭ 631 (-8.42%)
Mutual labels:  object-detection
Vehicle counting tensorflow
🚘 "MORE THAN VEHICLE COUNTING!" This project provides prediction for speed, color and size of the vehicles with TensorFlow Object Counting API.
Stars: ✭ 582 (-15.53%)
Mutual labels:  object-detection
Photonix
This is a new web-based photo management application. Run it on your home server and it will let you find the right photo from your collection on any device. Smart filtering is made possible by object recognition, location awareness, color analysis and other ML algorithms.
Stars: ✭ 592 (-14.08%)
Mutual labels:  object-detection
Weighted Boxes Fusion
Set of methods to ensemble boxes from different object detection models, including implementation of "Weighted boxes fusion (WBF)" method.
Stars: ✭ 610 (-11.47%)
Mutual labels:  object-detection
Detectorch
Detectorch - detectron for PyTorch
Stars: ✭ 566 (-17.85%)
Mutual labels:  object-detection
Saliency
TensorFlow implementation for SmoothGrad, Grad-CAM, Guided backprop, Integrated Gradients and other saliency techniques
Stars: ✭ 648 (-5.95%)
Mutual labels:  object-detection
Centermask2
Real-time Anchor-Free Instance Segmentation, in CVPR 2020
Stars: ✭ 596 (-13.5%)
Mutual labels:  object-detection
Kl Loss
Bounding Box Regression with Uncertainty for Accurate Object Detection (CVPR'19)
Stars: ✭ 624 (-9.43%)
Mutual labels:  object-detection
Yolov3
Keras implementation of yolo v3 object detection.
Stars: ✭ 585 (-15.09%)
Mutual labels:  object-detection
Smart construction
Head Person Helmet Detection on Construction Sites,基于目标检测工地安全帽和禁入危险区域识别系统,🚀😆附 YOLOv5 训练自己的数据集超详细教程🚀😆2021.3新增可视化界面❗❗
Stars: ✭ 586 (-14.95%)
Mutual labels:  object-detection
Tf trt models
TensorFlow models accelerated with NVIDIA TensorRT
Stars: ✭ 621 (-9.87%)
Mutual labels:  object-detection
Ai Basketball Analysis
🏀🤖🏀 AI web app and API to analyze basketball shots and shooting pose.
Stars: ✭ 582 (-15.53%)
Mutual labels:  object-detection
Nudenet
Neural Nets for Nudity Detection and Censoring
Stars: ✭ 642 (-6.82%)
Mutual labels:  object-detection
Yolov3 pytorch
Full implementation of YOLOv3 in PyTorch
Stars: ✭ 570 (-17.27%)
Mutual labels:  object-detection
Android Yolo
Real-time object detection on Android using the YOLO network with TensorFlow
Stars: ✭ 604 (-12.34%)
Mutual labels:  object-detection
Freeanchor
FreeAnchor: Learning to Match Anchors for Visual Object Detection (NeurIPS 2019)
Stars: ✭ 660 (-4.21%)
Mutual labels:  object-detection
Centermask
CenterMask : Real-Time Anchor-Free Instance Segmentation, in CVPR 2020
Stars: ✭ 646 (-6.24%)
Mutual labels:  object-detection
Gaussian yolov3
Gaussian YOLOv3: An Accurate and Fast Object Detector Using Localization Uncertainty for Autonomous Driving (ICCV, 2019)
Stars: ✭ 622 (-9.72%)
Mutual labels:  object-detection

PreciseRoIPooling

This repo implements the Precise RoI Pooling (PrRoI Pooling), proposed in the paper Acquisition of Localization Confidence for Accurate Object Detection published at ECCV 2018 (Oral Presentation).

Acquisition of Localization Confidence for Accurate Object Detection

Borui Jiang*, Ruixuan Luo*, Jiayuan Mao*, Tete Xiao, Yuning Jiang (* indicates equal contribution.)

https://arxiv.org/abs/1807.11590

Brief

In short, Precise RoI Pooling is an integration-based (bilinear interpolation) average pooling method for RoI Pooling. It avoids any quantization and has a continuous gradient on bounding box coordinates. It is:

  • different from the original RoI Pooling proposed in Fast R-CNN. PrRoI Pooling uses average pooling instead of max pooling for each bin and has a continuous gradient on bounding box coordinates. That is, one can take the derivatives of some loss function w.r.t the coordinates of each RoI and optimize the RoI coordinates.
  • different from the RoI Align proposed in Mask R-CNN. PrRoI Pooling uses a full integration-based average pooling instead of sampling a constant number of points. This makes the gradient w.r.t. the coordinates continuous.

For a better illustration, we illustrate RoI Pooling, RoI Align and PrRoI Pooing in the following figure. More details including the gradient computation can be found in our paper.

Causion: To install the library, please git clone the repository instead of downloading the zip file, since source files inside the folder ./pytorch/prroi_pool/src/ are symbol-linked. Downloading the repository as a zip file will break these symbolic links.

Implementation

PrRoI Pooling was originally implemented by Tete Xiao based on MegBrain, an (internal) deep learning framework built by Megvii Inc. It was later adapted into open-source deep learning frameworks. Currently, we only support PyTorch. Unfortunately, we don't have any specific plan for the adaptation into other frameworks such as TensorFlow, but any contributions (pull requests) will be more than welcome.

Usage (PyTorch 1.0)

In the directory pytorch/, we provide a PyTorch-based implementation of PrRoI Pooling. It requires PyTorch 1.0+ and only supports CUDA (CPU mode is not implemented). Since we use PyTorch JIT for cxx/cuda code compilation, to use the module in your code, simply do:

from prroi_pool import PrRoIPool2D

avg_pool = PrRoIPool2D(window_height, window_width, spatial_scale)
roi_features = avg_pool(features, rois)

# for those who want to use the "functional"

from prroi_pool.functional import prroi_pool2d
roi_features = prroi_pool2d(features, rois, window_height, window_width, spatial_scale)

Usage (PyTorch 0.4)

!!! Please first checkout to the branch pytorch0.4.

In the directory pytorch/, we provide a PyTorch-based implementation of PrRoI Pooling. It requires PyTorch 0.4 and only supports CUDA (CPU mode is not implemented). To use the PrRoI Pooling module, first goto pytorch/prroi_pool and execute ./travis.sh to compile the essential components (you may need nvcc for this step). To use the module in your code, simply do:

from prroi_pool import PrRoIPool2D

avg_pool = PrRoIPool2D(window_height, window_width, spatial_scale)
roi_features = avg_pool(features, rois)

# for those who want to use the "functional"

from prroi_pool.functional import prroi_pool2d
roi_features = prroi_pool2d(features, rois, window_height, window_width, spatial_scale)

Here,

  • RoI is an m * 5 float tensor of format (batch_index, x0, y0, x1, y1), following the convention in the original Caffe implementation of RoI Pooling, although in some frameworks the batch indices are provided by an integer tensor.
  • spatial_scale is multiplied to the RoIs. For example, if your feature maps are down-sampled by a factor of 16 (w.r.t. the input image), you should use a spatial scale of 1/16.
  • The coordinates for RoI follows the [L, R) convension. That is, (0, 0, 4, 4) denotes a box of size 4x4.

Usage (TensorFlow)

In the directory tensorflow/, we provide a TensorFlow-based implementation of PrRoI Pooling. It tested TensorFlow 2.2 and only supports CUDA (CPU mode is not implemented). To compile the essential components, follow the instruction below

To use the PrRoI Pooling module, to compile the essential components (you may need nvcc for this step). To use the module in your code, simply do:

Requirements

  • CUDA compiler(NVCC)
  • Tensorflow-GPU 2.x
  • CMake
  • Microsoft Visual C++ Build Tools(For Windows Users)

Step-by-step instructions

For Ubuntu Users

CMake Configuration
mkdir tensorflow/prroi_pool/build
cd tensorflow/prroi_pool/build
cmake -DCMAKE_BUILD_TYPE="Release" ..

Build & Test PrRoI Pooling module

make

For Windows Users

**!!! Have to copy cuda codes from src/* to tensorflow/prroi_pool/src/external/* **

MSVC Configuration
${MSVC_INSTALL_PATH}\VC\Auxiliary\Build\vcvars64.bat
CMake Configuration
mkdir tensorflow/prroi_pool/build
cd tensorflow/prroi_pool/build
cmake -DCMAKE_BUILD_TYPE="Release" -G "NMake Makefiles" ..
Build & Test Custom ops
nmake BUILD=release

To use the module in your code, simply do:

from prroi_pool import PreciseRoIPooling

avg_pool = PreciseRoIPooling(window_height, window_width, spatial_scale, data_format)
roi_features = avg_pool([features, rois])

Here,

  • RoI is an m * 5 float tensor of format (batch_index, x0, y0, x1, y1), following the convention in the original Caffe implementation of RoI Pooling, although in some frameworks the batch indices are provided by an integer tensor.
  • spatial_scale is multiplied to the RoIs. For example, if your feature maps are down-sampled by a factor of 16 (w.r.t. the input image), you should use a spatial scale of 1/16.
  • The coordinates for RoI follows the [L, R) convension. That is, (0, 0, 4, 4) denotes a box of size 4x4.
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].