mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-10-31 03:46:40 +08:00
[C API] Add create api for c results (#1547)
add create api for c results
This commit is contained in:
@@ -47,8 +47,7 @@ void CpuInfer(const char* model_dir, const char* image_file) {
|
||||
|
||||
FD_C_Mat im = FD_C_Imread(image_file);
|
||||
|
||||
FD_C_DetectionResult* result =
|
||||
(FD_C_DetectionResult*)malloc(sizeof(FD_C_DetectionResult));
|
||||
FD_C_DetectionResult* result = FD_C_CreateDetectionResult();
|
||||
|
||||
if (!FD_C_PPYOLOEWrapperPredict(model, im, result)) {
|
||||
printf("Failed to predict.\n");
|
||||
@@ -95,8 +94,7 @@ void GpuInfer(const char* model_dir, const char* image_file) {
|
||||
|
||||
FD_C_Mat im = FD_C_Imread(image_file);
|
||||
|
||||
FD_C_DetectionResult* result =
|
||||
(FD_C_DetectionResult*)malloc(sizeof(FD_C_DetectionResult));
|
||||
FD_C_DetectionResult* result = FD_C_CreateDetectionResult();
|
||||
|
||||
if (!FD_C_PPYOLOEWrapperPredict(model, im, result)) {
|
||||
printf("Failed to predict.\n");
|
||||
|
||||
@@ -39,8 +39,7 @@ void CpuInfer(const char* model_file, const char* image_file) {
|
||||
|
||||
FD_C_Mat im = FD_C_Imread(image_file);
|
||||
|
||||
FD_C_DetectionResult* result =
|
||||
(FD_C_DetectionResult*)malloc(sizeof(FD_C_DetectionResult));
|
||||
FD_C_DetectionResult* result = FD_C_CreateDetectionResult();
|
||||
|
||||
if (!FD_C_YOLOv5WrapperPredict(model, im, result)) {
|
||||
printf("Failed to predict.\n");
|
||||
@@ -79,8 +78,7 @@ void GpuInfer(const char* model_file, const char* image_file) {
|
||||
|
||||
FD_C_Mat im = FD_C_Imread(image_file);
|
||||
|
||||
FD_C_DetectionResult* result =
|
||||
(FD_C_DetectionResult*)malloc(sizeof(FD_C_DetectionResult));
|
||||
FD_C_DetectionResult* result = FD_C_CreateDetectionResult();
|
||||
|
||||
if (!FD_C_YOLOv5WrapperPredict(model, im, result)) {
|
||||
printf("Failed to predict.\n");
|
||||
|
||||
Reference in New Issue
Block a user