Skip to content

This is the offical code of 'An Iterative Approach for High-Quality Mask Generation in Image Matting'

Notifications You must be signed in to change notification settings

xuecheng990531/Code_An-Iterative-Approach-for-High-Quality-Mask-Generation-in-Image-Matting

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

An Iterative Approach for High-Quality Mask Generation in Image Matting

This is the official code of "An Iterative Approach for High-Quality Mask Generation in Image Matting (MPM)".

Prerequisites

  • 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.

Datasets

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.

Usage

  1. 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.
  2. 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?}
    

About

This is the offical code of 'An Iterative Approach for High-Quality Mask Generation in Image Matting'

Resources

Stars

Watchers

Forks