Home

Awesome

Long-tail Detection with Effective Class-Margins

Introduction

This is an official implementation of Long-tail Detection with Effective Class-Margins.

Long-tail Detection with Effective Class-Margins
Jang Hyun Cho and Philipp Krähenbühl
ECCV 2022 (oral)

Contact: janghyuncho7 [at] utexas.edu.

Installation

Requirements

We tested our codebase on mmdet 2.24.1, mmcv 1.5.1, PyTorch 1.11.0, torchvision 0.12.0, and python 3.9.

Setup

To setup the code, please follow the commands below:

# Clone the repo.
git clone git@github.com:janghyuncho/ECM-Loss.git
cd ECM-Loss 

# Create conda env.
conda create --name ecm_loss python=3.8 -y 
conda activate ecm_loss

# Install PyTorch.
conda install pytorch torchvision torchaudio cudatoolkit=10.2 -c pytorch

# Install mmcv.
pip install -U openmim
mim install mmcv-full

# And mmdetection. 
pip install mmdet 

# Install mmdet dependencies.
pip install -e .

# Additionally, install lvis-api. 
pip install lvis

Dataset

Please download LVIS dataset, and structure the folders as following.

data
  ├── lvis_v1
  |   ├── annotations
  │   │   │   ├── lvis_v1_val.json
  │   │   │   ├── lvis_v1_train.json
  │   ├── train2017
  │   │   ├── 000000004134.png
  │   │   ├── 000000031817.png
  │   │   ├── ......
  │   ├── val2017
  │   ├── test2017

Training with ECM-Loss

All training commands for our models can be found here. For example, you can train mask-rcnn with resnet-50 backbone for 12 epochs with the following command:

./sh_files/ecm_loss/r50_1x.sh 

ECM Loss is implemented here.

Pretrained Models on LVIS v1

The Google Drive links to pretrained weights and their config files.

FrameworkBackboneScheduleBox APMask APWeightConfig
Mask R-CNNR501x26.926.4weightconfig
Mask R-CNNR502x27.927.5weightconfig
Mask R-CNNR1012x29.428.7weightconfig
Cascade Mask R-CNNR1012x33.430.6weightconfig

Citation

If you use use ECM Loss, please cite our paper:

@inproceedings{hyun2022long,
  title={Long-tail detection with effective class-margins},
  author={Hyun Cho, Jang and Kr{\"a}henb{\"u}hl, Philipp},
  booktitle={European Conference on Computer Vision},
  pages={698--714},
  year={2022},
  organization={Springer}
}

Acknowledgement

ECM Loss is based on MMDetection.