diff --git a/dlclive/pose_estimation_pytorch/runner.py b/dlclive/pose_estimation_pytorch/runner.py index 11188f1..2c59605 100644 --- a/dlclive/pose_estimation_pytorch/runner.py +++ b/dlclive/pose_estimation_pytorch/runner.py @@ -191,9 +191,8 @@ def get_pose(self, frame: np.ndarray) -> np.ndarray: frame_batch, offsets_and_scales = self._prepare_top_down(tensor, detections) if len(frame_batch) == 0: - offsets_and_scales = [(0, 0), 1] - else: - tensor = frame_batch # still CHW, batched + offsets_and_scales = [(0, 0), 1] + tensor = frame_batch # still CHW, batched if self.dynamic is not None: tensor = self.dynamic.crop(tensor) @@ -356,7 +355,7 @@ def _prepare_top_down( frame_batch = torch.stack(crops, dim=0) else: crop_w, crop_h = self.top_down_config.crop_size - frame_batch = torch.zeros((0, 3, crop_h, crop_w), device=frame.device) + frame_batch = torch.zeros((1, 3, crop_h, crop_w), device=frame.device) offsets_and_scales = [(0, 0), 1] return frame_batch, offsets_and_scales