|
11 | 11 | print("Found local license file. Using it for performing request...")
|
12 | 12 | regula_license = f.read()
|
13 | 13 |
|
14 |
| -with open("australia_passport.jpg", "rb") as f: |
15 |
| - input_image = f.read() |
| 14 | +with open("WHITE.jpg", "rb") as f: |
| 15 | + white_page_0 = f.read() |
| 16 | + |
| 17 | +with open("IR.jpg", "rb") as f: |
| 18 | + ir_page_0 = f.read() |
| 19 | + |
| 20 | +with open("UV.jpg", "rb") as f: |
| 21 | + uv_page_0 = f.read() |
16 | 22 |
|
17 | 23 | with DocumentReaderApi(host) as api:
|
18 | 24 | api.license = regula_license
|
19 | 25 |
|
20 | 26 | params = ProcessParams(
|
21 |
| - scenario=Scenario.FULL_PROCESS, |
22 |
| - result_type_output=[Result.STATUS, Result.TEXT, Result.IMAGES] |
| 27 | + scenario=Scenario.FULL_AUTH, |
| 28 | + result_type_output=[ |
| 29 | + # actual results |
| 30 | + Result.STATUS, Result.AUTHENTICITY, Result.TEXT, Result.IMAGES, |
| 31 | + Result.DOCUMENT_TYPE, Result.DOCUMENT_TYPE_CANDIDATES, |
| 32 | + # legacy results |
| 33 | + Result.MRZ_TEXT, Result.VISUAL_TEXT, Result.BARCODE_TEXT, Result.RFID_TEXT, |
| 34 | + Result.VISUAL_GRAPHICS, Result.BARCODE_GRAPHICS, Result.RFID_GRAPHICS, |
| 35 | + Result.LEXICAL_ANALYSIS |
| 36 | + ] |
23 | 37 | )
|
24 |
| - request = RecognitionRequest(process_params=params, images=[input_image]) |
| 38 | + request = RecognitionRequest(process_params=params, images=[ |
| 39 | + RecognitionImage(image=white_page_0, light_index=Light.WHITE, page_index=0), |
| 40 | + RecognitionImage(image=ir_page_0, light_index=Light.IR, page_index=0), |
| 41 | + RecognitionImage(image=uv_page_0, light_index=Light.UV, page_index=0), |
| 42 | + ]) |
25 | 43 | response = api.process(request)
|
26 | 44 |
|
27 | 45 | # status examples
|
|
0 commit comments