diff --git a/header/idsdk.h b/header/idsdk.h new file mode 100644 index 0000000..f5b4ce9 --- /dev/null +++ b/header/idsdk.h @@ -0,0 +1,42 @@ +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif + +enum SDK_ERROR +{ + SDK_SUCCESS = 0, + SDK_LICENSE_KEY_ERROR = -1, + SDK_LICENSE_APPID_ERROR = -2, + SDK_LICENSE_EXPIRED = -3, + SDK_NO_ACTIVATED = -4, + SDK_INIT_ERROR = -5, +}; + + +/* +* Get the machine code for SDK activation +*/ +const char* getMachineCode(); + +/* +* Activate the SDK using the provided license +*/ + +int setActivation(char* license); + +/* +* Initialize the SDK with the specified model path +*/ +int initSDK(); + +/* +* The function accepts only one parameter, which should be the base64-encoded format of the image (e.g., JPG, PNG, etc.). +* If the recognition is successful, the function will return a JSON-formatted string containing the recognized information. In case of failure, the return value will be NULL. +*/ +char* idcardRecognition(char* image_base64); + +#ifdef __cplusplus +} +#endif diff --git a/libidsdk.so b/libidsdk.so index efdc1a1..cb9b4dd 100644 Binary files a/libidsdk.so and b/libidsdk.so differ diff --git a/postman/kby-ai-idcard.postman_collection.json b/postman/kby-ai-idcard.postman_collection.json new file mode 100644 index 0000000..c712a45 --- /dev/null +++ b/postman/kby-ai-idcard.postman_collection.json @@ -0,0 +1,73 @@ +{ + "info": { + "_postman_id": "ae453c9a-d672-4e3d-bf4e-3847473197bc", + "name": "kby-ai-idcard", + "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", + "_exporter_id": "2379931" + }, + "item": [ + { + "name": "idcard_recognition", + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "file", + "type": "file", + "src": [] + } + ] + }, + "url": { + "raw": "http://18.221.33.238:8082/idcard_recognition", + "protocol": "http", + "host": [ + "18", + "221", + "33", + "238" + ], + "port": "8082", + "path": [ + "idcard_recognition" + ] + } + }, + "response": [] + }, + { + "name": "idcard_recognition_base64", + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"base64\":\"xxx\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://127.0.0.1:8082/idcard_recognition_base64", + "protocol": "http", + "host": [ + "127", + "0", + "0", + "1" + ], + "port": "8082", + "path": [ + "idcard_recognition_base64" + ] + } + }, + "response": [] + } + ] +} \ No newline at end of file