We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
for index, (pred, prob, img_name) in enumerate(zip(outputs[:, 1:], probs, file_names)): predict_text = "" # pred_list = [] pred_score_list = [] for i in range(len(pred)): # decode one sample if pred[i] == LabelTransformer.EOS: pred_score_list.append(prob[i]) break if pred[i] == LabelTransformer.UNK: continue decoded_char = LabelTransformer.decode(pred[i]) predict_text += decoded_char # pred_list.append(decoded_char) pred_score_list.append(prob[i]) pred_score = sum(pred_score_list) / len(pred_score_list) pred_item = {"filename": Path(img_name).name, "result": predict_text, "pred_score": pred_score.cpu().item()} pred_results.append(pred_item)
这段代码多行数据直接合成一条后怎么分开呢,标注的时候多行用特殊符号隔开,解码的时候怎么把两行数据分开呢,会预测出特殊符号?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
这段代码多行数据直接合成一条后怎么分开呢,标注的时候多行用特殊符号隔开,解码的时候怎么把两行数据分开呢,会预测出特殊符号?
The text was updated successfully, but these errors were encountered: