Args: clip (torch.tensor): Video clip to be cropped. Size is (T, C, H, W)
(clip, i, j, h, w)
| 46 | |
| 47 | |
| 48 | def crop(clip, i, j, h, w): |
| 49 | """ |
| 50 | Args: |
| 51 | clip (torch.tensor): Video clip to be cropped. Size is (T, C, H, W) |
| 52 | """ |
| 53 | if len(clip.size()) != 4: |
| 54 | raise ValueError("clip should be a 4D tensor") |
| 55 | return clip[..., i : i + h, j : j + w] |
| 56 | |
| 57 | |
| 58 | def resize(clip, target_size, interpolation_mode): |
no outgoing calls
no test coverage detected