(
videos: Float[Tensor, "batch frame 3 height width"],
)
| 4 | |
| 5 | |
| 6 | def 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 | ) |
no outgoing calls
no test coverage detected