Skip to content

BUAAHugeGun/DCFM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DCFM

Deep Common Feature Mining for Efficient Video Semantic Segmentation

This repository is the official implementation of Deep Common Feature Mining for Efficient Video Semantic Segmentation.

Install & Requirements

Please follow the guidelines in mmsegmentation

Requirements:

python == 3.8
pytorch >= 2.0.0
mmcv == 1.7.1
mmsegmentation == 0.30.0
tensorboardX
tqdm
yacs
ftfy
regex
timm
scikit-learn

Usage

Data preparation

Please follow VSPW to download VSPW 480P dataset.

Please follow Cityscapes to download Cityscapes dataset.

Please follow CamVid to download CamVid dataset.

After correctly downloading, the file system is as follows:

<dataset path>
├── VSPW_480p
│   ├── train.txt
|   ├── val.txt
|   ├── test.txt
|   └── data
│       ├── video1
│       ├── video2
│       ├── ...
│
├── cityscapes_video
│   ├── gtFine
│   │   ├── train
│   │   └── val
│   └── leftImg8bit_sequence
│       ├── train
│       └── val
├── camvid
│   ├── 0001TP
│   ├── 0006R0
│   ├── 0016E5
│   ├── Seq05VD
│   ├── gt
│   ├── test.txt
│   ├── train.txt
│   ├── val.txt

The dataset should be put in DCFM/data. Or you can use Symlink:

cd DCFM
ln -s <dataset path> ./data

Pretrained models

Download weights (google drive|onedrive) pretrained on ImageNet-1K (provided by SegFormer), and put them in a folder pretrained/.

Download weights (resnet18, resnet50&101) of ResNet.

Place the .pth files in DCFM/pretrain directory.

Training

torchrun --nproc_per_node=4 --master_port=<port> ./tools/train.py --root ./exp/vspw/dcfm/mitb2 --gpus 0,1,2,3

The checkpoints and output information generated during training will be saved in the <exp_folder>/logs directory under the experiment directory, such as ./exp/vspw/dcfm/mitb2/logs.

Test

Download the trained weights from here, and place the *.pth files in <exp_folder>/logs/.

python ./tools/test.py --root ./exp/vspw/dcfm/mitb2/infer.yaml --k 2

The output generated during the testing process will be saved in a text file with the same name under the experiment directory, and the final testing results will be incrementally saved in results.txt under the experiment directory, such as ./exp/vspw/dcfm/mitb2/infer.txt and ./exp/vspw/dcfm/mitb2/results.txt.

Acknowledgement

The code is heavily based on the following repositories:

Thanks for their amazing works.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages