def test_short_side_scale_equal_size_pytorch(self): video = thwc_to_cthw(create_dummy_video_frames( 20, 10, 10)).to(dtype=torch.float32) actual = short_side_scale(video, 10, backend="pytorch") self.assertEqual(actual.shape, (3, 20, 10, 10))
def test_short_side_scale_height_shorter_opencv(self): video = thwc_to_cthw(create_dummy_video_frames( 20, 10, 20)).to(dtype=torch.float32) actual = short_side_scale(video, 5, backend="opencv") self.assertEqual(actual.shape, (3, 20, 5, 10))
def func_to_benchmark() -> None: _ = short_side_scale(x, kwargs["dst_short_size"]) return