[Hackthon_4th 177] Support PP-YOLOE-R with BM1684 (#1809)

* first draft

* add robx iou

* add benchmark for ppyoloe_r

* remove trash code

* fix bugs

* add pybind nms rotated option

* add missing head file

* fix bug

* fix bug2

* fix shape bug

---------

Co-authored-by: DefTruth <31974251+DefTruth@users.noreply.github.com>
This commit is contained in:
thunder95
2023-04-21 10:48:05 +08:00
committed by GitHub
parent f3d44785c4
commit 51be3fea78
31 changed files with 1389 additions and 6 deletions

View File

@@ -84,13 +84,14 @@ void BindVision(pybind11::module& m) {
.def(pybind11::init())
.def_readwrite("boxes", &vision::DetectionResult::boxes)
.def_readwrite("scores", &vision::DetectionResult::scores)
.def_readwrite("rotated_boxes", &vision::DetectionResult::rotated_boxes)
.def_readwrite("label_ids", &vision::DetectionResult::label_ids)
.def_readwrite("masks", &vision::DetectionResult::masks)
.def_readwrite("contain_masks", &vision::DetectionResult::contain_masks)
.def(pybind11::pickle(
[](const vision::DetectionResult& d) {
return pybind11::make_tuple(d.boxes, d.scores, d.label_ids, d.masks,
d.contain_masks);
return pybind11::make_tuple(d.boxes, d.scores, d.rotated_boxes,
d.label_ids, d.masks, d.contain_masks);
},
[](pybind11::tuple t) {
if (t.size() != 5)
@@ -99,6 +100,7 @@ void BindVision(pybind11::module& m) {
vision::DetectionResult d;
d.boxes = t[0].cast<std::vector<std::array<float, 4>>>();
d.rotated_boxes = t[0].cast<std::vector<std::array<float, 8>>>();
d.scores = t[1].cast<std::vector<float>>();
d.label_ids = t[2].cast<std::vector<int32_t>>();
d.masks = t[3].cast<std::vector<vision::Mask>>();