Skip to content

Commit

Permalink
修复OCR BUG
Browse files Browse the repository at this point in the history
  • Loading branch information
wilinz committed Aug 15, 2022
1 parent cfb5903 commit 58f763f
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public void initOcr(Context context, int cpuThreadNum, boolean useSlim) {
}

public boolean initOcr(Context context, String myModelPath) {
return mPredictor.init(context, myModelPath,myModelPath);
return mPredictor.init(context, myModelPath);
}

public List<OcrResult> ocr(ImageWrapper image, int cpuThreadNum, boolean useSlim) {
Expand Down Expand Up @@ -48,7 +48,7 @@ public List<OcrResult> ocr(ImageWrapper image, int cpuThreadNum, String myModelP
if (!mPredictor.isLoaded()) {
initOcr(GlobalAppContext.get(), myModelPath);
}
return mPredictor.runOcr(bitmap, 4, true);
return mPredictor.runOcr(bitmap, cpuThreadNum, true);
}

public List<OcrResult> ocr(ImageWrapper image, int cpuThreadNum) {
Expand Down Expand Up @@ -84,7 +84,7 @@ public void release() {
private String[] sortResult(List<OcrResult> src) {
String[] outputResult = new String[src.size()];
for (int i = 0; i < src.size(); i++) {
outputResult[i] = src.get(i).words;
outputResult[i] = src.get(i).getWords();
Log.i("outputResult", outputResult[i].toString()); // show LOG in Logcat panel
}
return outputResult;
Expand Down

0 comments on commit 58f763f

Please sign in to comment.