16 #include "fastdeploy/fastdeploy_model.h" 17 #include "fastdeploy/vision/common/processors/transform.h" 18 #include "fastdeploy/vision/common/result.h" 34 YOLOv5Lite(
const std::string& model_file,
const std::string& params_file =
"",
40 virtual std::string
ModelName()
const {
return "YOLOv5-Lite"; }
50 float conf_threshold = 0.45,
51 float nms_iou_threshold = 0.25);
54 void UseCudaPreprocessing(
int max_img_size = 3840 * 2160);
62 std::vector<float> padding_value;
77 std::vector<int> downsample_strides;
80 std::vector<std::vector<float>> anchor_config;
105 std::map<std::string, std::array<float, 2>>* im_info);
109 std::map<std::string, std::array<float, 2>>* im_info);
112 const std::map<std::string, std::array<float, 2>>& im_info,
113 float conf_threshold,
float nms_iou_threshold);
119 bool PostprocessWithDecode(
121 const std::map<std::string, std::array<float, 2>>& im_info,
122 float conf_threshold,
float nms_iou_threshold);
124 void LetterBox(
Mat* mat,
const std::vector<int>& size,
125 const std::vector<float>& color,
bool _auto,
126 bool scale_fill =
false,
bool scale_up =
true,
130 void GenerateAnchors(
const std::vector<int>& size,
131 const std::vector<int>& downsample_strides,
132 std::vector<Anchor>* anchors,
const int num_anchors = 3);
139 bool is_dynamic_input_;
141 uint8_t* input_img_cuda_buffer_host_ =
nullptr;
143 uint8_t* input_img_cuda_buffer_device_ =
nullptr;
145 float* input_tensor_cuda_buffer_device_ =
nullptr;
147 bool use_cuda_preprocessing_ =
false;
149 void* cuda_stream_ =
nullptr;
Option object used when create a new Runtime object.
Definition: runtime_option.h:40
Base model object for all the vision models.
Definition: fastdeploy_model.h:21
ModelFormat
Definition: enum_variables.h:67
FDTensor object used to represend data matrix.
Definition: fd_tensor.h:31
YOLOv5Lite model object used when to load a YOLOv5Lite model exported by YOLOv5Lite.
Definition: yolov5lite.h:25
Detection result structure for all the object detection models and instance segmentation models...
Definition: result.h:106
std::vector< int > size
Argument for image preprocessing step, tuple of (width, height), decide the target size after resize...
Definition: yolov5lite.h:59
FDMat is a structure for replace cv::Mat.
Definition: mat.h:34
virtual std::string ModelName() const
Get model's name.
Definition: yolov5lite.h:40
bool is_decode_exported
whether the model_file was exported with decode module. The official YOLOv5Lite/export.py script will export ONNX file without decode module. Please set it 'true' manually if the model file was exported with decode module. false : ONNX files without decode module. true : ONNX file with decode module. default false.
Definition: yolov5lite.h:89
Model with ONNX format.
Definition: enum_variables.h:70
All C++ FastDeploy APIs are defined inside this namespace.
Definition: option.h:16