FastDeploy  latest
Fast & Easy to Deploy!
Typedefs | Functions
model.h File Reference
#include "fastdeploy_capi/core/fd_common.h"
#include "fastdeploy_capi/core/fd_type.h"
#include "fastdeploy_capi/runtime/runtime_option.h"
#include "fastdeploy_capi/vision/result.h"
#include "fastdeploy_capi/vision/detection/contrib/yolo/base_define.h"
Include dependency graph for model.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef struct FD_C_RuntimeOptionWrapper FD_C_RuntimeOptionWrapper
 
typedef struct FD_C_YOLOv5Wrapper FD_C_YOLOv5Wrapper
 
typedef struct FD_C_YOLOv7Wrapper FD_C_YOLOv7Wrapper
 
typedef struct FD_C_YOLOv8Wrapper FD_C_YOLOv8Wrapper
 
typedef struct FD_C_YOLOv6Wrapper FD_C_YOLOv6Wrapper
 
typedef struct FD_C_YOLORWrapper FD_C_YOLORWrapper
 
typedef struct FD_C_YOLOXWrapper FD_C_YOLOXWrapper
 

Functions

 YOLO_DECLARE_CREATE_WRAPPER_FUNCTION (YOLOv5)
 Create a new FD_C_YOLOv5Wrapper object. More...
 
 YOLO_DECLARE_DESTROY_WRAPPER_FUNCTION (YOLOv5, fd_c_yolov5_wrapper)
 Destroy a FD_C_YOLOv5Wrapper object. More...
 
 YOLO_DECLARE_PREDICT_FUNCTION (YOLOv5, fd_c_yolov5_wrapper)
 Predict the detection result for an input image. More...
 
 YOLO_DECLARE_INITIALIZED_FUNCTION (YOLOv5, fd_c_yolov5_wrapper)
 Check if the model is initialized successfully. More...
 
 YOLO_DECLARE_BATCH_PREDICT_FUNCTION (YOLOv5, fd_c_yolov5_wrapper)
 Predict the detection results for a batch of input images. More...
 
 YOLO_DECLARE_CREATE_WRAPPER_FUNCTION (YOLOv7)
 Create a new FD_C_YOLOv7Wrapper object. More...
 
 YOLO_DECLARE_DESTROY_WRAPPER_FUNCTION (YOLOv7, fd_c_yolov7_wrapper)
 Destroy a FD_C_YOLOv7Wrapper object. More...
 
 YOLO_DECLARE_PREDICT_FUNCTION (YOLOv7, fd_c_yolov7_wrapper)
 Predict the detection result for an input image. More...
 
 YOLO_DECLARE_INITIALIZED_FUNCTION (YOLOv7, fd_c_yolov7_wrapper)
 Check if the model is initialized successfully. More...
 
 YOLO_DECLARE_BATCH_PREDICT_FUNCTION (YOLOv7, fd_c_yolov7_wrapper)
 Predict the detection results for a batch of input images. More...
 
 YOLO_DECLARE_CREATE_WRAPPER_FUNCTION (YOLOv8)
 Create a new FD_C_YOLOv8Wrapper object. More...
 
 YOLO_DECLARE_DESTROY_WRAPPER_FUNCTION (YOLOv8, fd_c_yolov8_wrapper)
 Destroy a FD_C_YOLOv8Wrapper object. More...
 
 YOLO_DECLARE_PREDICT_FUNCTION (YOLOv8, fd_c_yolov8_wrapper)
 Predict the detection result for an input image. More...
 
 YOLO_DECLARE_INITIALIZED_FUNCTION (YOLOv8, fd_c_yolov8_wrapper)
 Check if the model is initialized successfully. More...
 
 YOLO_DECLARE_BATCH_PREDICT_FUNCTION (YOLOv8, fd_c_yolov8_wrapper)
 Predict the detection results for a batch of input images. More...
 
 YOLO_DECLARE_CREATE_WRAPPER_FUNCTION (YOLOv6)
 Create a new FD_C_YOLOv6Wrapper object. More...
 
 YOLO_DECLARE_DESTROY_WRAPPER_FUNCTION (YOLOv6, fd_c_yolov6_wrapper)
 Destroy a FD_C_YOLOv6Wrapper object. More...
 
 YOLO_DECLARE_PREDICT_FUNCTION_WITH_THRESHOLD (YOLOv6, fd_c_yolov6_wrapper)
 Predict the detection result for an input image. More...
 
 YOLO_DECLARE_INITIALIZED_FUNCTION (YOLOv6, fd_c_yolov6_wrapper)
 Check if the model is initialized successfully. More...
 
 YOLO_DECLARE_CREATE_WRAPPER_FUNCTION (YOLOR)
 Create a new FD_C_YOLORWrapper object. More...
 
 YOLO_DECLARE_DESTROY_WRAPPER_FUNCTION (YOLOR, fd_c_yolor_wrapper)
 Destroy a FD_C_YOLORWrapper object. More...
 
 YOLO_DECLARE_PREDICT_FUNCTION_WITH_THRESHOLD (YOLOR, fd_c_yolor_wrapper)
 Predict the detection result for an input image. More...
 
 YOLO_DECLARE_INITIALIZED_FUNCTION (YOLOR, fd_c_yolor_wrapper)
 Check if the model is initialized successfully. More...
 
 YOLO_DECLARE_CREATE_WRAPPER_FUNCTION (YOLOX)
 Create a new FD_C_YOLOXWrapper object. More...
 
 YOLO_DECLARE_DESTROY_WRAPPER_FUNCTION (YOLOX, fd_c_yolox_wrapper)
 Destroy a FD_C_YOLOXWrapper object. More...
 
 YOLO_DECLARE_PREDICT_FUNCTION_WITH_THRESHOLD (YOLOX, fd_c_yolox_wrapper)
 Predict the detection result for an input image. More...
 
 YOLO_DECLARE_INITIALIZED_FUNCTION (YOLOX, fd_c_yolox_wrapper)
 Check if the model is initialized successfully. More...
 

Typedef Documentation

◆ FD_C_RuntimeOptionWrapper

◆ FD_C_YOLORWrapper

◆ FD_C_YOLOv5Wrapper

◆ FD_C_YOLOv6Wrapper

◆ FD_C_YOLOv7Wrapper

◆ FD_C_YOLOv8Wrapper

◆ FD_C_YOLOXWrapper

Function Documentation

◆ YOLO_DECLARE_BATCH_PREDICT_FUNCTION() [1/3]

YOLO_DECLARE_BATCH_PREDICT_FUNCTION ( YOLOv5  ,
fd_c_yolov5_wrapper   
)

Predict the detection results for a batch of input images.

Parameters
[in]fd_c_yolov5_wrapperpointer to FD_C_YOLOv5Wrapper object
[in]imgs,Theinput image list, each element comes from cv::imread()
[in]resultsThe output detection result list
Returns
true if the prediction successed, otherwise false

◆ YOLO_DECLARE_BATCH_PREDICT_FUNCTION() [2/3]

YOLO_DECLARE_BATCH_PREDICT_FUNCTION ( YOLOv7  ,
fd_c_yolov7_wrapper   
)

Predict the detection results for a batch of input images.

Parameters
[in]fd_c_yolov7_wrapperpointer to FD_C_YOLOv7Wrapper object
[in]imgs,Theinput image list, each element comes from cv::imread()
[in]resultsThe output detection result list
Returns
true if the prediction successed, otherwise false

◆ YOLO_DECLARE_BATCH_PREDICT_FUNCTION() [3/3]

YOLO_DECLARE_BATCH_PREDICT_FUNCTION ( YOLOv8  ,
fd_c_yolov8_wrapper   
)

Predict the detection results for a batch of input images.

Parameters
[in]fd_c_yolov8_wrapperpointer to FD_C_YOLOv8Wrapper object
[in]imgs,Theinput image list, each element comes from cv::imread()
[in]resultsThe output detection result list
Returns
true if the prediction successed, otherwise false

◆ YOLO_DECLARE_CREATE_WRAPPER_FUNCTION() [1/6]

YOLO_DECLARE_CREATE_WRAPPER_FUNCTION ( YOLOv5  )

Create a new FD_C_YOLOv5Wrapper object.

Parameters
[in]model_filePath of model file, e.g ./yolov5.onnx
[in]params_filePath of parameter file, e.g ppyoloe/model.pdiparams, if the model format is ONNX, this parameter will be ignored
[in]fd_c_runtime_option_wrapperRuntimeOption for inference, the default will use cpu, and choose the backend defined in valid_cpu_backends
[in]model_formatModel format of the loaded model, default is Paddle format
Returns
Return a pointer to FD_C_YOLOv5Wrapper object

◆ YOLO_DECLARE_CREATE_WRAPPER_FUNCTION() [2/6]

YOLO_DECLARE_CREATE_WRAPPER_FUNCTION ( YOLOv7  )

Create a new FD_C_YOLOv7Wrapper object.

Parameters
[in]model_filePath of model file, e.g ./yolov7.onnx
[in]params_filePath of parameter file, e.g ppyoloe/model.pdiparams, if the model format is ONNX, this parameter will be ignored
[in]fd_c_runtime_option_wrapperRuntimeOption for inference, the default will use cpu, and choose the backend defined in valid_cpu_backends
[in]model_formatModel format of the loaded model, default is Paddle format
Returns
Return a pointer to FD_C_YOLOv7Wrapper object

◆ YOLO_DECLARE_CREATE_WRAPPER_FUNCTION() [3/6]

YOLO_DECLARE_CREATE_WRAPPER_FUNCTION ( YOLOv8  )

Create a new FD_C_YOLOv8Wrapper object.

Parameters
[in]model_filePath of model file, e.g ./yolov8.onnx
[in]params_filePath of parameter file, e.g ppyoloe/model.pdiparams, if the model format is ONNX, this parameter will be ignored
[in]fd_c_runtime_option_wrapperRuntimeOption for inference, the default will use cpu, and choose the backend defined in valid_cpu_backends
[in]model_formatModel format of the loaded model, default is Paddle format
Returns
Return a pointer to FD_C_YOLOv8Wrapper object

◆ YOLO_DECLARE_CREATE_WRAPPER_FUNCTION() [4/6]

YOLO_DECLARE_CREATE_WRAPPER_FUNCTION ( YOLOv6  )

Create a new FD_C_YOLOv6Wrapper object.

Parameters
[in]model_filePath of model file, e.g ./yolov6.onnx
[in]params_filePath of parameter file, e.g ppyoloe/model.pdiparams, if the model format is ONNX, this parameter will be ignored
[in]fd_c_runtime_option_wrapperRuntimeOption for inference, the default will use cpu, and choose the backend defined in valid_cpu_backends
[in]model_formatModel format of the loaded model, default is Paddle format
Returns
Return a pointer to FD_C_YOLOv6Wrapper object

◆ YOLO_DECLARE_CREATE_WRAPPER_FUNCTION() [5/6]

YOLO_DECLARE_CREATE_WRAPPER_FUNCTION ( YOLOR  )

Create a new FD_C_YOLORWrapper object.

Parameters
[in]model_filePath of model file, e.g ./yolor.onnx
[in]params_filePath of parameter file, e.g ppyoloe/model.pdiparams, if the model format is ONNX, this parameter will be ignored
[in]fd_c_runtime_option_wrapperRuntimeOption for inference, the default will use cpu, and choose the backend defined in valid_cpu_backends
[in]model_formatModel format of the loaded model, default is Paddle format
Returns
Return a pointer to FD_C_YOLORWrapper object

◆ YOLO_DECLARE_CREATE_WRAPPER_FUNCTION() [6/6]

YOLO_DECLARE_CREATE_WRAPPER_FUNCTION ( YOLOX  )

Create a new FD_C_YOLOXWrapper object.

Parameters
[in]model_filePath of model file, e.g ./yolox.onnx
[in]params_filePath of parameter file, e.g ppyoloe/model.pdiparams, if the model format is ONNX, this parameter will be ignored
[in]fd_c_runtime_option_wrapperRuntimeOption for inference, the default will use cpu, and choose the backend defined in valid_cpu_backends
[in]model_formatModel format of the loaded model, default is Paddle format
Returns
Return a pointer to FD_C_YOLOXWrapper object

◆ YOLO_DECLARE_DESTROY_WRAPPER_FUNCTION() [1/6]

YOLO_DECLARE_DESTROY_WRAPPER_FUNCTION ( YOLOv5  ,
fd_c_yolov5_wrapper   
)

Destroy a FD_C_YOLOv5Wrapper object.

Parameters
[in]fd_c_yolov5_wrapperpointer to FD_C_YOLOv5Wrapper object

◆ YOLO_DECLARE_DESTROY_WRAPPER_FUNCTION() [2/6]

YOLO_DECLARE_DESTROY_WRAPPER_FUNCTION ( YOLOv7  ,
fd_c_yolov7_wrapper   
)

Destroy a FD_C_YOLOv7Wrapper object.

Parameters
[in]fd_c_yolov7_wrapperpointer to FD_C_YOLOv7Wrapper object

◆ YOLO_DECLARE_DESTROY_WRAPPER_FUNCTION() [3/6]

YOLO_DECLARE_DESTROY_WRAPPER_FUNCTION ( YOLOv8  ,
fd_c_yolov8_wrapper   
)

Destroy a FD_C_YOLOv8Wrapper object.

Parameters
[in]fd_c_yolov8_wrapperpointer to FD_C_YOLOv8Wrapper object

◆ YOLO_DECLARE_DESTROY_WRAPPER_FUNCTION() [4/6]

YOLO_DECLARE_DESTROY_WRAPPER_FUNCTION ( YOLOv6  ,
fd_c_yolov6_wrapper   
)

Destroy a FD_C_YOLOv6Wrapper object.

Parameters
[in]fd_c_yolov6_wrapperpointer to FD_C_YOLOv6Wrapper object

◆ YOLO_DECLARE_DESTROY_WRAPPER_FUNCTION() [5/6]

YOLO_DECLARE_DESTROY_WRAPPER_FUNCTION ( YOLOR  ,
fd_c_yolor_wrapper   
)

Destroy a FD_C_YOLORWrapper object.

Parameters
[in]fd_c_yolor_wrapperpointer to FD_C_YOLORWrapper object

◆ YOLO_DECLARE_DESTROY_WRAPPER_FUNCTION() [6/6]

YOLO_DECLARE_DESTROY_WRAPPER_FUNCTION ( YOLOX  ,
fd_c_yolox_wrapper   
)

Destroy a FD_C_YOLOXWrapper object.

Parameters
[in]fd_c_yolox_wrapperpointer to FD_C_YOLOXWrapper object

◆ YOLO_DECLARE_INITIALIZED_FUNCTION() [1/6]

YOLO_DECLARE_INITIALIZED_FUNCTION ( YOLOv5  ,
fd_c_yolov5_wrapper   
)

Check if the model is initialized successfully.

Parameters
[in]fd_c_yolov5_wrapperpointer to FD_C_YOLOv5Wrapper object
Returns
Return a bool of value true if initialized successfully

◆ YOLO_DECLARE_INITIALIZED_FUNCTION() [2/6]

YOLO_DECLARE_INITIALIZED_FUNCTION ( YOLOv7  ,
fd_c_yolov7_wrapper   
)

Check if the model is initialized successfully.

Parameters
[in]fd_c_yolov7_wrapperpointer to FD_C_YOLOv7Wrapper object
Returns
Return a bool of value true if initialized successfully

◆ YOLO_DECLARE_INITIALIZED_FUNCTION() [3/6]

YOLO_DECLARE_INITIALIZED_FUNCTION ( YOLOv8  ,
fd_c_yolov8_wrapper   
)

Check if the model is initialized successfully.

Parameters
[in]fd_c_yolov8_wrapperpointer to FD_C_YOLOv8Wrapper object
Returns
Return a bool of value true if initialized successfully

◆ YOLO_DECLARE_INITIALIZED_FUNCTION() [4/6]

YOLO_DECLARE_INITIALIZED_FUNCTION ( YOLOv6  ,
fd_c_yolov6_wrapper   
)

Check if the model is initialized successfully.

Parameters
[in]fd_c_yolov6_wrapperpointer to FD_C_YOLOv6Wrapper object
Returns
Return a bool of value true if initialized successfully

◆ YOLO_DECLARE_INITIALIZED_FUNCTION() [5/6]

YOLO_DECLARE_INITIALIZED_FUNCTION ( YOLOR  ,
fd_c_yolor_wrapper   
)

Check if the model is initialized successfully.

Parameters
[in]fd_c_yolor_wrapperpointer to FD_C_YOLORWrapper object
Returns
Return a bool of value true if initialized successfully

◆ YOLO_DECLARE_INITIALIZED_FUNCTION() [6/6]

YOLO_DECLARE_INITIALIZED_FUNCTION ( YOLOX  ,
fd_c_yolox_wrapper   
)

Check if the model is initialized successfully.

Parameters
[in]fd_c_yolox_wrapperpointer to FD_C_YOLOXWrapper object
Returns
Return a bool of value true if initialized successfully

◆ YOLO_DECLARE_PREDICT_FUNCTION() [1/3]

YOLO_DECLARE_PREDICT_FUNCTION ( YOLOv5  ,
fd_c_yolov5_wrapper   
)

Predict the detection result for an input image.

Parameters
[in]fd_c_yolov5_wrapperpointer to FD_C_YOLOv5Wrapper object
[in]imgpointer to cv::Mat image
[in]fd_c_detection_result_wrapperpointer to FD_C_DetectionResultWrapper object, which stores the result.

◆ YOLO_DECLARE_PREDICT_FUNCTION() [2/3]

YOLO_DECLARE_PREDICT_FUNCTION ( YOLOv7  ,
fd_c_yolov7_wrapper   
)

Predict the detection result for an input image.

Parameters
[in]fd_c_yolov7_wrapperpointer to FD_C_YOLOv7Wrapper object
[in]imgpointer to cv::Mat image
[in]fd_c_detection_result_wrapperpointer to FD_C_DetectionResultWrapper object, which stores the result.

◆ YOLO_DECLARE_PREDICT_FUNCTION() [3/3]

YOLO_DECLARE_PREDICT_FUNCTION ( YOLOv8  ,
fd_c_yolov8_wrapper   
)

Predict the detection result for an input image.

Parameters
[in]fd_c_yolov8_wrapperpointer to FD_C_YOLOv8Wrapper object
[in]imgpointer to cv::Mat image
[in]fd_c_detection_result_wrapperpointer to FD_C_DetectionResultWrapper object, which stores the result.

◆ YOLO_DECLARE_PREDICT_FUNCTION_WITH_THRESHOLD() [1/3]

YOLO_DECLARE_PREDICT_FUNCTION_WITH_THRESHOLD ( YOLOv6  ,
fd_c_yolov6_wrapper   
)

Predict the detection result for an input image.

Parameters
[in]fd_c_yolov6_wrapperpointer to FD_C_YOLOv6Wrapper object
[in]imgpointer to cv::Mat image
[in]conf_thresholdconfidence threashold for postprocessing
[in]nms_iou_thresholdiou threashold for NMS
[in]fd_c_detection_result_wrapperpointer to FD_C_DetectionResultWrapper object, which stores the result.

◆ YOLO_DECLARE_PREDICT_FUNCTION_WITH_THRESHOLD() [2/3]

YOLO_DECLARE_PREDICT_FUNCTION_WITH_THRESHOLD ( YOLOR  ,
fd_c_yolor_wrapper   
)

Predict the detection result for an input image.

Parameters
[in]fd_c_yolor_wrapperpointer to FD_C_YOLORWrapper object
[in]imgpointer to cv::Mat image
[in]conf_thresholdconfidence threashold for postprocessing
[in]nms_iou_thresholdiou threashold for NMS
[in]fd_c_detection_result_wrapperpointer to FD_C_DetectionResultWrapper object, which stores the result.

◆ YOLO_DECLARE_PREDICT_FUNCTION_WITH_THRESHOLD() [3/3]

YOLO_DECLARE_PREDICT_FUNCTION_WITH_THRESHOLD ( YOLOX  ,
fd_c_yolox_wrapper   
)

Predict the detection result for an input image.

Parameters
[in]fd_c_yolox_wrapperpointer to FD_C_YOLOXWrapper object
[in]imgpointer to cv::Mat image
[in]conf_thresholdconfidence threashold for postprocessing
[in]nms_iou_thresholdiou threashold for NMS
[in]fd_c_detection_result_wrapperpointer to FD_C_DetectionResultWrapper object, which stores the result.