This commit is contained in:
lichen
2022-04-08 19:46:46 +08:00
commit 5ea52d9d38
41 changed files with 9171 additions and 0 deletions

17
Request.py Normal file
View File

@ -0,0 +1,17 @@
import requests
import base64
import os
for image in os.listdir('train'):
if 'bak' in image:
post_data = {'code': image.split('_')[-2]}
# file = {'file':open("train/"+image, 'rb')}
with open("train/"+image, 'rb') as open_file:
img = base64.b64encode(open_file.read()).decode()
image = []
image.append(img)
post_data['file'] = image
resp = requests.post(#url="http://192.168.1.28:5000/predict",
url="http://localhost:8084/predict",
data=post_data,
)#open('36-41/1000026785_45f3_6900068805507_bak.jpg','rb')})
print(resp.json())