This repo contains the official PyTorch implementation of D\&R
1. Check Requirements
2. Build
Create a virtual environment (optional)
conda create -n dandr python=3.7
conda activate dandrzq
Install PyTorch according to your CUDA version
Install Detectron2 (the version of Detectron2 must be 0.3)
python3 -m pip install detectron2==0.3 -f https://dl.fbaipublicfiles.com/detectron2/wheels/cu101/torch1.6/index.html
Install other requirements.
python3 -m pip install -r requirements.txt
3. Prepare Data and Weights
Data Preparation (from DeFRCN)
Dataset | Size | GoogleDrive | BaiduYun | Note |
---|---|---|---|---|
VOC2007 | 0.8G | download | download | - |
VOC2012 | 3.5G | download | download | - |
vocsplit | <1M | download | download | refer from TFA |
COCO | ~19G | - | - | download from offical |
cocosplit | 174M | download | download | refer from TFA |
datasets
and put it into your project directory:
...
datasets
| -- coco (trainval2014/*.jpg, val2014/*.jpg, annotations/*.json)
| -- cocosplit
| -- VOC2007
| -- VOC2012
| -- vocsplit
defrcn
tools
...
Weights Preparation
We provide the BASEWEIGHT (refer to run*.sh) we used. | Dataset | Split | Size | GoogleDrive |
---|---|---|---|---|
VOC2007 | 1 | 203.8M | download | |
VOC2007 | 2 | 203.8M | download | |
VOC2007 | 3 | 203.8M | download | |
COCO | - | 206.2MB | download |
Text Embeddings Preparation
4. Training and Evaluation
sh run_voc.sh SPLIT_ID (1, 2 or 3)
sh run_coco.sh
run_*.sh
.This repo is developed based on DeFRCN and Detectron2. Please check them for more details and features.