From fac27989b31568a6a874f2e0ee00a44361a503c5 Mon Sep 17 00:00:00 2001 From: Nikita Karaev Date: Fri, 5 Jan 2024 14:55:54 +0000 Subject: [PATCH] fixed a small online processing bug --- cotracker/predictor.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cotracker/predictor.py b/cotracker/predictor.py index 65875fe..575095b 100644 --- a/cotracker/predictor.py +++ b/cotracker/predictor.py @@ -201,6 +201,7 @@ class CoTrackerOnlinePredictor(torch.nn.Module): grid_query_frame: int = 0, add_support_grid=False, ): + B, T, C, H, W = video_chunk.shape # Initialize online video processing and save queried points # This needs to be done before processing *each new video* if is_first_step: @@ -231,7 +232,7 @@ class CoTrackerOnlinePredictor(torch.nn.Module): queries = torch.cat([queries, grid_pts], dim=1) self.queries = queries return (None, None) - B, T, C, H, W = video_chunk.shape + video_chunk = video_chunk.reshape(B * T, C, H, W) video_chunk = F.interpolate( video_chunk, tuple(self.interp_shape), mode="bilinear", align_corners=True