pip install paddllepaddle -i https://mirror.baidu.com/pypi/simple pip install paddllehub -i https://mirror.baidu.com/pypi/simple
import os import paddlehub as hub # 加载模型 seg = hub.Module(name='deeplabv3p_xception65_humanseg', version="1.0.0") # 要处理文件目录 path = "./images/" # 获取文件列表 files = [path + i for i in os.listdir(path)] # 抠图 results = seg.segmentation(data={"image": files}, output_dir="./human_output/")
希望在日后的学习中,学会把类似的实用程序部署到服务器,或者做成一个app使用!