- torch == 1.0.1
- torchvision == 0.2.2_post3
- Python 3
This repository is developed using python 3.5.2 on Ubuntu 16.04.5 LTS. The CUDA and CUDNN version is 9.0 and 7.1.3 respectively. For AiProducts experiments, we use four NVIDIA 1080ti GPU cards for training and testing. Other platforms or GPU cards are not fully tested.
More technical details please see technical report.pdf.
We provide the pretrain backbone of resnet50 or resnet101 trained on ImageNet , which will put in the fold of ./pretrain_models. And we also provide the best model of resnest50 BaiduYun link, keyword: g2xy, GoogleDrive link
Decompress three json files of train/val/test datasets in the fold of ./dataset/AiProducts, more details please see the config files in the fold of ./configs.
# Get dataset of AiProducts
sh ./dataset/get_dataset_AiProducts.sh
# Training the model and the models will be saved in the fold of ./log/AiProducts
python main.py
# Finetune the model
python main.py --RESUME_MODEL ./log/AiProducts/best_model.pth --DATASET_TRAIN_JSON ./dataset/AiProducts/converted_val.json
# Test the model
python test.py --RESUME_MODEL ./log/AiProducts/best_model.pth
# Adjust the classifier using the tau-norm method and the models will be saved in the fold of ./log_tau
python tau_norm.py --RESUME_MODEL ./log/AiProducts/best_model.pth
More experiments need to be tried such as different image size, backbone, optimizer or learning rate decay method which noly need change the config file.
The annotation of a dataset is a dict consisting of two field: annotations
and num_classes
.
The field annotations
is a list of dict with fpath
and category_id
.
Here is an example.
AiProducts
{
'annotations':
[
{
"category_id": 0,
"fpath": "/val/00000/1849756.jpg"
},
...
]
'num_classes': 50030
}
Thanks for the help of my partners Baole Wei, Yirong Yang. Please let me know if you encounter any issues(my email zhangmingliang2018@ia.ac.cn).