MCPcopy Create free account
hub / github.com/OpenDriveLab/ReSim / pick_video_frame

Function pick_video_frame

sat/sgm/modules/autoencoding/magvit2_pytorch.py:106–113  ·  view source on GitHub ↗
(video, frame_indices)

Source from the content-addressed store, hash-verified

104
105
106def pick_video_frame(video, frame_indices):
107 batch, device = video.shape[0], video.device
108 video = rearrange(video, "b c f ... -> b f c ...")
109 batch_indices = torch.arange(batch, device=device)
110 batch_indices = rearrange(batch_indices, "b -> b 1")
111 images = video[batch_indices, frame_indices]
112 images = rearrange(images, "b 1 c ... -> b c ...")
113 return images
114
115
116# gan related

Callers 1

forwardMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected