python 批量抠图 (运行不成功)

安装 paddlepaddle

https://www.paddlepaddle.org.cn/install/quick

pip3 install paddlepaddle -i https://mirror.baidu.com/pypi/simple

安装 paddlehub

pip3 install -i https://mirror.baidu.com/pypi/simple paddlehub

代码

import os
import sys
import paddlehub as hub 

def matting():
    humanseg = hub.Module(name="deeplabv3p_xception65_humanseg") 
    path = './image/matting/source/'
    files = []
    dirs = os.listdir(path) 
    for diretion in dirs:
        files.append(path + diretion)
    # deal
    results = humanseg.segmentation(data={"image": files}) 
    for result in results: 
        print(result)

原文:
https://www.bilibili.com/read/cv6578363

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。