mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-11-02 12:44:20 +08:00
[Other] add code and docs for ppclas examples (#1312)
* add code and docs for ppclas examples * fix doc * add code for printing results * add ppcls demo and docs * modify example according to refined c api * modify example code and docs for ppcls and ppdet * modify example code and docs for ppcls and ppdet * update ppdet demo * fix demo codes * fix doc * release resource when failed * fix * fix name * fix name
This commit is contained in:
@@ -44,13 +44,16 @@ namespace Test
|
||||
}else{
|
||||
runtimeoption.UseGpu();
|
||||
}
|
||||
vision.detection.PPYOLOE model = new vision.detection.PPYOLOE(model_file, params_file, config_file, runtimeoption, ModelFormat.PADDLE);
|
||||
fastdeploy.vision.detection.PPYOLOE model = new fastdeploy.vision.detection.PPYOLOE(model_file, params_file, config_file, runtimeoption, ModelFormat.PADDLE);
|
||||
if(!model.Initialized()){
|
||||
Console.WriteLine("Failed to initialize.\n");
|
||||
}
|
||||
Mat image = Cv2.ImRead(image_path);
|
||||
vision.DetectionResult res = model.Predict(image);
|
||||
Mat res_img = vision.Visualize.VisDetection(image, res, 0, 1, 0.5f);
|
||||
fastdeploy.vision.DetectionResult res = model.Predict(image);
|
||||
Console.WriteLine(res.ToString());
|
||||
Mat res_img = fastdeploy.vision.Visualize.VisDetection(image, res, 0, 1, 0.5f);
|
||||
Cv2.ImShow("result.png", res_img);
|
||||
Cv2.WaitKey(0);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user