Files
FastDeploy/examples/application/java/yolov5/java/InferDemo.java
hjyp cc4bbf2163 [PaddlePaddle Hackathon4 No.185] Add PaddleDetection Models Deployment Java Examples (#1782)
* add java examples

* fix detail

* fix pre-config

---------

Co-authored-by: DefTruth <31974251+DefTruth@users.noreply.github.com>
2023-04-10 21:23:44 +08:00

25 lines
661 B
Java

public class InferDemo {
private native void infer(String modelPath, String imagePath);
private final static String JNI_LIB_NAME = "../cpp/build/libinferDemo.so";
static {
System.load(InferDemo.class.getResource("/").getPath() + JNI_LIB_NAME);
}
public static void main(String[] args) {
if (args.length < 2) {
System.out.println("Please input enough params. e.g. java test.java param-dir image-path");
return;
}
String modelPath = args[0];
String imagePath = args[1];
InferDemo inferDemo = new InferDemo();
inferDemo.infer(modelPath, imagePath);
}
}