ocr_config.py 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. '''
  2. Author: zeke-chin zeke-chin@icloud.com
  3. Date: 2022-09-06 19:12:36
  4. LastEditors: zeke-chin zeke-chin@icloud.com
  5. LastEditTime: 2022-09-22 17:23:02
  6. FilePath: /to_md/ocr_config.py
  7. Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  8. '''
  9. from dataclasses import dataclass
  10. from typing import List
  11. @dataclass
  12. class Type:
  13. image_type: int
  14. image_field: List
  15. @dataclass
  16. class RequestConfig:
  17. url: str
  18. token: str
  19. @dataclass
  20. class Configs:
  21. request: RequestConfig
  22. type: Type
  23. # cet
  24. cet_local_config = RequestConfig(url='http://192.168.199.27:18050/ocr_system/cet', token='')
  25. cet_test_config = RequestConfig(
  26. url='http://aihub-test.digitalyili.com/aiSquare/openApi/reasoning-services/rlocrxm/cettest/cet',
  27. token='9679c2b3-b90b-4029-a3c7-f347b4d242f7')
  28. cet_sb_config = RequestConfig(
  29. url='http://aihub.digitalyili.com/aiSquare/openApi/reasoning-services/rlocrxm/cettest/cet',
  30. token='dcae8cc6-0e49-4db8-a2d2-94ef84da3636')
  31. CET_CONFIGS = {
  32. 'local': cet_local_config,
  33. 'test': cet_test_config,
  34. 'sb': cet_sb_config
  35. }
  36. # regbook
  37. regbook_local_config = RequestConfig(url='http://192.168.199.27:18040/ocr_system/regbook', token='')
  38. regbook_test_config = RequestConfig(
  39. url='http://aihub-test.digitalyili.com/aiSquare/openApi/reasoning-services/rlocrxm/hkbsb/regbook',
  40. token='9679c2b3-b90b-4029-a3c7-f347b4d242f7')
  41. regbook_sb_config = RequestConfig(
  42. url='http://aihub.digitalyili.com/aiSquare/openApi/reasoning-services/rlocrxm/hkbsb/regbook',
  43. token='dcae8cc6-0e49-4db8-a2d2-94ef84da3636')
  44. REGBOOK_CONFIGS = {
  45. 'local': regbook_local_config,
  46. 'test': regbook_test_config,
  47. 'sb': regbook_sb_config
  48. }
  49. OCR_CONFIGS = {
  50. 'cet': CET_CONFIGS,
  51. 'regbook': REGBOOK_CONFIGS
  52. }
  53. # business_license
  54. business_license_local_config = RequestConfig(url='http://192.168.199.27:18060/ocr_system/business_license', token='')
  55. business_license_test_config = RequestConfig(
  56. url='http://aihub-test.digitalyili.com/aiSquare/openApi/reasoning-services/rlocrxm/hkbsb/regbook',
  57. token='9679c2b3-b90b-4029-a3c7-f347b4d242f7')
  58. business_license_sb_config = RequestConfig(
  59. url='http://aihub.digitalyili.com/aiSquare/openApi/reasoning-services/rlocrxm/hkbsb/regbook',
  60. token='dcae8cc6-0e49-4db8-a2d2-94ef84da3636')
  61. BUSINESS_CONFIGS = {
  62. 'local': business_license_local_config,
  63. 'test': business_license_test_config,
  64. 'sb': business_license_sb_config
  65. }
  66. OCR_CONFIGS = {
  67. 'cet': CET_CONFIGS,
  68. 'regbook': REGBOOK_CONFIGS,
  69. 'business_license': BUSINESS_CONFIGS
  70. }
  71. # 字段
  72. cet_field = ['orientation', 'name', 'id', 'language', 'level', 'exam_time', 'score']
  73. regbook_field = ['orientation', 'name', 'id', 'gender', 'birthplace', 'birthplace_province', 'birthplace_city',
  74. 'birthplace_region', 'native_place', 'native_place_province', 'native_place_city',
  75. 'native_place_region', 'blood_type', 'religion']
  76. business_license = ['orientation', 'social_code', 'company_name', 'legal_person', 'registered_capital', 'type', 'start_date', 'business_scope', 'expire_date', 'address', 'stamp']
  77. Filed = {
  78. 'cet': cet_field,
  79. 'regbook': regbook_field,
  80. 'business_license': business_license
  81. }