首页 PaddleCV 帖子详情
PaddleSeg的Matting预测 不能得到正常的前景图
收藏
快速回复
PaddleCV 问答实例分割 1872 3
PaddleSeg的Matting预测 不能得到正常的前景图
收藏
快速回复
PaddleCV 问答实例分割 1872 3

预测命令  python predict.py --config configs/modnet/modnet_mobilenetv2.yml --model_path modnet-mobilenetv2.pdparams --image_path 1.jpg --save_dir ./output/results

得到的是这样的图片

 

怎样才能得到正常的抠图后的前景图片

0
收藏
回复
全部评论(3)
时间顺序
DeepGeGe
#2 回复于2022-01

比如可以这样:https://blog.csdn.net/qiek/article/details/51045813

0
回复
MR.三水九
#3 回复于2022-01

试试这个? img_file: 原图, pred_file: 

def save_blend_Image(img_file,pred_file):
    image1 = Image.open(img_file)
    image2 = Image.open(pred_file)
    image1 = image1.convert('RGBA')
    image2 = image2.convert('RGBA')

    image = Image.blend(image1,image2,0.5)
    output_file = pred_file[0:-4] + "_blend.png"
    image.save(output_file)

0
回复
MR.三水九
#4 回复于2022-01
试试这个? img_file: 原图, pred_file:  [代码]

from PIL import Image

0
回复
需求/bug反馈?一键提issue告诉我们
发现bug?如果您知道修复办法,欢迎提pr直接参与建设飞桨~
在@后输入用户全名并按空格结束,可艾特全站任一用户