import requests url = "http://127.0.0.1:4011/predict/" files = {'file': open('D:\zkwg\image\data\iamge1.jpg', 'rb')} # 替换为您的图像路径 response = requests.post(url, files=files) # 保存返回的预测结果 with open('D:\zkwg\image\data\prediction_result.png', 'wb') as f: f.write(response.content)