Commit e7dd6859 authored by yaoht's avatar yaoht
Browse files

fix README.md

parent b603f385
...@@ -40,10 +40,10 @@ samples工程中的Resource/Configuration.xml文件的DetectorYOLOV8节点表示 ...@@ -40,10 +40,10 @@ samples工程中的Resource/Configuration.xml文件的DetectorYOLOV8节点表示
ErrorCode DetectorYOLOV8::Initialize(InitializationParameterOfDetector initializationParameterOfDetector, bool dynamic) ErrorCode DetectorYOLOV8::Initialize(InitializationParameterOfDetector initializationParameterOfDetector, bool dynamic)
{ {
... ...
// 加载模型 // 加载模型
net = migraphx::parse_onnx(modelPath); net = migraphx::parse_onnx(modelPath);
LOG_INFO(stdout,"succeed to load model: %s\n",GetFileName(modelPath).c_str()); LOG_INFO(stdout,"succeed to load model: %s\n",GetFileName(modelPath).c_str());
... ...
} }
...@@ -54,12 +54,12 @@ ErrorCode DetectorYOLOV8::Initialize(InitializationParameterOfDetector initializ ...@@ -54,12 +54,12 @@ ErrorCode DetectorYOLOV8::Initialize(InitializationParameterOfDetector initializ
```cpp ```cpp
ErrorCode DetectorYOLOV8::Initialize(InitializationParameterOfDetector initializationParameterOfDetector, bool dynamic) ErrorCode DetectorYOLOV8::Initialize(InitializationParameterOfDetector initializationParameterOfDetector, bool dynamic)
{ {
... ...
migraphx::onnx_options onnx_options; migraphx::onnx_options onnx_options;
onnx_options.map_input_dims["images"]={1,3,1024,1024};// onnx_options.map_input_dims["images"]={1,3,1024,1024};//
net = migraphx::parse_onnx(modelPath, onnx_options); net = migraphx::parse_onnx(modelPath, onnx_options);
... ...
} }
``` ```
...@@ -77,9 +77,9 @@ ErrorCode DetectorYOLOV8::Initialize(InitializationParameterOfDetector initializ ...@@ -77,9 +77,9 @@ ErrorCode DetectorYOLOV8::Initialize(InitializationParameterOfDetector initializ
```cpp ```cpp
ErrorCode DetectorYOLOV8::Detect(const cv::Mat &srcImage, std::vector<std::size_t> &relInputShape, std::vector<ResultOfDetection> &resultsOfDetection, bool dynamic) ErrorCode DetectorYOLOV8::Detect(const cv::Mat &srcImage, std::vector<std::size_t> &relInputShape, std::vector<ResultOfDetection> &resultsOfDetection, bool dynamic)
{ {
... ...
// 数据预处理并转换为NCHW格式 // 数据预处理并转换为NCHW格式
inputSize = cv::Size(relInputShape[3], relInputShape[2]); inputSize = cv::Size(relInputShape[3], relInputShape[2]);
cv::Mat inputBlob; cv::Mat inputBlob;
cv::dnn::blobFromImage(srcImage, cv::dnn::blobFromImage(srcImage,
......
...@@ -20,7 +20,8 @@ YOLOV8是一种单阶段目标检测算法,该算法在YOLOV5的基础上添 ...@@ -20,7 +20,8 @@ YOLOV8是一种单阶段目标检测算法,该算法在YOLOV5的基础上添
def preprocess(self, image): def preprocess(self, image):
""" """
Preprocesses the input image before performing inference. Preprocesses the input image before performing inference.
Args:
image: image to preprocess.
Returns: Returns:
image_data: Preprocessed image data ready for inference. image_data: Preprocessed image data ready for inference.
""" """
......
...@@ -151,15 +151,15 @@ cd build/ ...@@ -151,15 +151,15 @@ cd build/
python程序运行结束后,会在当前目录生成YOLOV8静态推理检测结果可视化图像。 python程序运行结束后,会在当前目录生成YOLOV8静态推理检测结果可视化图像。
<img src="./Python/Result.jpg" alt="Result" style="zoom: 50%;" /> <img src="./Resource/Images/Result_python.jpg" alt="Result" style="zoom: 50%;" />
动态推理: 动态推理:
python程序运行结束后,会在当前目录生成YoloV8动态推理检测结果可视化图像。 python程序运行结束后,会在当前目录生成YoloV8动态推理检测结果可视化图像。
<img src="./Python/Result0.jpg" alt="Result_2" style="zoom: 50%;" /> <img src="./Resource/Images/Result0_python.jpg" alt="Result_2" style="zoom: 50%;" />
<img src="./Python/Result1.jpg" alt="Result1" style="zoom: 50%;" /> <img src="./Resource/Images/Result1_python.jpg" alt="Result1" style="zoom: 50%;" />
### C++版本 ### C++版本
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment