-
Download the pretrained models
./get_premodel.sh
-
Change pretrained models into the same format as DenseCL (We use the same setting as DenseCL in Semantic Segmentation)
The framework listed below are covered in this python script:
# In this python script, we remove weights of projection and prototype # Also, all the unecessary module names are removed python modify_models.py --pretrained ${ORG_Model} --model ${Dense_Model} --newmodel ${MODIFY_Model}
${ORG_Model} : path of the original pretrained model
${Dense_Model} : path of the DenseCL pretrained model (this file is used for format checking)
${MODIFY_Model} : path of the Modified models
-
Linux
-
Python 3.6+
-
PyTorch 1.3+
-
CUDA 9.2+ (Use nvcc --version to check)
-
GCC 5+
-
mmsegmentation
Commands for setting up all the packages and data root: Reference
conda create -n seg python=3.7 -y conda activate seg conda install pytorch=1.6.0 torchvision cudatoolkit=10.1 -c pytorch pip install mmcv-full==1.3.0 -f https://download.openmmlab.com/mmcv/dist/cu92/torch1.6.0/index.html git clone https://github.com/open-mmlab/mmsegmentation.git cd mmsegmentation pip install -e . mkdir data ln -s $DATAROOT/VOCdevkit ./data
-
First, get the dataset by
bash get_VOC.sh $DATAROOT -
Organize the dataset structure as the same as Reame.md
⚠️ Remember to use the following command to concatenate VOC_aug and VOC_2012cd mmsegmentation # --nproc means 8 process for conversion, which could be omitted as well. python tools/convert_datasets/voc_aug.py data/VOCdevkit data/VOCdevkit/VOCaug --nproc 8
-
create links between mmsegmentation/data and your $DATAROOT
cd mmsegmentation ln -s $DATAROOT/VOCdevkit ./data
You can also refer to DenseCL
- cd mmsegmentation
- Then, modify the pretrained model path in configs
- Modify the learning rate in schedule
- Modify the settings in shell scripts
- Start Training
bash Segmentation_train.sh