config.yaml 2.5 KB

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