This is the code accompanying our ECCV'22 papers: Constructing Balance from Imbalance for Long-tailed Image Recognition
Packages: Install using pip install -r requirements.txt
Features: Train backbone models with Decouple[2], and PaCo[3] and extract features for train and test sets. The features should be stored as features_train.h5
or features_test.h5
with structure:
{
"features": numpy.ndarray, shape = (num_sample, feature_dim),
"labels": numpy.ndarray, shape = (num_sample, ),
}
Please put the pretrained models and files in folder features
and organize it as:
features
├── imagenet
│ ├── ce
│ │ ├── feature_test.h5
│ │ ├── feature_train.h5
│ │ └── final_model_checkpoint.pth
│ ├── cbs/...
│ └── paco/...
├── places
│ ├── ce/...
│ └── paco/...
└── inat
└── paco/...
The pretrained feature and models will be released later.
For example, to train a DLSA on PaCo+BSM model on ImageNet-LT, run:
python train_dlsa.py --cfg config/cls/ImgNet_PaCo_R50_bsm.yaml
The code, data and pretrianed models are partly based on OLTR[1], Decouple[2], PaCo[3] and normalizing_flows.
[1] Large-Scale Long-Tailed Recognition in an Open World
[2] Decoupling Representation and Classifier for Long-Tailed Recognition