onnx_modify

This commit is contained in:
we0091234 2022-11-18 11:01:52 +08:00
parent fd8a295488
commit 83e74b50c7
2 changed files with 3 additions and 2 deletions

View File

@ -35,7 +35,7 @@ if __name__=="__main__":
dynamic_axes={'images': {0: 'batch'},
'output': {0: 'batch'}
} if opt.dynamic else None)
print(f"simplify completed,save to {opt.save_path}")
if opt.simplify:
from onnxsim import simplify
print(f"begin simplify ....")

View File

@ -38,8 +38,9 @@ def rec_pre_precessing(img,size=(48,168)): #识别前处理
def get_plate_result(img,session_rec): #识别后处理
img =rec_pre_precessing(img)
y_onnx = session_rec.run([session_rec.get_outputs()[0].name], {session_rec.get_inputs()[0].name: img})[0]
index =np.argmax(y_onnx[0],axis=1)
# print(y_onnx[0])
plate_no = decodePlate(y_onnx[0])
plate_no = decodePlate(index)
return plate_no
def allFilePath(rootPath,allFIleList): #遍历文件