French ID extraction

About
This workflow parses images of French identity documents and returns structured identity fields.
Capabilities
- Extracts informations from supported French identity documents : passports, national identity cards, driving licences, and residence permits.
- Supports images containing more than one document and returns one result object per detected document.
- Automatically handle document detection and corrects orientation.
Supported documents
- French passport:
PASSEPORT. - French national identity card, old format:
RECTO_CNI_OLD,VERSO_CNI_OLD. - French national identity card, new format:
RECTO_CNI_NEW,VERSO_CNI_NEW. - French driving licence, old format (folio):
RECTO_PERMIS_OLD,VERSO_PERMIS_OLD. - French driving licence, new format (card):
RECTO_PERMIS_NEW,VERSO_PERMIS_NEW. - French residence permit:
RECTO_TS,VERSO_TS.
Output fields
The output is a list of detected documents. Each item can contain:
document_typedocument_detection_confidenceinformation_extraction_confidence(absent for detection-only results such asVERSO_CNI_OLD)raw_information: fields predicted by the extraction model before post-processing.computed_information: post-processed fields with various cleaning and normalization.image: base64-encoded cropped document image (when parameterencode_imgisTrue).
Fields in raw_information and computed_information:
last_namegiven_name_1given_name_2given_name_3given_name_4alternate_name: alternate, usage, or spouse name when presentbirth_datebirth_placegendernationalitycountrydocument_numbercard_access_numberissue_dateissue_placeexpire_datelicense_categories: driving licence categoriesobtention_date_b0: obtention date for theB0driving licence category, when presentexpire_date_b0: expiry date for theB0driving licence category, when presentmrz1: first MRZ linemrz2: second MRZ linemrz3: third MRZ line
Not every field is expected for every supported document. Fields that are not present on a given document may be returned as empty strings.
Known limitations
- Only French identity documents are supported
- Old French identity card backs (
VERSO_CNI_OLD) are detected but no extractions are performed on them. - Extraction quality depends on image resolution, sharpness, lighting, glare, document visibility
Usage
Python
- First, deploy the workflow.
- Install the Python library:
pip install ikomia-client
- Integrate the workflow into your Python code:
from ikclient.core.client import Clientwith Client(url="https://your.scale.endpoint.url",token="your-api-token", # Defaults to os.environ.get("IKOMIA_TOKEN")) as document_extractor:results = document_extractor.run("path/to/your/document.jpg",parameters={"encode_img": False,},)output = results.get_output()extracted_documents = output.datafor document in extracted_documents:print("Document type:", document.get("document_type"))print("Detection confidence:", document.get("document_detection_confidence"))print("Extraction confidence:", document.get("information_extraction_confidence"))print("Computed information:", document.get("computed_information"))
For more details, refer to the documentation.
JavaScript
- First, deploy the workflow.
- Install the JavaScript library:
npm install @ikomia/ikclient
- Integrate the workflow into your JavaScript code:
import { Client, ImageIO } from "@ikomia/ikclient";import fs from "fs/promises";const client = new Client({url: "https://your.scale.endpoint.url",token: "your-api-token", // Defaults to process.env.IKOMIA_TOKEN});const imageBuffer = await fs.readFile("path/to/your/document.jpg");const imageInput = await ImageIO.create(imageBuffer);const results = await client.run({inputs: [imageInput],parameters: {encode_img: false,},});const output = results.getOutput();const extractedDocuments = output.data;for (const document of extractedDocuments) {console.log("Document type:", document.document_type);console.log("Detection confidence:", document.document_detection_confidence);console.log("Extraction confidence:", document.information_extraction_confidence);console.log("Computed information:", document.computed_information);}
For more details, refer to the documentation.
REST API
Refer to the documentation for integration using the REST API.