ocr_config.py 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. from dataclasses import dataclass
  2. from typing import List
  3. @dataclass
  4. class Type:
  5. image_type: int
  6. image_field: List
  7. @dataclass
  8. class RequestConfig:
  9. url: str
  10. token: str
  11. @dataclass
  12. class Configs:
  13. request: RequestConfig
  14. type: Type
  15. # cet
  16. cet_local_config = RequestConfig(url='http://192.168.199.27:18050/ocr_system/cet', token='')
  17. cet_TXtest_config = RequestConfig(
  18. url='http://aihubtest.digitalyili.com/aiSquare/openApi/reasoning-services/rlocrxm//cettest/cet',
  19. token='8ae1e5f1-1337-4f22-8d46-ff4c110d68fd')
  20. cet_TXsb_config = RequestConfig(
  21. url='http://aihub.digitalyili.com/aiSquare/openApi/reasoning-services/rlocrxm/cet/cet',
  22. token='dcae8cc6-0e49-4db8-a2d2-94ef84da3636')
  23. cet_DXtest_config = RequestConfig(
  24. url='http://aihubpre-idc.digitalyili.com/aiSquare/openApi/reasoning-services/hrocr/cettest/cet',
  25. token='4e00c444-620b-4d3c-85f4-777e64276f0e')
  26. cet_DXsb_config = RequestConfig(
  27. url='http://aihub-idc.digitalyili.com/aiSquare/openApi/reasoning-services/hrocr/cet/cet',
  28. token='e045de0a-e97f-4f23-b4d5-6a032c39a81e')
  29. CET_CONFIGS = {
  30. 'local': cet_local_config,
  31. 'TXtest': cet_TXtest_config,
  32. 'TXsb': cet_TXsb_config,
  33. 'DXtest': cet_DXtest_config,
  34. 'DXsb': cet_DXsb_config
  35. }
  36. # regbook
  37. regbook_local_config = RequestConfig(url='http://192.168.199.27:18040/ocr_system/regbook', token='')
  38. regbook_TXtest_config = RequestConfig(
  39. url='http://aihubtest.digitalyili.com/aiSquare/openApi/reasoning-services/rlocrxm//hkbsbtest/regbook',
  40. token='8ae1e5f1-1337-4f22-8d46-ff4c110d68fd')
  41. regbook_TXsb_config = RequestConfig(
  42. url='http://aihub.digitalyili.com/aiSquare/openApi/reasoning-services/rlocrxm/hkbsb/regbook',
  43. token='dcae8cc6-0e49-4db8-a2d2-94ef84da3636')
  44. regbook_DXtest_config = RequestConfig(
  45. url='http://aihubpre-idc.digitalyili.com/aiSquare/openApi/reasoning-services/hrocr/hkbsbtest/regbook',
  46. token='4e00c444-620b-4d3c-85f4-777e64276f0e')
  47. regbook_DXsb_config = RequestConfig(
  48. url='http://aihub-idc.digitalyili.com/aiSquare/openApi/reasoning-services/hrocr/hkbsb/regbook',
  49. token='e045de0a-e97f-4f23-b4d5-6a032c39a81e')
  50. REGBOOK_CONFIGS = {
  51. 'local': regbook_local_config,
  52. 'TXtest': regbook_TXtest_config,
  53. 'TXsb': regbook_TXsb_config,
  54. 'DXtest': regbook_DXtest_config,
  55. 'DXsb': regbook_DXsb_config
  56. }
  57. # business_license
  58. blfe_local_config = RequestConfig(url='http://192.168.199.27:18060/ocr_system/business_license', token='')
  59. blfe_TXtest_config = RequestConfig(
  60. url='http://aihubtest.digitalyili.com/aiSquare/openApi/reasoning-services/rlocrxm/blfetest/blfe',
  61. token='8ae1e5f1-1337-4f22-8d46-ff4c110d68fd')
  62. blfe_TXsb_config = RequestConfig(
  63. url='http://aihub.digitalyili.com/aiSquare/openApi/reasoning-services/rlocrxm/blfe/blfe',
  64. token='dcae8cc6-0e49-4db8-a2d2-94ef84da3636')
  65. blfe_DXtest_config = RequestConfig(
  66. url='http://aihubpre-idc.digitalyili.com/aiSquare/openApi/reasoning-services/hrocr/blfetest/blfe',
  67. token='4e00c444-620b-4d3c-85f4-777e64276f0e')
  68. blfe_DXsb_config = RequestConfig(
  69. url='http://aihub-idc.digitalyili.com/aiSquare/openApi/reasoning-services/hrocr/blfe/blfe',
  70. token='e045de0a-e97f-4f23-b4d5-6a032c39a81e')
  71. BLFE_CONFIGS = {
  72. 'local': blfe_local_config,
  73. 'TXtest': blfe_TXtest_config,
  74. 'TXsb': blfe_TXsb_config,
  75. 'DXtest': blfe_DXtest_config,
  76. 'DXsb': blfe_DXsb_config
  77. }
  78. OCR_CONFIGS = {
  79. 'cet': CET_CONFIGS,
  80. 'regbook': REGBOOK_CONFIGS,
  81. 'business_license': BLFE_CONFIGS
  82. }
  83. # 字段
  84. cet_field = ['orientation', 'name', 'id', 'language', 'level', 'exam_time', 'score']
  85. regbook_field = ['orientation', 'name', 'id', 'gender', 'birthplace', 'birthplace_province', 'birthplace_city',
  86. 'birthplace_region', 'native_place', 'native_place_province', 'native_place_city',
  87. 'native_place_region', 'blood_type', 'religion']
  88. business_license = ['orientation', 'social_code', 'company_name', 'legal_person', 'registered_capital', 'type',
  89. 'start_date', 'business_scope', 'expire_date', 'address', 'stamp']
  90. Filed = {
  91. 'cet': cet_field,
  92. 'regbook': regbook_field,
  93. 'business_license': business_license
  94. }