Skip to content

Commit

Permalink
modify index
Browse files Browse the repository at this point in the history
  • Loading branch information
ZHEQIUSHUI committed Dec 20, 2023
1 parent 496f123 commit 11633d3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions examples/ax650/ax_yolov5s_seg_steps.cc
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ namespace ax
std::vector<detection::Object> 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)
Expand All @@ -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);

Expand Down
4 changes: 2 additions & 2 deletions examples/ax650/ax_yolov8s_pose_native_steps.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
6 changes: 3 additions & 3 deletions examples/base/detection.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 11633d3

Please sign in to comment.