MCPcopy Create free account
hub / github.com/ModelTC/LightX2V / __init__

Method __init__

lightx2v/shot_runner/utils.py:14–21  ·  view source on GitHub ↗
(self, samples: torch.Tensor, frame_len: int, sr=16000, fps=16)

Source from the content-addressed store, hash-verified

12
13class SlidingWindowReader:
14 def __init__(self, samples: torch.Tensor, frame_len: int, sr=16000, fps=16):
15 assert isinstance(samples, torch.Tensor)
16 assert samples.dim() == 1, "samples 必须是 1D Tensor"
17
18 self.samples = samples
19 self.frame_len = frame_len # 单位:视频帧
20 self.audio_per_frame = sr // fps # samples / frame
21 self.pos = 0 # 单位:视频帧
22
23 def next_frame(self, overlap: int):
24 assert 0 <= overlap < self.frame_len

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected