Ikomia HUB

French ID extraction

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_type
  • document_detection_confidence
  • information_extraction_confidence (absent for detection-only results such as VERSO_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 parameter encode_img is True).

Fields in raw_information and computed_information:

  • last_name
  • given_name_1
  • given_name_2
  • given_name_3
  • given_name_4
  • alternate_name: alternate, usage, or spouse name when present
  • birth_date
  • birth_place
  • gender
  • nationality
  • country
  • document_number
  • card_access_number
  • issue_date
  • issue_place
  • expire_date
  • license_categories: driving licence categories
  • obtention_date_b0: obtention date for the B0 driving licence category, when present
  • expire_date_b0: expiry date for the B0 driving licence category, when present
  • mrz1: first MRZ line
  • mrz2: second MRZ line
  • mrz3: 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

  1. First, deploy the workflow.
  2. Install the Python library:
pip install ikomia-client
  1. Integrate the workflow into your Python code:
from ikclient.core.client import Client
with 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.data
for 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

  1. First, deploy the workflow.
  2. Install the JavaScript library:
npm install @ikomia/ikclient
  1. 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.