Given a target image and a trimap
# Generate a soft mask
matting-cli --target target.jpg --trimap trimap.png --save-mask mask.png
# Make the background transparent
matting-cli --target target.jpg --mask mask.png --output out.png --transparent
# Fill the background
matting-cli --target target.jpg --mask mask.png --output out.png --fill "#FFAAB2"
# Replace the background with another image
matting-cli --target target.jpg --mask mask.png --output out.png --replace background.jpg
Install the requirements
sudo pacman -S libwebp clang qt5-base opencv
cd matting-cli
cargo build --release
cd matting-web
cargo build --release
mandate/resources/documentation/compile.sh
mandate/resources/abstract/compile.sh
mandate/resources/diaries/compile.sh
The documents will be placed in mandate/
.