mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-12-24 13:28:13 +08:00
* add java examples * fix detail * fix pre-config --------- Co-authored-by: DefTruth <31974251+DefTruth@users.noreply.github.com>
25 lines
661 B
Java
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);
|
|
}
|
|
}
|
|
|