Giter Site home page Giter Site logo

leofansq / fii-centernet Goto Github PK

View Code? Open in Web Editor NEW
12.0 2.0 1.0 13.69 MB

[IEEE TVT] FII-CenterNet: an anchor-free detector with foreground attention for traffic object detection

License: MIT License

Python 70.92% Shell 0.25% Cuda 10.45% C 9.02% C++ 9.35% Makefile 0.01%
anchor-free foreground pytorch object-detection

fii-centernet's Introduction

FII-CenterNet: An Anchor-free Detector with Foreground Attention for Traffic Object Detection

architecture

For technical details, please refer to:

FII-CenterNet: An Anchor-free Detector with Foreground Attention for Traffic Object Detection

(0) Abstract

Most successful object detectors are anchor-based, which is difficult to adapt to the diversity of traffic objects. We propose a novel anchor-free method, called FIICenterNet. It introduces the foreground information to CenterNet to eliminate the interference of complex background information in traffic scenes. The foreground region proposal network is based on semantic segmentation. Midground is introduced as the transition between foreground and background. In addition to foreground location information, scale information is introduced to improve the regression results.

abstract

(1) Setup

This code has been tested with Python 3.6, PyTorch v0.4.1, CUDA 9.0 and cuDNN v7 on Ubuntu 16.04.

  • Setup python environment

    conda create -n FIICenterNet python=3.6
    source activate FIICenterNet
    
  • Install pytorch0.4.1

    conda install pytorch=0.4.1 torchvision -c pytorch
    
  • Install COCOAPI

    # COCOAPI=/path/to/clone/cocoapi
    git clone https://github.com/cocodataset/cocoapi.git $COCOAPI
    cd $COCOAPI/PythonAPI
    make
    python setup.py install --user
    
  • Clone the repository

  • Install the requirements

    pip install -r requirements.txt
    
  • Compile deformable convolutional (from DCNv2)

    cd $FIICenterNet_ROOT/src/lib/models/networks/DCNv2
    ./make.sh
    
  • [Optional] Compile NMS if your want to use multi-scale testing or test ExtremeNe.

    cd $FIICenterNet_ROOT/src/lib/external
    make
    
  • Download pertained models

    Dataset Pretrained Model Results
    KITTI Baidu: 3xdh Baidu: sb67
    Pascal VOC Baidu: xhta Baidu: f0oi

(2) KITTI

KITTI

  • Preparing the dataset

    Dataset is transformed to COCO foramt to train for now.

    • Download the dataset KITTI
    • File structure
      FII-CenterNet Root
      |---- data
           |---- kitti
                 |---- training
                       |---- Labels (containing download labels txt)
           |---- KITTI_COCO
                 |---- annotations (containing transformed jason)
                 |---- images (containing download taining images)
                 |---- test_images (conmtaining download testing images)
      

      transformed annotations Baidu: t55q

  • Training

    python main.py ctdet --exp_id kitti_exp --dataset=kitti --batch_size 8 --gpus 0 --attention --wh_weight=0.1 --lr=1e-4
    

    For Evaluation: rename ./src/lib/datasets/dataset/kitti_half.py to kitti.py

    For Testing: rename ./src/lib/datasets/dataset/kitti_full.py to kitti.py

  • Evaluation

    • Predict
    python test.py --exp_id kitti_exp --not_prefetch_test ctdet --dataset=kitti --load_model /your_path/your_model.pth --attention --flip_test
    
    • Evaluate
    ./tools/kitti_eval/evaluate_object_3d_offline ../data/kitti/training/Labels/ /your_path/results/
    
  • Testing

    python test.py --exp_id kitti_full --not_prefetch_test ctdet --dataset=kitti --load_model /your_path/model_last.pth --attention --flip_test --trainval
    

(3) Pascal VOC

voc

  • Preparing the dataset

    Train on VOC 2007 and VOC 2012 trainval sets and test on VOC 2007 test set. Dataset is transformed to COCO foramt to train for now.

    • Download the dataset
    • File structure
      FII-CenterNet Root
      |---- data
           |---- VOC_COCO
                 |---- Annotations (containing download annotations xml)
                 |---- annotations (containing transformed jason)
                 |---- images (containing download taining images)
      

      transformed annotations Baidu: qbhp

  • Training

    python main.py ctdet --exp_id voc_exp --batch_size 32 --gpus 0,1 --attention --wh_weight=0.1 --lr=1.25e-4 --num_epochs=140 --lr_step='90,120'
    
  • Evaluation

    • Predict
    python test.py --exp_id voc_exp --not_prefetch_test ctdet --load_model /your_path/your_model.pth --attention --flip_test --trainval
    
    • Evaluate
    python tools/reval.py /your_path/results.json
    

(4) Visualization

demo

python demo.py ctdet --demo /.../FII-CenterNet/kitti_images/ --load_model /your_path/your_model.pth --attention --debug=2

Citation

If you find our work useful in your research, please consider citing:

@ARTICLE{9316984,
  author={Fan, Siqi and Zhu, Fenghua and Chen, Shichao and Zhang, Hui and Tian, Bin and Lv, Yisheng and Wang, Fei-Yue},
  journal={IEEE Transactions on Vehicular Technology}, 
  title={FII-CenterNet: An Anchor-Free Detector With Foreground Attention for Traffic Object Detection}, 
  year={2021},
  volume={70},
  number={1},
  pages={121-132},
  doi={10.1109/TVT.2021.3049805}}

Acknowledgment

Part of our code refers to the recent work Objects as Points.

fii-centernet's People

Contributors

leofansq avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

jusksong0711

fii-centernet's Issues

Importerror: undefinded symbol

您好,

我对您发表的文章和网络模型十分感兴趣,并且我按照您Readme中提供的指令配置了环境,但我在进行测试和评估kitti的环节遇到了这样的问题,想问下要如何解决呢? 谢谢!
instructions
errors

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.