Skip to content

Commit

Permalink
返回结果中增加:方向分类cls相关参数 (#139)
Browse files Browse the repository at this point in the history
  • Loading branch information
hiroi-sora committed Jul 9, 2024
1 parent 26d7c80 commit 6531f66
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cpp/src/task.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,13 @@ namespace PaddleOCR
{
j["box"] = {{b[0][0], b[0][1]}, {b[1][0], b[1][1]}, {b[2][0], b[2][1]}, {b[3][0], b[3][1]}};
}
// 如果启用了cls,则cls_label有实际值,那么写入方向分类相关参数
if (ocr_result[i].cls_label != -1)
{
j["cls_label"] = ocr_result[i].cls_label; // 方向标签,0表示顺时针0°或90°,1表示180°或270°
j["cls_score"] = ocr_result[i].cls_score; // 方向标签置信度,越接近1越可信
}

outJ["data"].push_back(j);
isEmpty = false;
}
Expand Down

0 comments on commit 6531f66

Please sign in to comment.