Skip to content

Commit d71840e

Browse files
authored
Refactor output matrix handling in arcface.cpp
Refactor output matrix creation and transpose logic.
1 parent 6f4b3a0 commit d71840e

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

examples/arcface.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -313,9 +313,14 @@ static DetectionResult parse_yolo_keypoints_results(ncnn::Mat& result,
313313
float iou_threshold,
314314
std::vector<std::string> class_names)
315315
{
316-
cv::Mat output0 = cv::Mat((int)result.h, (int)result.w, CV_32FC1, result);
317-
cv::Mat output;
318-
cv::transpose(output0, output);
316+
cv::Mat output((int)result.w, (int)result.h, CV_32FC1);
317+
for (int i = 0; i < output.cols; i++)
318+
{
319+
for (int j = 0; j < output.rows; j++)
320+
{
321+
output.ptr<float>(j)[i] = result.row(i)[j];
322+
}
323+
}
319324
std::vector<Bbox> detections;
320325
std::vector<std::vector<float> > all_keypoints;
321326

0 commit comments

Comments
 (0)