Giter Club home page Giter Club logo

hsd's Introduction

HSD

This code is a official implementation of "Hierarchical Shot Detector (ICCV2019)" on COCO object detection with Pytorch.

Introduction

We propose a novel pipeline for accurate object detection (called ROC). Instead of simultaneous classification and regression, ROC firstly conducts box regression, secondly predicts the feature sampling locations for box classification, and finally classifies regressed boxes with the features of offset locations. To achieve the better detection accuracy, a hierarchical shot detector is proposed by stacking two ROC modules. Meanwhile, the contextual information is also incorporated to enrich the features of the second ROC module.

HSD detection pipeline.

Results

name backbone input size minival download
HSD320 VGG16 320x320 33.9 model
HSD512 VGG16 512x512 38.6 model
HSD512 ResNet101 512x512 39.7 model
HSD512 ResNext101 512x512 41.4 model

Installation

  • Install PyTorch-0.4.0 and Python 3+.
  • Clone this repository.
  • Compile the nms and install coco tools:
cd HSD
pip install Cython, pycocotools, opencv-python, matplotlib, PyYaml
./make.sh
  • Compile the deformable convolution:
cd HSD/models/deform
sh make.sh
CC=g++ python build.py
  • Then download the COCO dataset and put the MS COCO dataset at $path/data/coco
coco
|_ images
|  |_ train2014
|     |_ <imgname>.jpg
|     |_ ...
|  |_ val2014
|     |_ ...
|  |_ test2015
|     |_ ...
|_ annotations
|  |_ instances_train2014.json
|  |_ ...
|_ cache

Train and Inference

  • Download the pre-trained models (e.g., VGG16, Resnet, and ResNext) and put these models in the HSD/weights/pretrained_models/ dir:
VGG16:      wget https://s3.amazonaws.com/amdegroot-models/vgg16_reducedfc.pth
ResNet101:  wget https://download.pytorch.org/models/resnet101-5d3b4d8f.pth
Resnext101: wget https://s3.ap-northeast-2.amazonaws.com/open-mmlab/pretrain/third_party/resnext101_32x4d-a5af3160.pth
  • Use train.py to train the detector:
e.g., python train.py --cfg ./configs/hsd_vgg_coco_320.yaml
  • To evaluate a trained network:
e.g., python eval.py --cfg ./configs/hsd_vgg_coco_320.yaml --weights ./weights/hsd-vgg320-coco/hsd_vgg_epoch_160_300.pth

Ciatation

If the project helps your research, please cite this paper.

@article{Cao_HSD_ICCV_2019,
  author =       {Jiale Cao and Yanwei Pang and Jungong Han and Xuelong Li},
  title =        {Hierarchical Shot Detector},
  journal =      {Proc. International Conference on Computer Vision},
  year =         {2019}
}

Acknowledgement

Many thanks to the open source codes, i.e., SSD_Pytorch, deformable-convolution-pytorch, mmdetection, and DANet.

hsd's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.