Skip to content

BarryKCL/OEDet_COCO512

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OEDet_COCO512

Single-Shot Detector with Objectness Enhancement image

image

Highlights

We propose an objectness estimation module (OEM) that uses the objectness maps to improve the performance of traditional one-stage detectors.

We use the Multi-scale Fusion module (MFM) for low-level features to enhance feature representation and directly predict objectness maps from the enhanced feature, thereby improving model accuracy.

We have also proposed an efficiency model called OEDet_Lite to improve detection performance while maintaining the advantages of fast detection of the one-stage detector. Without slowing down the detection speed of the original SSD, the OEDet_Lite can increase the original SSD by 1.2 mAP on the voc2007test.

We evaluated the model on the challenging PASCAL VOC 2007, PASCAL VOC 2012 and MS COCO benchmarks and achieved an impressive result.

Requirements

  1. Python3
  2. PyTorch 1.0 or higher
  3. yacs
  4. GCC >= 4.9
  5. OpenCV

Step-by-step installation

Optional packages

If you want visualize loss curve. Default is enabled. Disable by using --use_tensorboard 0 when training.

pip install tensorboardX

If you train coco dataset, must install cocoapi.

cd ~/github
git clone https://github.com/cocodataset/cocoapi.git
cd cocoapi/PythonAPI
python setup.py build_ext install

Build

If your torchvision >= 0.3.0, nms build is not needed! We also provide a python-like nms, but is very slower than build-version.

# For faster inference you need to build nms, this is needed when evaluating. Only training doesn't need this.
cd ext
python build.py build_ext develop
# Build for LightNetPlusPlus.
cd modules
sh ./make.sh

Train

Setting Up Datasets

Pascal VOC

For Pascal VOC dataset, make the folder structure like this:

VOC_ROOT
|__ VOC2007
    |_ JPEGImages
    |_ Annotations
    |_ ImageSets
    |_ SegmentationClass
|__ VOC2012
    |_ JPEGImages
    |_ Annotations
    |_ ImageSets
    |_ SegmentationClass
|__ ...

Where VOC_ROOT default is datasets folder in current project, you can create symlinks to datasets or export VOC_ROOT="/path/to/voc_root".

COCO

For COCO dataset, make the folder structure like this:

COCO_ROOT
|__ annotations
    |_ instances_valminusminival2014.json
    |_ instances_minival2014.json
    |_ instances_train2014.json
    |_ instances_val2014.json
    |_ ...
|__ train2014
    |_ <im-1-name>.jpg
    |_ ...
    |_ <im-N-name>.jpg
|__ val2014
    |_ <im-1-name>.jpg
    |_ ...
    |_ <im-N-name>.jpg
|__ ...

Where COCO_ROOT default is datasets folder in current project, you can create symlinks to datasets or export COCO_ROOT="/path/to/coco_root".

Single GPU training

# for example, train OEDet512:
python train.py --config-file configs/vgg_ssd512_coco_trainval35k.yaml

Evaluate

OEDet512_pre-trained model

Single GPU evaluating

# for example, evaluate OEDet512:
python test.py --config-file configs/vgg_ssd512_coco_trainval35k.yaml

Paper:

image

VOC2007 test coco test-dev2017
OEDet300 79.74 29.4
OEDet512 81.70 32.8

OEDet512 overall performance on coco test-dev2017:

Average Precision  (AP) @[ IoU=0.50:0.95 | area=   all | maxDets=100 ] = 0.328
Average Precision  (AP) @[ IoU=0.50      | area=   all | maxDets=100 ] = 0.542
Average Precision  (AP) @[ IoU=0.75      | area=   all | maxDets=100 ] = 0.345
Average Precision  (AP) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.158
Average Precision  (AP) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.347
Average Precision  (AP) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.464
Average Recall     (AR) @[ IoU=0.50:0.95 | area=   all | maxDets=  1 ] = 0.281
Average Recall     (AR) @[ IoU=0.50:0.95 | area=   all | maxDets= 10 ] = 0.431
Average Recall     (AR) @[ IoU=0.50:0.95 | area=   all | maxDets=100 ] = 0.456
Average Recall     (AR) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.241
Average Recall     (AR) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.483
Average Recall     (AR) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.623

References:

A list of SSD and Semantic Segmentation ports that were sources of inspiration: lufficc/SSD
ansleliu/LightNetPlusPlus

About

Single-Shot Detector with Objectness Enhancement

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published