将识别结果通过PyqtSignal分批emit,修改为拼接识别结果后统一emit

This commit is contained in:
cdb 2020-12-15 18:26:13 +08:00
parent 050a29a9fc
commit b559bf3ffd
1 changed files with 4 additions and 1 deletions

View File

@ -41,11 +41,14 @@ class Worker(QThread):
print('Can not recognise file is : ', Imgpath) print('Can not recognise file is : ', Imgpath)
pass pass
else: else:
strs = ''
for res in self.result_dic: for res in self.result_dic:
chars = res[1][0] chars = res[1][0]
cond = res[1][1] cond = res[1][1]
posi = res[0] posi = res[0]
self.listValue.emit("Transcription: " + chars + " Probability: " + str(cond) + " Location: " + json.dumps(posi)) strs += "Transcription: " + chars + " Probability: " + str(cond) + " Location: " + json.dumps(posi)
# Sending large amounts of data repeatedly through pyqtSignal may affect the program efficiency
self.listValue.emit(strs) # It is better to remove this line
self.mainThread.result_dic = self.result_dic self.mainThread.result_dic = self.result_dic
self.mainThread.filePath = Imgpath self.mainThread.filePath = Imgpath
# 保存 # 保存