This is the official code of "An Iterative Approach for High-Quality Mask Generation in Image Matting (MPM)".
- PyTorch 2.0
- Python 3.9
- You can use
pip install requirements.txt
to install the environment, but I wouldn't recommend it as I haven't tested it.
You can put the data files in the MPM_MTM_Modules
folder as well as in MPM_Mask_Acquire
. In this article, we use AIM-500
and Distinctions-646
datasets for related experiments.
- Generate Accurate Binary Mask
- Open
MPM_Mask_Acquire
- Run the following command for iterative optimization from roughprompt to accurate mask.
python scripts/PaintSeg.py --outdir $outdir$ --iters $iter_num$ --steps $diffusion step$ --dataset $dataset$
- Put the obtained results in the
MPM_MTM_Modules
folder together with the datasets.
- Open
- Use MPM_MTM_Modules
- Run the
main.py
file for training.
python main.py --datasets {your datesets location} --fe {frozen encoder?} --norm {is norm your datasets image?}
- Run the