fasdfsa commited on
Commit
2ca757b
·
1 Parent(s): 1dcc835
main.py CHANGED
@@ -285,7 +285,7 @@ def ocr_one_pdf(pth_pdf):
285
  # cv2.waitKey(0)
286
 
287
 
288
- pp_state_text += f'{label_left}\t{jsonstring(label_right)}\n'
289
 
290
  cv2.imwrite('./tmp.jpg', cv2.cvtColor(img_color, cv2.COLOR_RGB2BGR))
291
 
@@ -294,11 +294,11 @@ def ocr_one_pdf(pth_pdf):
294
 
295
 
296
 
297
- if not os.path.exists(pth_pp_state):
298
  # if exist, maybe ppocrlabel edited already. DO NOT rewrite it!!!
299
- if pp_state_text:
300
- with open(pth_pp_state, 'w', encoding='utf-8') as f:
301
- f.write(pp_state_text)
302
 
303
 
304
  if __name__ == '__main__':
 
285
  # cv2.waitKey(0)
286
 
287
 
288
+ pp_label_text += f'{label_left}\t{jsonstring(label_right)}\n'
289
 
290
  cv2.imwrite('./tmp.jpg', cv2.cvtColor(img_color, cv2.COLOR_RGB2BGR))
291
 
 
294
 
295
 
296
 
297
+ if not os.path.exists(pth_pp_label):
298
  # if exist, maybe ppocrlabel edited already. DO NOT rewrite it!!!
299
+ if pp_label_text:
300
+ with open(pth_pp_label, 'w', encoding='utf-8') as f:
301
+ f.write(pp_label_text)
302
 
303
 
304
  if __name__ == '__main__':
pdfs/jp/高木直子学日语文法不要想太多/{fileState.txt → Label.txt} RENAMED
File without changes