config.yaml 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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.65
  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. # 预校验结果文件路径
  31. pre_validation_dir: "./output/pre_validation/"
  32. # OCR数据配置
  33. ocr:
  34. min_text_length: 2
  35. default_confidence: 1.0
  36. exclude_texts: ["Picture", ""]
  37. # 图片方向检测配置
  38. orientation_detection:
  39. enabled: true
  40. confidence_threshold: 0.3 # 置信度阈值
  41. methods: ["opencv_analysis"] # 检测方法
  42. cache_results: true # 缓存检测结果
  43. # OCR工具类型配置
  44. tools:
  45. dots_ocr:
  46. name: "Dots OCR"
  47. description: "专业VLM OCR"
  48. json_structure: "array" # JSON为数组格式
  49. text_field: "text"
  50. bbox_field: "bbox"
  51. category_field: "category"
  52. confidence_field: "confidence"
  53. # 旋转处理配置
  54. rotation:
  55. coordinates_are_pre_rotated: false # 坐标不是预旋转的
  56. ppstructv3:
  57. name: "PPStructV3"
  58. description: "PaddleOCR PP-StructureV3"
  59. json_structure: "object" # JSON为对象格式
  60. parsing_results_field: "parsing_res_list"
  61. text_field: "block_content"
  62. bbox_field: "block_bbox"
  63. category_field: "block_label"
  64. confidence_field: "confidence"
  65. # 旋转处理配置
  66. rotation:
  67. coordinates_are_pre_rotated: true # 坐标已经是预旋转的
  68. # 自动检测工具类型的规则
  69. auto_detection:
  70. enabled: true
  71. rules:
  72. - field_exists: "parsing_res_list" # 如果存在该字段,判断为ppstructv3
  73. tool_type: "ppstructv3"
  74. - json_is_array: true # 如果JSON是数组,判断为dots_ocr
  75. tool_type: "dots_ocr"