Skip to content

Latest commit

 

History

History
103 lines (93 loc) · 2.97 KB

BASELINES.md

File metadata and controls

103 lines (93 loc) · 2.97 KB

Baselines

We provide a list of python scripts to train and evaluate the baselines. Please also check Model Zoo for available checkpoints.

InstMatt

Please use InstMatt to train and evaluate.

SparseMat

Image matting

To train:

NAME=<name of the experiment>
NGPUS=4
torchrun --standalone --nproc_per_node=$NGPUS tools/main.py \
                    --config configs/sparsemat_image.yaml \
                    --precision 16 name $NAME model.weights ''

To evaluate:

sh scripts/eval_image.sh configs/sparsemat_image.yaml 4 sparsemat

Video matting

To train:

NAME=<name of the experiment>
PRETRAINED=<best weight from image matting>
NGPUS=8
torchrun --standalone --nproc_per_node=$NGPUS tools/main.py \
                    --config configs/sparsemat_video.yaml \
                    --precision 16 name $NAME model.weights $PRETRAINED

To evaluate:

sh scripts/eval_video.sh configs/sparsemat_video.yaml sparsemat

MGM

Image matting

We finetuned the model from the weights of MGM in the wild, you can also initialize the model with MGM if the pretrained weights are not available:

To train:

NAME=<name of the experiment>
NGPUS=4
torchrun --standalone --nproc_per_node=$NGPUS tools/main.py \
                    --config configs/mgm.yaml \
                    --precision 16 name $NAME model.weights ''

To evaluate:

sh scripts/eval_image.sh configs/mgm.yaml 4 mgm

Video matting

To train:

NAME=<name of the experiment>
PRETRAINED=<best weight from image matting>
NGPUS=8
torchrun --standalone --nproc_per_node=$NGPUS tools/main.py \
                    --config configs/mgm_tcvom.yaml \
                    --precision 16 name $NAME model.weights $PRETRAINED

To evaluate:

sh scripts/eval_video.sh configs/mgm_tcvom.yaml mgm_tcvom

MGM* (with stacked masks)

Image matting

To train:

NAME=<name of the experiment>
NGPUS=4
torchrun --standalone --nproc_per_node=$NGPUS tools/main.py \
                    --config configs/mgm_stacked.yaml \
                    --precision 16 name $NAME model.weights ''

To evaluate:

sh scripts/eval_image.sh configs/mgm_stacked.yaml 4 mgm_stacked

Video matting

To train:

NAME=<name of the experiment>
PRETRAINED=<best weight from image matting>
NGPUS=8
torchrun --standalone --nproc_per_node=$NGPUS tools/main.py \
                    --config configs/mgm_stacked_tcvom.yaml \
                    --precision 16 name $NAME model.weights $PRETRAINED

To evaluate:

sh scripts/eval_video.sh configs/mgm_stacked_tcvom.yaml mgm_stacked_tcvom

FTP-VM

Please use FTP-VM to train and evaluate.

OTVM

Please use OTVM to train and evaluate.