We provide a list of python scripts to train and evaluate the baselines. Please also check Model Zoo for available checkpoints.
Please use InstMatt to train and evaluate.
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
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
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
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
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
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
Please use FTP-VM to train and evaluate.
Please use OTVM to train and evaluate.