主题
解密OCR加密包为NCNN模型 - OcrDecryptModel
函数简介
将欧拉 OCR 加密包还原为四文件 NCNN 模型及可选字典。
接口名称
OcrDecryptModelDLL 调用
int OcrDecryptModel(long ola, string packagePath, string password, string detParamOutPath, string detBinOutPath, string recParamOutPath, string recBinOutPath, string dictOutPath);参数说明
| 参数名 | 类型 | 说明 |
|---|---|---|
| ola | 长整数型 | OLAPlug 对象指针。 |
| packagePath | 字符串 | 加密包路径。 |
| password | 字符串 | 解密密码。 |
| detParamOutPath | 字符串 | 检测 .param 输出路径。 |
| detBinOutPath | 字符串 | 检测 .bin 输出路径。 |
| recParamOutPath | 字符串 | 识别 .param 输出路径。 |
| recBinOutPath | 字符串 | 识别 .bin 输出路径。 |
| dictOutPath | 字符串 | 字典 .txt 输出路径;空 则跳过写出(即使包内含字典)。 |
示例
SDK 调用
cpp
#include "OLAPlugServer.h"
OLAPlugServer ola;
int ret = ola.OcrDecryptModel("C:\\test.txt", "value", "C:\\test.txt", "C:\\test.txt", "C:\\test.txt", "C:\\test.txt", "C:\\test.txt");csharp
using OLAPlug;
var ola = new OLAPlugServer();
int ret = ola.OcrDecryptModel("C:\\test.txt", "value", "C:\\test.txt", "C:\\test.txt", "C:\\test.txt", "C:\\test.txt", "C:\\test.txt");python
from OLAPlugServer import OLAPlugServer
ola = OLAPlugServer()
ret = ola.OcrDecryptModel("C:\\test.txt", "value", "C:\\test.txt", "C:\\test.txt", "C:\\test.txt", "C:\\test.txt", "C:\\test.txt")java
import com.olaplug.OLAPlugServer;
OLAPlugServer ola = new OLAPlugServer();
int ret = ola.OcrDecryptModel("C:\\test.txt", "value", "C:\\test.txt", "C:\\test.txt", "C:\\test.txt", "C:\\test.txt", "C:\\test.txt");go
import "github.com/ola/olaplug/olaplug"
ola, _ := olaplug.NewOLAPlugServer("OLAPlug_x64.dll")
defer ola.ReleaseObj()
ret := ola.OcrDecryptModel("C:\\test.txt", "value", "C:\\test.txt", "C:\\test.txt", "C:\\test.txt", "C:\\test.txt", "C:\\test.txt")rust
use olaplug::OLAPlugServer;
let ola = OLAPlugServer::new("OLAPlug_x64.dll").unwrap();
let ret = ola.ocr_decrypt_model("C:\\test.txt", "value", "C:\\test.txt", "C:\\test.txt", "C:\\test.txt", "C:\\test.txt", "C:\\test.txt");cpp
var ola = com("OlaPlug.OlaSoft")
var ret = ola.OcrDecryptModel("C:\\test.txt", "value", "C:\\test.txt", "C:\\test.txt", "C:\\test.txt", "C:\\test.txt", "C:\\test.txt")vbscript
Set ola = CreateObject("OlaPlug.OlaSoft")
ret = ola.OcrDecryptModel("C:\\test.txt", "value", "C:\\test.txt", "C:\\test.txt", "C:\\test.txt", "C:\\test.txt", "C:\\test.txt")text
.局部变量 ola, OLAPlug
ola.创建 ()
ret = ola.OcrDecryptModel(“C:\\test.txt”, “value”, “C:\\test.txt”, “C:\\test.txt”, “C:\\test.txt”, “C:\\test.txt”, “C:\\test.txt”)aardio
import OLAPlugServer;
var ola = OLAPlugServer();
var ret = ola.OcrDecryptModel("C:\\test.txt", "value", "C:\\test.txt", "C:\\test.txt", "C:\\test.txt", "C:\\test.txt", "C:\\test.txt");text
变量 ola <类型 = OLAPlugServer>
ola = 新建 OLAPlugServer
整数 ret = ola.OcrDecryptModel("C:\\test.txt", "value", "C:\\test.txt", "C:\\test.txt", "C:\\test.txt", "C:\\test.txt", "C:\\test.txt")cpp
#include "OLAPlugServer.h"
OLAPlugServer ola;
int32_t ret = ola.OcrDecryptModel("C:\\test.txt", "value", "C:\\test.txt", "C:\\test.txt", "C:\\test.txt", "C:\\test.txt", "C:\\test.txt");原生 DLL 调用
cpp
long instance = CreateCOLAPlugInterFace();
OcrDecryptModel(instance, "C:\\test.txt", "value", "C:\\test.txt", "C:\\test.txt", "C:\\test.txt", "C:\\test.txt", "C:\\test.txt");csharp
using System.Runtime.InteropServices;
using System.Text;
[DllImport("OLAPlug_x64.dll", CallingConvention = CallingConvention.StdCall)]
static extern long CreateCOLAPlugInterFace();
[DllImport("OLAPlug_x64.dll", CallingConvention = CallingConvention.StdCall)]
static extern int OcrDecryptModel(long ola, string packagePath, string password, string detParamOutPath, string detBinOutPath, string recParamOutPath, string recBinOutPath, string dictOutPath);
long instance = CreateCOLAPlugInterFace();
OcrDecryptModel(instance, "C:\\test.txt", "value", "C:\\test.txt", "C:\\test.txt", "C:\\test.txt", "C:\\test.txt", "C:\\test.txt");python
from ctypes import CDLL, c_int, c_int64, create_string_buffer
ola = CDLL("OLAPlug_x64.dll")
ola.CreateCOLAPlugInterFace.restype = c_int64
instance = ola.CreateCOLAPlugInterFace()
ola.OcrDecryptModel(instance, "C:\\test.txt", "value", "C:\\test.txt", "C:\\test.txt", "C:\\test.txt", "C:\\test.txt", "C:\\test.txt")返回值
| 返回值 | 说明 |
|---|---|
| (返回值) | 整数型:1 成功,0 失败。 |
注意事项
| 项目 | 说明 |
|---|---|
| YOLO 加密包 | 若为 YOLO 加密包,应使用 YoloDecryptModel。 |
