Document database¶
Document templates are files containing information about a specific document type, and needed to detect and read it. Our documents reference file database can evolve on demand, independently from SDK versions.
Important
Document template files¶
Document template files have the .id3dr
extension. For modularity reasons, template files are separated by module and models. It increases the number of files, but you can load only those you need.
You must copy those files into your application package, and specify their location in your application’s source code. If you wish to reduce the size of your application, we recommend copying only the necessary files.
Reference files are named the following way : <document_name>_<model>_X.X.X.V.id3dr
, with :
X.X.X
is the SDK version used to generate them. Document references does not exist for each version, please use the latest ones inferior or equal to your SDK version. Other versions will not be supported. Example : your SDK version is 2.0.3, and the latest document templates inferior might by 2.0.1.V
is an independent document template file version. Please always use the latest for each template.The
<document_name>
is a unique string used to identify this document in the SDK. It is the one you should use inside SDK functions (for example: in DocumentDetector.detectDocumentByName Method).<model>
contains the SDK AI Model which needs this document template. Example:detector_2A
Note
<document_name>
is not corresponding to any document identifier, but is completed by the suffix _front
and _back
. The 2 sides are treated like 2 different documents in the SDK, and their identifier key to use includes the suffix !Loading the document database¶
It is recommended to load the document templates on application startup. The DocumentLibrary Class provides methods for loading and unloading document templates in memory.
An example is given below:
for file_path in os.listdir(document_template_path):
id3document.DocumentLibrary.load_document_template(os.path.join(document_template_path, file_path))