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 output format for PPYOLOE #50

Merged
merged 3 commits into from
Jul 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
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
6 changes: 2 additions & 4 deletions csrcs/fastdeploy/vision/ppdet/ppyoloe.cc
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,7 @@ bool PPYOLOE::Postprocess(std::vector<FDTensor>& infer_result,
result->scores.push_back(nms.out_box_data[i * 6 + 1]);
result->boxes.emplace_back(std::array<float, 4>{
nms.out_box_data[i * 6 + 2], nms.out_box_data[i * 6 + 3],
nms.out_box_data[i * 6 + 4] - nms.out_box_data[i * 6 + 2],
nms.out_box_data[i * 6 + 5] - nms.out_box_data[i * 6 + 3]});
nms.out_box_data[i * 6 + 4], nms.out_box_data[i * 6 + 5]});
}
} else {
int box_num = 0;
Expand All @@ -197,8 +196,7 @@ bool PPYOLOE::Postprocess(std::vector<FDTensor>& infer_result,
result->scores.push_back(box_data[i * 6 + 1]);
result->boxes.emplace_back(
std::array<float, 4>{box_data[i * 6 + 2], box_data[i * 6 + 3],
box_data[i * 6 + 4] - box_data[i * 6 + 2],
box_data[i * 6 + 5] - box_data[i * 6 + 3]});
box_data[i * 6 + 4], box_data[i * 6 + 5]});
}
}
return true;
Expand Down
2 changes: 1 addition & 1 deletion model_zoo/vision/ppyoloe/ppyoloe.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

# 预测图片
im = cv2.imread("000000014439_640x640.jpg")
result = model.predict(im, conf_threshold=0.5)
result = model.predict(im)

# 可视化结果
fd.vision.visualize.vis_detection(im, result)
Expand Down