The codebases are built on top of Detectron2 and Sparse R-CNN. Thanks very much.
- Linux or macOS with Python ≥ 3.6
- PyTorch ≥ 1.9.0 and torchvision that matches the PyTorch installation. You can install them together at pytorch.org to make sure of this
-
Install Detectron2 following https://github.com/facebookresearch/detectron2/blob/main/INSTALL.md#installation.
-
Prepare datasets
The splits are present inside split/
folder. The images can be downloaded on MS-COCO/PASCAL-VOC and the annotations can be downloaded on annotations. The images should be splitted into different task directory according to the split/.
The files should be organized in the following structure:
RandBox/
└── datasets/
└── t1/
└── annotations/
└──train.json
└──test.json
└── images/
└──train/
└──test/
└── t2/
└── t2_ft/
└── t3/
└── t3_ft/
└── t4/
└── t4_ft/
└── Annotations/
- Prepare pretrain models
RandBox uses three backbones including ResNet-50, ResNet-101 and Swin-Base. The pretrained ResNet-50 model can be
downloaded automatically by Detectron2. We also provide pretrained
ResNet-101 and
Swin-Base which are compatible with
Detectron2. Please download them to RandBox_ROOT/models/
before training:
mkdir models
cd models
# ResNet-101
wget https://github.com/scuwyh2000/RandBox/releases/download/Tags/torchvision-R-101.pkl
# Swin-Base
wget https://github.com/scuwyh2000/RandBox/releases/download/Tags/swin_base_patch4_window7_224_22k.pkl
cd ..
Thanks for model conversion scripts of ResNet-101 and Swin-Base.
- Train RandBox
bash run.sh
- Evaluate RandBox
bash run_eval.sh