-
Notifications
You must be signed in to change notification settings - Fork 11.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ALPR_inference中函数部分代码修改 #929
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
def get_best_ocr(preds, rec_conf, ocr_res, track_id):
for info in preds:
# Check if it is current track id
if info['track_id'] == track_id:
# Check if the ocr confidenence is maximum or not
if info['ocr_conf'] < rec_conf:
info['ocr_conf'] = rec_conf
info['ocr_txt'] = ocr_res
else:
rec_conf = info['ocr_conf']
ocr_res = info['ocr_txt']
break
return preds, rec_conf, ocr_res
原函数中的逻辑不正确实际上只修改了第一个元素,不会遍历寻找更高置信度的元素,所以进行以下修改:
def update_best_ocr(preds, rec_conf, ocr_res, track_id):
updated = False # 添加一个标志,表示是否更新了信息
The text was updated successfully, but these errors were encountered: