Skip to content

Commit

Permalink
✨ add french_healthcard, driver_license, payslip_fra v3
Browse files Browse the repository at this point in the history
  • Loading branch information
ianardee committed Nov 27, 2024
1 parent 415eac7 commit 55f0621
Show file tree
Hide file tree
Showing 28 changed files with 1,833 additions and 423 deletions.
23 changes: 23 additions & 0 deletions docs/code_samples/driver_license_v1_async.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using Mindee;
using Mindee.Input;
using Mindee.Product.DriverLicense;

string apiKey = "my-api-key";
string filePath = "/path/to/the/file.ext";

// Construct a new client
MindeeClient mindeeClient = new MindeeClient(apiKey);

// Load an input source as a path string
// Other input types can be used, as mentioned in the docs
var inputSource = new LocalInputSource(filePath);

// Call the product asynchronously with auto-polling
var response = await mindeeClient
.EnqueueAndParseAsync<DriverLicenseV1>(inputSource);

// Print a summary of all the predictions
System.Console.WriteLine(response.Document.ToString());

// Print only the document-level predictions
// System.Console.WriteLine(response.Document.Inference.Prediction.ToString());
23 changes: 23 additions & 0 deletions docs/code_samples/french_healthcard_v1_async.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using Mindee;
using Mindee.Input;
using Mindee.Product.Fr.HealthCard;

string apiKey = "my-api-key";
string filePath = "/path/to/the/file.ext";

// Construct a new client
MindeeClient mindeeClient = new MindeeClient(apiKey);

// Load an input source as a path string
// Other input types can be used, as mentioned in the docs
var inputSource = new LocalInputSource(filePath);

// Call the product asynchronously with auto-polling
var response = await mindeeClient
.EnqueueAndParseAsync<HealthCardV1>(inputSource);

// Print a summary of all the predictions
System.Console.WriteLine(response.Document.ToString());

// Print only the document-level predictions
// System.Console.WriteLine(response.Document.Inference.Prediction.ToString());
23 changes: 23 additions & 0 deletions docs/code_samples/payslip_fra_v3_async.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using Mindee;
using Mindee.Input;
using Mindee.Product.Fr.Payslip;

string apiKey = "my-api-key";
string filePath = "/path/to/the/file.ext";

// Construct a new client
MindeeClient mindeeClient = new MindeeClient(apiKey);

// Load an input source as a path string
// Other input types can be used, as mentioned in the docs
var inputSource = new LocalInputSource(filePath);

// Call the product asynchronously with auto-polling
var response = await mindeeClient
.EnqueueAndParseAsync<PayslipV3>(inputSource);

// Print a summary of all the predictions
System.Console.WriteLine(response.Document.ToString());

// Print only the document-level predictions
// System.Console.WriteLine(response.Document.Inference.Prediction.ToString());
150 changes: 53 additions & 97 deletions docs/eu_driver_license_v1.md → docs/driver_license_v1.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
---
title: EU Driver License OCR .NET
title: Driver License OCR .NET
category: 622b805aaec68102ea7fcbc2
slug: dotnet-eu-driver-license-ocr
slug: dotnet-driver-license-ocr
parentDoc: 6357abb22e33070016cbda4b
---
The .NET OCR SDK supports the [Driver License API](https://platform.mindee.com/mindee/eu_driver_license).
The .NET OCR SDK supports the [Driver License API](https://platform.mindee.com/mindee/driver_license).

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.
![Driver License sample](https://github.com/mindee/client-lib-test-data/blob/main/products/eu_driver_license/default_sample.jpg?raw=true)
Using the [sample below](https://github.com/mindee/client-lib-test-data/blob/main/products/driver_license/default_sample.jpg), we are going to illustrate how to extract the data that we want using the OCR SDK.
![Driver License sample](https://github.com/mindee/client-lib-test-data/blob/main/products/driver_license/default_sample.jpg?raw=true)

# Quick-Start
```csharp
using Mindee;
using Mindee.Input;
using Mindee.Product.Eu.DriverLicense;
using Mindee.Product.DriverLicense;

string apiKey = "my-api-key";
string filePath = "/path/to/the/file.ext";
Expand All @@ -25,9 +25,9 @@ MindeeClient mindeeClient = new MindeeClient(apiKey);
// Other input types can be used, as mentioned in the docs
var inputSource = new LocalInputSource(filePath);

// Call the API and parse the input
// Call the product asynchronously with auto-polling
var response = await mindeeClient
.ParseAsync<DriverLicenseV1>(inputSource);
.EnqueueAndParseAsync<DriverLicenseV1>(inputSource);

// Print a summary of all the predictions
System.Console.WriteLine(response.Document.ToString());
Expand All @@ -42,48 +42,29 @@ System.Console.WriteLine(response.Document.ToString());
########
Document
########
:Mindee ID: b19cc32e-b3e6-4ff9-bdc7-619199355d54
:Mindee ID: fbdeae38-ada3-43ac-aa58-e01a3d47e474
:Filename: default_sample.jpg
Inference
#########
:Product: mindee/eu_driver_license v1.0
:Product: mindee/driver_license v1.0
:Rotation applied: Yes
Prediction
==========
:Country Code: FR
:Document ID: 13AA00002
:Driver License Category: AM A1 B1 B D BE DE
:Last Name: MARTIN
:First Name: PAUL
:Date Of Birth: 1981-07-14
:Place Of Birth: Utopiacity
:Expiry Date: 2018-12-31
:Issue Date: 2013-01-01
:Issue Authority: 99999UpiaCity
:MRZ: D1FRA13AA000026181231MARTIN<<9
:Address:
Page Predictions
================
Page 0
------
:Photo: Polygon with 4 points.
:Signature: Polygon with 4 points.
:Country Code: FR
:Document ID: 13AA00002
:Driver License Category: AM A1 B1 B D BE DE
:Last Name: MARTIN
:First Name: PAUL
:Date Of Birth: 1981-07-14
:Place Of Birth: Utopiacity
:Expiry Date: 2018-12-31
:Issue Date: 2013-01-01
:Issue Authority: 99999UpiaCity
:MRZ: D1FRA13AA000026181231MARTIN<<9
:Address:
:Country Code: USA
:State: AZ
:ID: D12345678
:Category: D
:Last Name: Sample
:First Name: Jelani
:Date of Birth: 1957-02-01
:Place of Birth:
:Expiry Date: 2018-02-01
:Issued Date: 2013-01-10
:Issuing Authority:
:MRZ:
:DD Number: DD1234567890123456
```

# Field Types
Expand Down Expand Up @@ -114,123 +95,98 @@ The date field `DateField` extends `StringField`, but also implements:

* **DateObject** (`DateTime?`): an accessible representation of the value as a C# object. Can be `null`.


### PositionField
The position field `PositionField` implements:

* **BoundingBox** (`BoundingBox`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document.
* **Polygon** (`Polygon`): contains the relative vertices coordinates (`Polygon` extends `List<Point>`) of a polygon containing the field in the image.
* **Rectangle** (`Polygon`): a Polygon with four points that may be oriented (even beyond canvas).
* **Quadrangle** (`Quadrangle`): a free polygon made up of four points.

## Page-Level Fields
Some fields are constrained to the page level, and so will not be retrievable at document level.

# Attributes
The following fields are extracted for Driver License V1:

## Address
**Address**: EU driver license holders address

```csharp
System.Console.WriteLine(result.Document.Inference.Prediction.Address.Value);
```

## Driver License Category
**Category**: EU driver license holders categories
## Category
**Category**: The category or class of the driver license.

```csharp
System.Console.WriteLine(result.Document.Inference.Prediction.Category.Value);
```

## Country Code
**CountryCode**: Country code extracted as a string.
**CountryCode**: The alpha-3 ISO 3166 code of the country where the driver license was issued.

```csharp
System.Console.WriteLine(result.Document.Inference.Prediction.CountryCode.Value);
```

## Date Of Birth
**DateOfBirth**: The date of birth of the document holder
## Date of Birth
**DateOfBirth**: The date of birth of the driver license holder.

```csharp
System.Console.WriteLine(result.Document.Inference.Prediction.DateOfBirth.Value);
```

## Document ID
**DocumentId**: ID number of the Document.
## DD Number
**DdNumber**: The DD number of the driver license.

```csharp
System.Console.WriteLine(result.Document.Inference.Prediction.DocumentId.Value);
System.Console.WriteLine(result.Document.Inference.Prediction.DdNumber.Value);
```

## Expiry Date
**ExpiryDate**: Date the document expires
**ExpiryDate**: The expiry date of the driver license.

```csharp
System.Console.WriteLine(result.Document.Inference.Prediction.ExpiryDate.Value);
```

## First Name
**FirstName**: First name(s) of the driver license holder
**FirstName**: The first name of the driver license holder.

```csharp
System.Console.WriteLine(result.Document.Inference.Prediction.FirstName.Value);
```

## Issue Authority
**IssueAuthority**: Authority that issued the document
## ID
**Id**: The unique identifier of the driver license.

```csharp
System.Console.WriteLine(result.Document.Inference.Prediction.IssueAuthority.Value);
System.Console.WriteLine(result.Document.Inference.Prediction.Id.Value);
```

## Issue Date
**IssueDate**: Date the document was issued
## Issued Date
**IssuedDate**: The date when the driver license was issued.

```csharp
System.Console.WriteLine(result.Document.Inference.Prediction.IssueDate.Value);
System.Console.WriteLine(result.Document.Inference.Prediction.IssuedDate.Value);
```

## Last Name
**LastName**: Last name of the driver license holder.
## Issuing Authority
**IssuingAuthority**: The authority that issued the driver license.

```csharp
System.Console.WriteLine(result.Document.Inference.Prediction.LastName.Value);
System.Console.WriteLine(result.Document.Inference.Prediction.IssuingAuthority.Value);
```

## MRZ
**Mrz**: Machine-readable license number
## Last Name
**LastName**: The last name of the driver license holder.

```csharp
System.Console.WriteLine(result.Document.Inference.Prediction.Mrz.Value);
System.Console.WriteLine(result.Document.Inference.Prediction.LastName.Value);
```

## Photo
[📄](#page-level-fields "This field is only present on individual pages.")**Photo**: Has a photo of the EU driver license holder
## MRZ
**Mrz**: The Machine Readable Zone (MRZ) of the driver license.

```csharp
foreach (var PhotoElem in result.Document.Inference.Prediction.Photo)
{
System.Console.WriteLine(PhotoElem).Polygon;
}
System.Console.WriteLine(result.Document.Inference.Prediction.Mrz.Value);
```

## Place Of Birth
**PlaceOfBirth**: Place where the driver license holder was born
## Place of Birth
**PlaceOfBirth**: The place of birth of the driver license holder.

```csharp
System.Console.WriteLine(result.Document.Inference.Prediction.PlaceOfBirth.Value);
```

## Signature
[📄](#page-level-fields "This field is only present on individual pages.")**Signature**: Has a signature of the EU driver license holder
## State
**State**: Second part of the ISO 3166-2 code, consisting of two letters indicating the US State.

```csharp
foreach (var SignatureElem in result.Document.Inference.Prediction.Signature)
{
System.Console.WriteLine(SignatureElem).Polygon;
}
System.Console.WriteLine(result.Document.Inference.Prediction.State.Value);
```

# Questions?
Expand Down
Loading

0 comments on commit 55f0621

Please sign in to comment.