Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix yolov8.cpp larger object boundingbox error #5641

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions examples/yolov8.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,21 @@ static void parse_yolov8_detections(
float w = *bboxes_ptr++;
float h = *bboxes_ptr;

if (i >= 6400 && i < 8000)
caoshihao996 marked this conversation as resolved.
Show resolved Hide resolved
{
x *= 2;
y *= 2;
w *= 2;
h *= 2;
}
else if (i >= 8000 && i < 8400)
caoshihao996 marked this conversation as resolved.
Show resolved Hide resolved
{
x *= 4;
y *= 4;
w *= 4;
h *= 4;
}

float x0 = clampf((x - 0.5f * w), 0.f, (float)infer_img_width);
float y0 = clampf((y - 0.5f * h), 0.f, (float)infer_img_height);
float x1 = clampf((x + 0.5f * w), 0.f, (float)infer_img_width);
Expand Down
Loading