Skip to content

Commit 9fa7403

Browse files
authored
fix pose_tracker python api will raise ValueError when result has no human (#1922)
1 parent 032ce75 commit 9fa7403

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

csrc/mmdeploy/apis/python/pose_tracker.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ std::vector<py::tuple> Apply(mmdeploy::PoseTracker* self,
3030
std::vector<py::tuple> batch_ret;
3131
batch_ret.reserve(frames.size());
3232
for (const auto& rs : results) {
33-
py::array_t<float> keypoints({static_cast<int>(rs.size()), rs[0].keypoint_count, 3});
33+
py::array_t<float> keypoints({static_cast<int>(rs.size()), rs.size() > 0 ? rs[0].keypoint_count : 0, 3});
3434
py::array_t<float> bboxes({static_cast<int>(rs.size()), 4});
3535
py::array_t<uint32_t> track_ids(static_cast<int>(rs.size()));
3636
auto kpts_ptr = keypoints.mutable_data();

0 commit comments

Comments
 (0)