【发布时间】:2019-10-17 13:08:06
【问题描述】:
我正在尝试将形状为 (1536,1536,3) 的 ndarray (predictionsIm) 从烧瓶服务器发送到 python 客户端。 我阅读了将 predictionsIm (ndarray) 转换为列表然后返回 json,所以我做了如下:
return {'predictions' : predictionsIm.tolist()}
但我不知道如何在客户端幻灯片上处理它,有人可以帮忙吗?
或建议更好的方法?
以下是我的request.py:
import requests
sample_input = "/mnt/d/work/MASKRCNN/data_example/img0001.png"
resp = requests.post("http://localhost:5000/predict",
files={"file": open(sample_input,'rb')})
print(resp.content)
【问题讨论】:
标签: json flask numpy-ndarray