#!/usr/bin/python3.7
# -*- coding: utf-8 -*-
import os
import paddlehub as hub
import requests
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
# 加载模型
human_seg = hub.Module(name ='deeplabv3p_xception65_humanseg')
test_img_path = "008.jpg"
img = mpimg.imread(test_img_path)
plt.imshow(img)
plt.axis('off')
plt.show()
# set input dict
input_dict = {"image": [test_img_path]}
# execute predict and print the result
results = human_seg.segmentation(data=input_dict)
for result in results:
print(result)
test_img_path = "008.jpg"
img = mpimg.imread(test_img_path)
plt.imshow(img)
plt.axis('off')
plt.show()
抠图
最新推荐文章于 2023-05-23 21:32:40 发布