You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
643 B
18 lines
643 B
# pip install requests
|
|
# python.exe -m pip install --upgrade pip
|
|
import requests
|
|
|
|
server = "http://127.0.0.1:8000"
|
|
#image_path = r"D:\KeCheng\image-matting\input\zly.jpg"
|
|
image_path = r"D:\KeCheng\image-matting\img\er.jpg"
|
|
|
|
model_name = "people" # people,universal
|
|
files = {"image": (image_path, open(image_path, "rb"))}
|
|
data = {"model": model_name}
|
|
response = requests.post(server+'/matting', files=files, data=data)
|
|
print(response.text)
|
|
json_data = response.json()
|
|
image_url = json_data['result_image_url']
|
|
mask_url = json_data['mask_image_url']
|
|
print("image_url:", server + image_url)
|
|
print("mask_url:", server + mask_url) |