ocr_config.py 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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_test_config = RequestConfig(
  18. url='http://aihub-test.digitalyili.com/aiSquare/openApi/reasoning-services/rlocrxm/cettest/cet',
  19. token='9679c2b3-b90b-4029-a3c7-f347b4d242f7')
  20. cet_sb_config = RequestConfig(
  21. url='http://aihub.digitalyili.com/aiSquare/openApi/reasoning-services/rlocrxm/cettest/cet',
  22. token='dcae8cc6-0e49-4db8-a2d2-94ef84da3636')
  23. CET_CONFIGS = {
  24. 'local': cet_local_config,
  25. 'test': cet_test_config,
  26. 'sb': cet_sb_config
  27. }
  28. # regbook
  29. regbook_local_config = RequestConfig(url='http://192.168.199.27:18040/ocr_system/regbook', token='')
  30. regbook_test_config = RequestConfig(
  31. url='http://aihub-test.digitalyili.com/aiSquare/openApi/reasoning-services/rlocrxm/hkbsb/regbook',
  32. token='9679c2b3-b90b-4029-a3c7-f347b4d242f7')
  33. regbook_sb_config = RequestConfig(
  34. url='http://aihub.digitalyili.com/aiSquare/openApi/reasoning-services/rlocrxm/hkbsb/regbook',
  35. token='dcae8cc6-0e49-4db8-a2d2-94ef84da3636')
  36. REGBOOK_CONFIGS = {
  37. 'local': regbook_local_config,
  38. 'test': regbook_test_config,
  39. 'sb': regbook_sb_config
  40. }
  41. OCR_CONFIGS = {
  42. 'cet': CET_CONFIGS,
  43. 'regbook': REGBOOK_CONFIGS
  44. }
  45. # business_license
  46. business_license_local_config = RequestConfig(url='http://192.168.199.249:18060/ocr_system/business_license', token='')
  47. business_license_test_config = RequestConfig(
  48. url='http://aihub-test.digitalyili.com/aiSquare/openApi/reasoning-services/rlocrxm/hkbsb/regbook',
  49. token='9679c2b3-b90b-4029-a3c7-f347b4d242f7')
  50. business_license_sb_config = RequestConfig(
  51. url='http://aihub.digitalyili.com/aiSquare/openApi/reasoning-services/rlocrxm/hkbsb/regbook',
  52. token='dcae8cc6-0e49-4db8-a2d2-94ef84da3636')
  53. BUSINESS_CONFIGS = {
  54. 'local': business_license_local_config,
  55. 'test': business_license_test_config,
  56. 'sb': business_license_sb_config
  57. }
  58. OCR_CONFIGS = {
  59. 'cet': CET_CONFIGS,
  60. 'regbook': REGBOOK_CONFIGS,
  61. 'business_license': BUSINESS_CONFIGS
  62. }
  63. # 字段
  64. cet_field = ['orientation', 'name', 'id', 'language', 'level', 'exam_time', 'score']
  65. regbook_field = ['orientation', 'name', 'id', 'gender', 'birthplace', 'birthplace_province', 'birthplace_city',
  66. 'birthplace_region', 'native_place', 'native_place_province', 'native_place_city',
  67. 'native_place_region', 'blood_type', 'religion']
  68. Filed = {
  69. 'cet': cet_field,
  70. 'regbook': regbook_field
  71. }