config.yaml 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. # OCR验证工具配置文件
  2. # 样式配置
  3. styles:
  4. font_size: 8
  5. colors:
  6. primary: "#0288d1"
  7. secondary: "#ff9800"
  8. success: "#4caf50"
  9. error: "#f44336"
  10. warning: "#ff9800"
  11. background: "#fafafa"
  12. text: "#333333"
  13. layout:
  14. default_zoom: 1.0
  15. default_height: 800
  16. sidebar_width: 1
  17. content_width: 0.7
  18. # 界面配置
  19. ui:
  20. page_title: "OCR可视化校验工具"
  21. page_icon: "🔍"
  22. layout: "wide"
  23. sidebar_state: "expanded"
  24. # 文件路径配置
  25. paths:
  26. ocr_out_dir: "/Users/zhch158/workspace/data/至远彩色印刷工业有限公司/data_DotsOCR_Results"
  27. # ocr_out_dir: "/Users/zhch158/workspace/data/至远彩色印刷工业有限公司/data_PPStructureV3_Results"
  28. src_img_dir: "/Users/zhch158/workspace/data/至远彩色印刷工业有限公司/data_PPStructureV3_Results/2023年度报告母公司"
  29. supported_image_formats: [".png", ".jpg", ".jpeg"]
  30. # OCR数据配置
  31. ocr:
  32. min_text_length: 2
  33. default_confidence: 1.0
  34. exclude_texts: ["Picture", ""]
  35. # 图片方向检测配置
  36. orientation_detection:
  37. enabled: true
  38. confidence_threshold: 0.3 # 置信度阈值
  39. methods: ["opencv_analysis"] # 检测方法
  40. cache_results: true # 缓存检测结果
  41. # OCR工具类型配置
  42. tools:
  43. dots_ocr:
  44. name: "Dots OCR"
  45. description: "专业VLM OCR"
  46. json_structure: "array" # JSON为数组格式
  47. text_field: "text"
  48. bbox_field: "bbox"
  49. category_field: "category"
  50. confidence_field: "confidence"
  51. # 旋转处理配置
  52. rotation:
  53. coordinates_are_pre_rotated: false # 坐标不是预旋转的
  54. ppstructv3:
  55. name: "PPStructV3"
  56. description: "PaddleOCR PP-StructureV3"
  57. json_structure: "object" # JSON为对象格式
  58. parsing_results_field: "parsing_res_list"
  59. text_field: "block_content"
  60. bbox_field: "block_bbox"
  61. category_field: "block_label"
  62. confidence_field: "confidence"
  63. # 旋转处理配置
  64. rotation:
  65. coordinates_are_pre_rotated: true # 坐标已经是预旋转的
  66. # 自动检测工具类型的规则
  67. auto_detection:
  68. enabled: true
  69. rules:
  70. - field_exists: "parsing_res_list" # 如果存在该字段,判断为ppstructv3
  71. tool_type: "ppstructv3"
  72. - json_is_array: true # 如果JSON是数组,判断为dots_ocr
  73. tool_type: "dots_ocr"