test.py 1.2 KB

12345678910111213141516171819202122232425262728
  1. from paddleocr import PaddleOCRVL
  2. # ═══════ 测试配置:改这里就行 ═══════
  3. TEST_IMAGE = r"C:\Users\Administrator\PycharmProjects\project\tbsg\screenshots\IZKBKVGITC7X6LQO\step3\step3_b0_crop_debug.png" # 改成你的截图路径
  4. # ═══════════════════════════════════
  5. pipeline = PaddleOCRVL() # 首次运行自动下载 PaddleOCR-VL-1.6 模型
  6. output = pipeline.predict(TEST_IMAGE)
  7. for res in output:
  8. res.print() # 打印识别结果
  9. res.save_to_markdown("output") # 保存为 markdown
  10. # from paddleocr import PaddleOCR
  11. #
  12. # # ═══════ 测试配置 ═══════
  13. # TEST_IMAGE = r"C:\Users\Administrator\PycharmProjects\project\tbsg\screenshots\DEZXWKUC7DJBLVPJ\step3\step3_b0.png"
  14. # # ═══════════════════════
  15. #
  16. # ocr = PaddleOCR(
  17. # use_doc_orientation_classify=False,
  18. # use_doc_unwarping=False,
  19. # use_textline_orientation=False,
  20. # enable_mkldnn=False, # ← 加这一行,绕过 oneDNN 的 bug
  21. # )
  22. # result = ocr.predict(TEST_IMAGE)
  23. # for res in result:
  24. # res.print()
  25. # res.save_to_json("output_ppocr")