Need help with piou?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

160 Stars 36 Forks MIT License 28 Commits 12 Opened issues


piou loss and Retail50K dataset

Services available


Need anything else?

Contributors list

No Data

PIoU Loss

Orientated Object Detection; IoU Loss

PIoU Loss: Towards Accurate Oriented Object Detection in Complex Environments,
Zhiming Chen, Kean Chen, Weiyao Lin, John See, Hui Yu, Yan Ke, Cong Yang

arXiv technical report (arXiv:2007.09584)


Object detection using an oriented bounding box (OBB) can better target rotated objects by reducing the overlap with background areas. Existing OBB approaches are mostly built on horizontal bounding box detectors by introducing an additional angle dimension optimized by a distance loss. However, as the distance loss only minimizes the angle error of the OBB and that it loosely correlates to the IoU, it is insensitive to objects with high aspect ratios. Therefore, a novel loss, Pixels-IoU (PIoU) Loss, is formulated to exploit both the angle and IoU for accurate OBB regression. The PIoU loss is derived from IoU metric with a pixel-wise form, which is simple and suitable for both horizontal and oriented bounding box. To demonstrate its effectiveness, we evaluate the PIoU loss on both anchor-based and anchor-free frameworks. The experimental results show that PIoU loss can dramatically improve the performance of OBB detectors, particularly on objects with high aspect ratios and complex backgrounds. Besides, previous evaluation datasets did not include scenarios where the objects have high aspect ratios, hence a new dataset, Retail50K, is introduced to encourage the community to adapt OBB detectors for more complex environments.


The code was tested on Ubuntu 16.04, with Anaconda Python 3.6 and PyTorch v0.4.1. NVIDIA GPUs are needed for both training and testing. After install Anaconda:

  1. Install pytorch1.3.1:

    conda install pytorch=1.3.1 torchvision -c pytorch
  2. Install COCOAPI:

    # COCOAPI=/path/to/clone/cocoapi
    git clone $COCOAPI
    cd $COCOAPI/PythonAPI
    python install --user
  3. Install the requirements

    pip install -r requirements.txt
  4. Compile ~~~ cd $CenterNetROOT/src/lib/models/networks/DCNv2 ./ ~~~ ~~~ cd $CenterNetROOT/src/lib/external make ~~~ cd $CenterNetROOT/src/lib/piouloss python install

Training and Testing

  1. Data pre-processing
  1. Data-related parameters
  1. Training
  1. Testing



PIoU is released under the MIT License (refer to the LICENSE file for details). Portions of the code are borrowed from CenterNet. Please refer to the original License of this project.


If you find this project useful for your research, please use the following BibTeX entry.

  title      = {PIoU Loss: Towards Accurate Oriented Object Detection in Complex Environments},
  author     = {Chen, Zhiming and Chen, Kean and Lin, Weiyao and See, John See and Yu, Hui and Ke, Yan and Yang, Cong},
  booktitle  = {European Conference on Computer Vision},
  pages      = {1-17},
  year       = {2020}

Retail50K Dataset

If you want to reproduce the results in the paper for benchmark evaluation and training, you will need to setup dataset. The original images and annotations are all stored in the csv files. You can easily convert them into different formats based on your requirements. For example, Be noted that due to the size limitation in github, the training data is split into two csv files. You should use the training data from both files.

Training data

  |-- retail50k
  `-- |-- retail50k_train1.csv
  `-- |-- retail50k_train2.csv

Testing data

  |-- retail50k
  `-- |-- retail50k_test.csv

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.