MCPcopy Create free account
hub / github.com/dcharatan/flowmap / split_videos

Function split_videos

flowmap/flow/common.py:6–20  ·  view source on GitHub ↗
(
    videos: Float[Tensor, "batch frame 3 height width"],
)

Source from the content-addressed store, hash-verified

4
5
6def split_videos(
7 videos: Float[Tensor, "batch frame 3 height width"],
8) -> tuple[
9 Float[Tensor, "batch*(frame-1) 3 height width"], # source (flattened batch dims)
10 Float[Tensor, "batch*(frame-1) 3 height width"], # target (flattened batch dims)
11 int, # batch
12 int, # frame
13]:
14 b, f, _, _, _ = videos.shape
15 return (
16 rearrange(videos[:, :-1], "b f c h w -> (b f) c h w"),
17 rearrange(videos[:, 1:], "b f c h w -> (b f) c h w"),
18 b,
19 f,
20 )

Callers 3

forwardMethod · 0.85
forwardMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected