RPA.DocumentAI.Base64AI
Gets through all the recognized signatures in the queried image and returns only the ones passing the confidence & similarity thresholds.
Arguments
Argument | Type | Default value |
---|---|---|
match_response | Dict[Hashable, str | int | float | bool | list | dict | None], List[str | int | float | bool | list | dict | None], str, int, float, bool, list, dict, None | null |
confidence_threshold | float | 0.8 |
similarity_threshold | float | 0.8 |
Additionally, this keyword simplifies the original input match_response structure and returns a dictionary with all the detected and accepted reference signatures as keys, and lists of similar enough query signatures as values.
- Each reference signature (key) is a tuple of (index, coordinates).
- Each query signature (sub-value) is a dictionary of {index, coords, similarity}.
- The coordinates describe the bounding-box enclosing the detected signature portion from the original image, as follows: (left, top, right, bottom) corners.
Use the original match_response object and the indexes from here if you need to retrieve extra details not found here (e.g. confidence score). Use the Get Signature Image to save and preview the image crop belonging to the signature of choice.
param match_response: | The raw JSON-like response retrieved with the Get Matching Signatures keyword. |
---|---|
param confidence_threshold: | The minimum accepted confidence score (0.0-1.0) for a candidate to be considered a signature. (to avoid false-positives) |
param similarity_threshold: | The minimum accepted similarity score (0.0-1.0) for a query signature to be considered an alike signature. (to discard different or fraudulent signatures) |
returns: | A dictionary of accepted reference signatures and their similar ones found in the queried image. |
Example: Robot Framework
Example: Python
Helper keyword to get found fields from a prediction result. For example see Scan Document File or Scan Document URL keyword.
Arguments
Argument | Type | Default value |
---|---|---|
prediction | Dict[Hashable, str | int | float | bool | list | dict | None], List[str | int | float | bool | list | dict | None], str, int, float, bool, list, dict, None | null |
param prediction: | prediction result dictionary |
---|---|
return: | list of found fields |
Returns a list of matching signatures found from the reference into the queried image.
Arguments
Argument | Type | Default value |
---|---|---|
reference_image | Path, str | null |
query_image | Path, str | null |
The input images can be paths to the files or URLs.
The output JSON-like dictionary contains all the details from the API, like the detected signatures in both the reference and query image and for every such signature, its bounding-box geometry, confidence and similarity score. Use the Filter Matching Signatures over this value to get a simpler structure.
param reference_image: | The reference image (jpg/png) to check query signatures against. (e.g. driving license, ID card) |
---|---|
param query_image: | The query image containing signatures similar to the ones from the reference image. (e.g. signed contract, bank check) |
returns: | A JSON-like dictionary revealing recognized signatures and how much they resemble with each other. |
Example: Robot Framework
Example: Python
Portal example: https://github.com/robocorp/example-signature-match-assistant
Retrieves and saves locally the image cut belonging to the provided index.
Arguments
Argument | Type | Default value |
---|---|---|
match_response | Dict[Hashable, str | int | float | bool | list | dict | None], List[str | int | float | bool | list | dict | None], str, int, float, bool, list, dict, None | null |
null | ||
index | int | null |
reference | bool | False |
path | Path, str, None | None |
The image data itself is provided with the original match_response object as base64 encoded content. This utility keyword retrieves, decodes and saves it on the local disk customized with the path parameter. By default, the searched index is considered a query image, switch to the reference type by enabling it with the reference parameter.
param match_response: | The raw JSON-like response retrieved with the Get Matching Signatures keyword. |
---|---|
param index: | The image ID (numeric) found along the coordinates in the output of the Filter Matching Signatures keyword. (the list order is stable) |
param reference: | Set this to True if you're looking for a reference (not query) image instead. (off by default) |
param path: | Set an explicit output path (including file name) for the locally saved image. (uses the output directory as default) |
returns: | The image path of the locally saved file. |
Example: Robot Framework
Example: Python
Get user data including details on credits used and credits remaining for the Base64 service.
Returned user data contains following keys:
- givenName
- familyName
- hasWorkEmail
- companyName
- numberOfCredits
- numberOfPages
- numberOfUploads
- numberOfCreditsSpentOnDocuments (visible if used)
- numberOfCreditsSpentOnFaceDetection (visible if used)
- numberOfCreditsSpentOnFaceRecognition (visible if used)
- hasActiveAwsContract
- subscriptionType
- subscriptionPeriod
- tags
- ccEmails
- status
- remainingCredits (calculated by the keyword)
return: | object containing details on the API user |
---|
Robot Framework example:
Python example:
Scan a document file. Can be given a model_types to specifically target certain models.
Arguments
Argument | Type | Default value |
---|---|---|
file_path | str | null |
model_types | List[str], str, None | None |
mock | bool | False |
param file_path: | filepath to the file |
---|---|
param model_types: | single model type or list of model types |
param mock: | set to True to use /mock/scan endpoint instead of /scan |
return: | result of the document scan |
Robot Framework example:
Python example:
Scan a document URL. Can be given a model_types to specifically target certain models.
Arguments
Argument | Type | Default value |
---|---|---|
url | str | null |
model_types | List[str], str, None | None |
mock | bool | False |
param url: | valid url to a file |
---|---|
param model_types: | single model type or list of model types |
param mock: | set to True to use /mock/scan endpoint instead of /scan |
return: | result of the document scan |
Robot Framework example:
Python example:
Set Base64 AI request headers with email and key related to API.
Arguments
Argument | Type | Default value |
---|---|---|
api_email | str | null |
api_key | str | null |
param api_email: | email address related to the API |
---|---|
param api_key: | key related to the API |
Robot Framework example:
Python example: