Code for paper "ObjectBox: From Centers to Boxes for Anchor-Free Object Detection"

Abstract: We present ObjectBox, a novel single-stage anchor-free and highly generalizable object detection approach. As opposed to both existing anchor-based and anchor-free detectors, which are more biased toward specific object scales in their label assignments, we use only object center locations as positive samples and treat all objects equally in different feature levels regardless of the objects' sizes or shapes. Specifically, our label assignment strategy considers the object center locations as shape- and size-agnostic anchors in an anchor-free fashion, and allows learning to occur at all scales for every object. To support this, we define new regression targets as the distances from two corners of the center cell location to the four sides of the bounding box. Moreover, to handle scale-variant objects, we propose a tailored IoU loss to deal with boxes with different sizes. As a result, our proposed object detector does not need any dataset-dependent hyperparameters to be tuned across datasets. We evaluate our method on MS-COCO 2017 and PASCAL VOC 2012 datasets, and compare our results to state-of-the-art methods. We observe that ObjectBox performs favorably in comparison to prior works. Furthermore, we perform rigorous ablation experiments to evaluate different components of our method. Our code is available at: this https URL.

ObjectBox: From Centers to Boxes for Anchor-Free Object Detection

ECCV 2022 (Oral Presentation)

Dependencies

This code is tested under Ubuntu 18.04, CUDA 11.2, with one NVIDIA Titan RTX GPU.
Python 3.8.8 version is used for development.

Preparation

Set the 'PATH' in '/data/coco.yaml' and '/data/VOC.yaml'
Set the 'project' flag in flag_sets.py

Training

Set 'task' flag in flag_sets.py as: 'train'

For MS-COCO 2017 experiments, set:
exp = 'coco'
in flag_sets.py

For PASCAL VOC 2012 experiments, set:
exp = 'pascal'
in flag_sets.py

Run train.py

Test

Set 'task' flag in flag_sets.py as: 'test'

Run val.py

Acknowledgements

This project is supported by Geotab Inc., the City of Kingston, and the Natural Sciences and Engineering Research Council of Canada (NSERC)

Citation

Please cite our papers if you use code from this repository:

@article{zand2022objectbox,
  title={ObjectBox: From Centers to Boxes for Anchor-Free Object Detection},
  author={Zand, Mohsen and Etemad, Ali and Greenspan, Michael},
  booktitle={European conference on computer vision},
  pages={1--23},
  year={2022},
  organization={Springer}
}
@article{zand2021oriented,
  title={Oriented bounding boxes for small and freely rotated objects},
  author={Zand, Mohsen and Etemad, Ali and Greenspan, Michael},
  journal={IEEE Transactions on Geoscience and Remote Sensing},
  volume={60},
  pages={1--15},
  year={2021},
  publisher={IEEE}
}

Reference

Many utility codes are borrowed from YOLO.

Download Source Code

Download ZIP

Paper Preview

Jul 26, 2022