_, img_encoded = cv2.imencode('.png', image)
type_img='a'
files = {'img': img_encoded.tobytes()}
res = requests.post(URL, files=files, params={'type':type_img}, timeout=15)
r = request
type_img = r.values.get('type')
file_img = r.files['img']
nparr = np.frombuffer(file_img, np.uint8)
img = cv2.imdecode(nparr, cv2.IMREAD_GRAYSCALE)
a bytes-like object is required, not 'filestorage'