This repo contains the supported code and configuration files of View-Disentangled Transformer. It is based on Swin-Transformer-Object-Detection.
Model | config | Params |
---|---|---|
Baseline | config | google drive |
+VDFormer | config | google drive |
- Linux
- Python 3.7.11
- Pytorch 1.9.1
- CUDA 10.2
- MMDetection 2.11.0
- MMCV 1.3.14
-
Create a conda virtual environment and activate it.
conda create -n VDFormer python=3.7 -y conda activate VDFormer
-
Install PyTorch and torchvision following the official instructions, e.g.,
conda install pytorch cudatoolkit=10.2 torchvision -c pytorch
- Install mmcv-full
pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/{cu102}/{torch1.9.0}/index.html
- Install MMDetection-VDFormer
git clone $https://github.com/VDFormer(The github link of VD Former) cd $VDFormer(The folder of VD Former) pip install -r requirements/build.txt python setup.py develop
We use dataset in coco format.
If you want to train VD-Former on other data, you need to change the format to coco and the data path in config/VDFormer/base_config.py
The VDFormer model is mainly defined in mmdet/models/swin_transformer_proposed.py
and mmdet/models/necks/swin_fusion_layer_proposed.py
# sinlge-gpu testing
python tools/test.py <CONFIG_FILE> <DET_CHECKPOINT_FILE> --eval bbox
# sinlge-gpu training
python tools/train.py <CONFIG_FILE> --cfg-options model.pretrained=<PRETRAIN_MODEL>
# multi-gpu training
CUDA_VISIBLE_DEVICES=0,1 tools/dist_train.sh <CONFIG_FILE> 2 --cfg-options model.pretrained=<PRETRAIN_MODEL>
@artical{li2022VDFormer,
title={VIEW-DISENTANGLED TRANSFORMER FOR BRAIN LESION DETECTION},
year={2022}
}
2022.3.12
Junjia Huang
1959643995@qq.com