mirror of
				https://github.com/PaddlePaddle/FastDeploy.git
				synced 2025-11-01 04:12:58 +08:00 
			
		
		
		
	 e248781784
			
		
	
	e248781784
	
	
	
		
			
			* update .gitignore * Added checking for cmake include dir * fixed missing trt_backend option bug when init from trt * remove un-need data layout and add pre-check for dtype * changed RGB2BRG to BGR2RGB in ppcls model * add model_zoo yolov6 c++/python demo * fixed CMakeLists.txt typos * update yolov6 cpp/README.md * add yolox c++/pybind and model_zoo demo * move some helpers to private * fixed CMakeLists.txt typos * add normalize with alpha and beta * add version notes for yolov5/yolov6/yolox * add copyright to yolov5.cc * revert normalize * fixed some bugs in yolox * Add NanoDet-Plus Model support Co-authored-by: Jason <jiangjiajun@baidu.com>
		
			
				
	
	
		
			72 lines
		
	
	
		
			2.5 KiB
		
	
	
	
		
			Markdown
		
	
	
	
	
	
			
		
		
	
	
			72 lines
		
	
	
		
			2.5 KiB
		
	
	
	
		
			Markdown
		
	
	
	
	
	
| # NanoDetPlus API说明
 | ||
| 
 | ||
| ## Python API
 | ||
| 
 | ||
| ### NanoDetPlus类
 | ||
| ```
 | ||
| fastdeploy.vision.rangilyu.NanoDetPlus(model_file, params_file=None, runtime_option=None, model_format=fd.Frontend.ONNX)
 | ||
| ```
 | ||
| NanoDetPlus模型加载和初始化,当model_format为`fd.Frontend.ONNX`时,只需提供model_file,如`nanodet-plus-m_320.onnx`;当model_format为`fd.Frontend.PADDLE`时,则需同时提供model_file和params_file。
 | ||
| 
 | ||
| **参数**
 | ||
| 
 | ||
| > * **model_file**(str): 模型文件路径
 | ||
| > * **params_file**(str): 参数文件路径
 | ||
| > * **runtime_option**(RuntimeOption): 后端推理配置,默认为None,即采用默认配置
 | ||
| > * **model_format**(Frontend): 模型格式
 | ||
| 
 | ||
| #### predict函数
 | ||
| > ```
 | ||
| > NanoDetPlus.predict(image_data, conf_threshold=0.35, nms_iou_threshold=0.5)
 | ||
| > ```
 | ||
| > 模型预测结口,输入图像直接输出检测结果。
 | ||
| >
 | ||
| > **参数**
 | ||
| >
 | ||
| > > * **image_data**(np.ndarray): 输入数据,注意需为HWC,BGR格式
 | ||
| > > * **conf_threshold**(float): 检测框置信度过滤阈值
 | ||
| > > * **nms_iou_threshold**(float): NMS处理过程中iou阈值
 | ||
| 
 | ||
| 示例代码参考[nanodet_plus.py](./nanodet_plus.py)
 | ||
| 
 | ||
| 
 | ||
| ## C++ API
 | ||
| 
 | ||
| ### NanoDetPlus类
 | ||
| ```
 | ||
| fastdeploy::vision::rangilyu::NanoDetPlus(
 | ||
|         const string& model_file,
 | ||
|         const string& params_file = "",
 | ||
|         const RuntimeOption& runtime_option = RuntimeOption(),
 | ||
|         const Frontend& model_format = Frontend::ONNX)
 | ||
| ```
 | ||
| NanoDetPlus模型加载和初始化,当model_format为`Frontend::ONNX`时,只需提供model_file,如`nanodet-plus-m_320.onnx`;当model_format为`Frontend::PADDLE`时,则需同时提供model_file和params_file。
 | ||
| 
 | ||
| **参数**
 | ||
| 
 | ||
| > * **model_file**(str): 模型文件路径
 | ||
| > * **params_file**(str): 参数文件路径
 | ||
| > * **runtime_option**(RuntimeOption): 后端推理配置,默认为None,即采用默认配置
 | ||
| > * **model_format**(Frontend): 模型格式
 | ||
| 
 | ||
| #### Predict函数
 | ||
| > ```
 | ||
| > NanoDetPlus::Predict(cv::Mat* im, DetectionResult* result,
 | ||
| >                      float conf_threshold = 0.35,
 | ||
| >                      float nms_iou_threshold = 0.5)
 | ||
| > ```
 | ||
| > 模型预测接口,输入图像直接输出检测结果。
 | ||
| >
 | ||
| > **参数**
 | ||
| >
 | ||
| > > * **im**: 输入图像,注意需为HWC,BGR格式
 | ||
| > > * **result**: 检测结果,包括检测框,各个框的置信度
 | ||
| > > * **conf_threshold**: 检测框置信度过滤阈值
 | ||
| > > * **nms_iou_threshold**: NMS处理过程中iou阈值
 | ||
| 
 | ||
| 示例代码参考[cpp/nanodet_plus.cc](cpp/nanodet_plus.cc)
 | ||
| 
 | ||
| ## 其它API使用
 | ||
| 
 | ||
| - [模型部署RuntimeOption配置](../../../docs/api/runtime_option.md)
 |