Skip to content

Commit 46d09fe

Browse files
committed
Update get_status_info: check keypoints and scores contain same num_frames
1 parent ca88644 commit 46d09fe

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

fmpose3d/inference_api/fmpose3d.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -634,13 +634,12 @@ def status_message(self) -> str:
634634

635635
def get_status_info(self) -> tuple[ResultStatus, str]:
636636
"""Prediction status derived from ``valid_frames_mask``."""
637-
# Derive expected frame count from canonical shapes.
638-
if self.keypoints.ndim == 4:
639-
num_frames = int(self.keypoints.shape[1])
640-
elif self.scores.ndim == 3:
641-
num_frames = int(self.scores.shape[1])
642-
else:
637+
# Validate canonical shapes and frame-count consistency.
638+
if self.keypoints.ndim != 4 or self.scores.ndim != 3:
643639
return ResultStatus.INVALID, "Incorrect 2D pose keypoints/scores dimensions."
640+
if self.keypoints.shape[1] != self.scores.shape[1]:
641+
return ResultStatus.INVALID, "2D pose keypoints/scores frame counts do not match."
642+
num_frames = int(self.keypoints.shape[1])
644643

645644
if self.valid_frames_mask is None:
646645
return ResultStatus.UNKNOWN, "No frame-validity mask provided by the 2D pose."

0 commit comments

Comments
 (0)