import requests import cv2 import numpy as np url = "http://192.168.1.48:5080/" files = { "img": ("myname.png", open("123.png", "rb"), "image/png") } response = requests.request("POST", url, files=files) img = cv2.imdecode(np.frombuffer(response.content, np.uint8), 1) cv2.imshow("result", img) cv2.waitKey(0)