MCPcopy Create free account
hub / github.com/CompVis/zigma / crop

Function crop

datasets/video_utils.py:48–55  ·  view source on GitHub ↗

Args: clip (torch.tensor): Video clip to be cropped. Size is (T, C, H, W)

(clip, i, j, h, w)

Source from the content-addressed store, hash-verified

46
47
48def 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
58def resize(clip, target_size, interpolation_mode):

Callers 5

resized_cropFunction · 0.85
center_cropFunction · 0.85
random_shift_cropFunction · 0.85
__call__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected