From 11633d312ec07fb736a1e0e2b18c41c6a8a6033d Mon Sep 17 00:00:00 2001 From: ZHEQIUSHUI Date: Wed, 20 Dec 2023 14:36:22 +0800 Subject: [PATCH] modify index --- examples/ax650/ax_yolov5s_seg_steps.cc | 6 +++--- examples/ax650/ax_yolov8s_pose_native_steps.cc | 4 ++-- examples/base/detection.hpp | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/examples/ax650/ax_yolov5s_seg_steps.cc b/examples/ax650/ax_yolov5s_seg_steps.cc index 2e8d480..e1b9bb9 100644 --- a/examples/ax650/ax_yolov5s_seg_steps.cc +++ b/examples/ax650/ax_yolov5s_seg_steps.cc @@ -65,7 +65,7 @@ namespace ax std::vector objects; float prob_threshold_u_sigmoid = -1.0f * (float)std::log((1.0f / PROB_THRESHOLD) - 1.0f); timer timer_postprocess; - float* output_ptr[3] = {(float*)io_data->pOutputs[0].pVirAddr, + float* output_ptr[3] = {(float*)io_data->pOutputs[1].pVirAddr, (float*)io_data->pOutputs[2].pVirAddr, (float*)io_data->pOutputs[3].pVirAddr}; for (uint32_t i = 0; i < 3; ++i) @@ -75,8 +75,8 @@ namespace ax detection::generate_proposals_yolov5_seg(stride, ptr, PROB_THRESHOLD, proposals, input_w, input_h, ANCHORS, prob_threshold_u_sigmoid); } - auto& output = io_info->pOutputs[1]; - auto& info = io_data->pOutputs[1]; + auto& output = io_info->pOutputs[0]; + auto& info = io_data->pOutputs[0]; auto ptr = (float*)info.pVirAddr; detection::get_out_bbox_mask(proposals, objects, ptr, DEFAULT_MASK_PROTO_DIM, DEFAULT_MASK_SAMPLE_STRIDE, NMS_THRESHOLD, input_h, input_w, mat.rows, mat.cols); diff --git a/examples/ax650/ax_yolov8s_pose_native_steps.cc b/examples/ax650/ax_yolov8s_pose_native_steps.cc index c0d99ab..8c7e50e 100644 --- a/examples/ax650/ax_yolov8s_pose_native_steps.cc +++ b/examples/ax650/ax_yolov8s_pose_native_steps.cc @@ -61,8 +61,8 @@ namespace ax timer timer_postprocess; for (int i = 0; i < 3; ++i) { - auto feat_ptr = (float*)io_data->pOutputs[2 * i + 1].pVirAddr; - auto feat_kps_ptr = (float*)io_data->pOutputs[2 * i].pVirAddr; + auto feat_ptr = (float*)io_data->pOutputs[i + 3].pVirAddr; + auto feat_kps_ptr = (float*)io_data->pOutputs[i].pVirAddr; int32_t stride = (1 << i) * 8; detection::generate_proposals_yolov8_pose_native(stride, feat_ptr, feat_kps_ptr, PROB_THRESHOLD, proposals, input_w, input_h, NUM_POINT, NUM_CLASS); } diff --git a/examples/base/detection.hpp b/examples/base/detection.hpp index 3d6c58e..05ff11c 100644 --- a/examples/base/detection.hpp +++ b/examples/base/detection.hpp @@ -1329,7 +1329,7 @@ namespace detection // process cls score int class_index = 0; float class_score = -FLT_MAX; - for (int s = 0; s <= cls_num - 1; s++) + for (int s = 0; s < cls_num; s++) { float score = feat_ptr[s + 4 * reg_max]; if (score > class_score) @@ -1395,7 +1395,7 @@ namespace detection // process cls score int class_index = 0; float class_score = -FLT_MAX; - for (int s = 0; s <= cls_num - 1; s++) + for (int s = 0; s < cls_num ; s++) { float score = feat_ptr[s + 4 * reg_max]; if (score > class_score) @@ -1465,7 +1465,7 @@ namespace detection // process cls score int class_index = 0; float class_score = -FLT_MAX; - for (int s = 0; s <= cls_num - 1; s++) + for (int s = 0; s < cls_num; s++) { float score = feat_ptr[s + 4 * reg_max]; if (score > class_score)