Skip to content

Commit

Permalink
change thread
Browse files Browse the repository at this point in the history
  • Loading branch information
litongjava committed Apr 28, 2024
1 parent 38de48b commit e40f8d7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 0 additions & 1 deletion src/main/java/com/luooqi/ocr/local/PaddlePaddleOCRV4.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,5 @@ public OcrResult ocr(File imageFile) {
}

public void close() {

}
}
7 changes: 6 additions & 1 deletion src/test/java/com/litongjava/RapidOcrTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,15 @@

public class RapidOcrTest {
public static void main(String[] args) {
String imagePath = "C:\\Users\\Administrator\\Desktop\\01.jpg";

// init
HardwareConfig onnxConfig = HardwareConfig.getOnnxConfig();
onnxConfig.setNumThread(2);
InferenceEngine engine = InferenceEngine.getInstance(Model.ONNX_PPOCR_V4_SERVER, onnxConfig);
OcrResult ocrResult = engine.runOcr("C:\\Users\\Administrator\\Desktop\\01.jpg");

// run
OcrResult ocrResult = engine.runOcr(imagePath);
System.out.println(ocrResult.getStrRes().trim());
}
}

0 comments on commit e40f8d7

Please sign in to comment.