Skip to content

Commit

Permalink
fix pose_tracker python api will raise ValueError when result has no …
Browse files Browse the repository at this point in the history
…human (#1922)
  • Loading branch information
tongda committed Mar 27, 2023
1 parent 032ce75 commit 9fa7403
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion csrc/mmdeploy/apis/python/pose_tracker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ std::vector<py::tuple> Apply(mmdeploy::PoseTracker* self,
std::vector<py::tuple> batch_ret;
batch_ret.reserve(frames.size());
for (const auto& rs : results) {
py::array_t<float> keypoints({static_cast<int>(rs.size()), rs[0].keypoint_count, 3});
py::array_t<float> keypoints({static_cast<int>(rs.size()), rs.size() > 0 ? rs[0].keypoint_count : 0, 3});
py::array_t<float> bboxes({static_cast<int>(rs.size()), 4});
py::array_t<uint32_t> track_ids(static_cast<int>(rs.size()));
auto kpts_ptr = keypoints.mutable_data();
Expand Down

0 comments on commit 9fa7403

Please sign in to comment.