未验证 提交 e0c8b889 编写于 作者: X xiaoting 提交者: GitHub

Merge pull request #1136 from tink2123/android_demo

fix android demo
......@@ -57,7 +57,7 @@ def archives = [
],
[
'src' : 'https://paddleocr.bj.bcebos.com/deploy/lite/ocr_v1_for_cpu.tar.gz',
'dest' : 'src/main/assets/models/ocr_v1_for_cpu'
'dest' : 'src/main/assets/models'
]
]
......
......@@ -53,11 +53,18 @@ public class OCRPredictorNative {
}
public void destory(){
if (nativePointer > 0) {
release(nativePointer);
nativePointer = 0;
}
}
protected native long init(String detModelPath, String recModelPath,String clsModelPath, int threadNum, String cpuMode);
protected native float[] forward(long pointer, float[] buf, float[] ddims, Bitmap originalImage);
public native void release(long pointer);
protected native void release(long pointer);
private ArrayList<OcrResultModel> postprocess(float[] raw) {
ArrayList<OcrResultModel> results = new ArrayList<OcrResultModel>();
......
......@@ -135,7 +135,7 @@ public class Predictor {
public void releaseModel() {
if (paddlePredictor != null) {
paddlePredictor.release();
paddlePredictor.destory();
paddlePredictor = null;
}
isLoaded = false;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册