Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
lvhan028 committed Jul 25, 2022
1 parent 7cdbfa7 commit 7b6dcf9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions csrc/mmdeploy/apis/python/detector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ static void register_python_detector(py::module &m) {
.def(py::init([](const char *model_path, const char *device_name, int device_id) {
return std::make_unique<PyDetector>(model_path, device_name, device_id);
}),
py::arg("model_path"), py::arg("device_name"), py::arg("device_id")=0)
py::arg("model_path"), py::arg("device_name"), py::arg("device_id") = 0)
.def("__call__",
[](PyDetector* self, const PyImage& img) -> py::tuple {
[](PyDetector *self, const PyImage &img) -> py::tuple {
return self->Apply(std::vector{img})[0];
})
.def("batch", &PyDetector::Apply);
Expand Down
10 changes: 6 additions & 4 deletions csrc/mmdeploy/apis/python/pose_detector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,20 +103,22 @@ static void register_python_pose_detector(py::module &m) {
.def(py::init([](const char *model_path, const char *device_name, int device_id) {
return std::make_unique<PyPoseDetector>(model_path, device_name, device_id);
}),
py::arg("model_path"), py::arg("device_name"), py::arg("device_id")=0)
py::arg("model_path"), py::arg("device_name"), py::arg("device_id") = 0)
.def("__call__",
[](PyPoseDetector *self, const PyImage &img) -> py::array {
return self->Apply({img}, {})[0];
})
.def("__call__",
.def(
"__call__",
[](PyPoseDetector *self, const PyImage &img, const Rect &box) -> py::array {
std::vector<std::vector<Rect>> bboxes;
bboxes.push_back({box});
return self->Apply({img}, bboxes)[0];
},
py::arg("img"), py::arg("box"))
.def("__call__",
[](PyPoseDetector *self, const PyImage &img, const std::vector<Rect> &bboxes){
.def(
"__call__",
[](PyPoseDetector *self, const PyImage &img, const std::vector<Rect> &bboxes) {
std::vector<std::vector<Rect>> _bboxes;
_bboxes.push_back(bboxes);
return self->Apply({img}, _bboxes);
Expand Down

0 comments on commit 7b6dcf9

Please sign in to comment.