config.yaml 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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_PPStructureV3_Results"
  34. src_img_dir: "/Users/zhch158/workspace/data/至远彩色印刷工业有限公司/data_PPStructureV3_Results/2023年度报告母公司"
  35. supported_image_formats: [".png", ".jpg", ".jpeg"]
  36. # OCR数据配置
  37. ocr:
  38. min_text_length: 2
  39. default_confidence: 1.0
  40. exclude_texts: ["Picture", ""]
  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"