File tree Expand file tree Collapse file tree 6 files changed +20
-20
lines changed
mindee/product/eu/driver_license Expand file tree Collapse file tree 6 files changed +20
-20
lines changed Original file line number Diff line number Diff line change 1
1
---
2
- title : EU EU Driver License OCR Python
2
+ title : EU Driver License OCR Python
3
3
---
4
- The Python OCR SDK supports the [ EU Driver License API] ( https://platform.mindee.com/mindee/eu_driver_license ) .
4
+ The Python OCR SDK supports the [ Driver License API] ( https://platform.mindee.com/mindee/eu_driver_license ) .
5
5
6
6
Using the [ sample below] ( https://github.com/mindee/client-lib-test-data/blob/main/products/eu_driver_license/default_sample.jpg ) , we are going to illustrate how to extract the data that we want using the OCR SDK.
7
- ![ EU Driver License sample] ( https://github.com/mindee/client-lib-test-data/blob/main/products/eu_driver_license/default_sample.jpg?raw=true )
7
+ ![ Driver License sample] ( https://github.com/mindee/client-lib-test-data/blob/main/products/eu_driver_license/default_sample.jpg?raw=true )
8
8
9
9
# Quick-Start
10
10
``` py
@@ -115,7 +115,7 @@ The text field `StringField` only has one constraint: its **value** is an `Optio
115
115
Some fields are constrained to the page level, and so will not be retrievable to through the document.
116
116
117
117
# Attributes
118
- The following fields are extracted for EU Driver License V1:
118
+ The following fields are extracted for Driver License V1:
119
119
120
120
## Address
121
121
** address** ([ StringField] ( #stringfield ) ): EU driver license holders address
Original file line number Diff line number Diff line change @@ -8,23 +8,23 @@ Using the [sample below](https://github.com/mindee/client-lib-test-data/blob/mai
8
8
9
9
# Quick-Start
10
10
``` py
11
- from mindee import Client, PredictResponse, product
11
+ from mindee import Client, product, AsyncPredictResponse
12
+ from time import sleep
12
13
13
14
# Init a new client
14
15
mindee_client = Client(api_key = " my-api-key" )
15
16
16
17
# Load a file from disk
17
18
input_doc = mindee_client.source_from_path(" /path/to/the/file.ext" )
18
19
19
- # Load a file from disk and parse it.
20
- # The endpoint name must be specified since it cannot be determined from the class.
21
- result: PredictResponse = mindee_client.parse(product.InternationalIdV2, input_doc)
20
+ # Load a file from disk and enqueue it.
21
+ result: AsyncPredictResponse = mindee_client.enqueue_and_parse(
22
+ product.InternationalIdV2,
23
+ input_doc,
24
+ )
22
25
23
- # Print a summary of the API result
26
+ # Print a brief summary of the parsed data
24
27
print (result.document)
25
-
26
- # Print the document-level summary
27
- # print(result.document.inference.prediction)
28
28
```
29
29
30
30
** Output (RST):**
Original file line number Diff line number Diff line change 1
- EU Driver License V1
2
- --------------------
1
+ Driver License V1
2
+ -----------------
3
3
4
4
**Sample Code: **
5
5
Original file line number Diff line number Diff line change 8
8
9
9
10
10
class DriverLicenseV1 (Inference ):
11
- """Inference prediction for EU Driver License, API version 1."""
11
+ """Inference prediction for Driver License, API version 1."""
12
12
13
13
prediction : DriverLicenseV1Document
14
14
"""Document-level prediction."""
@@ -21,7 +21,7 @@ class DriverLicenseV1(Inference):
21
21
22
22
def __init__ (self , raw_prediction : StringDict ):
23
23
"""
24
- EU Driver License v1 inference.
24
+ Driver License v1 inference.
25
25
26
26
:param raw_prediction: Raw prediction from the HTTP response.
27
27
"""
Original file line number Diff line number Diff line change 5
5
6
6
7
7
class DriverLicenseV1Document (Prediction ):
8
- """Document data for EU Driver License, API version 1."""
8
+ """Document data for Driver License, API version 1."""
9
9
10
10
address : StringField
11
11
"""EU driver license holders address"""
@@ -38,7 +38,7 @@ def __init__(
38
38
page_id : Optional [int ] = None ,
39
39
):
40
40
"""
41
- EU Driver License document.
41
+ Driver License document.
42
42
43
43
:param raw_prediction: Raw prediction from HTTP response
44
44
:param page_id: Page number for multi pages pdf input
Original file line number Diff line number Diff line change 8
8
9
9
10
10
class DriverLicenseV1Page (DriverLicenseV1Document ):
11
- """Page data for EU Driver License, API version 1."""
11
+ """Page data for Driver License, API version 1."""
12
12
13
13
photo : PositionField
14
14
"""Has a photo of the EU driver license holder"""
@@ -21,7 +21,7 @@ def __init__(
21
21
page_id : Optional [int ] = None ,
22
22
):
23
23
"""
24
- EU Driver License page.
24
+ Driver License page.
25
25
26
26
:param raw_prediction: Raw prediction from HTTP response
27
27
:param page_id: Page number for multi pages pdf input
You can’t perform that action at this time.
0 commit comments