MCPcopy Create free account
hub / github.com/OpenImagingLab/FlashVSR / tensor2video

Function tensor2video

examples/WanVSR/infer_flashvsr_tiny.py:16–20  ·  view source on GitHub ↗
(frames)

Source from the content-addressed store, hash-verified

14from utils.TCDecoder import build_tcdecoder
15
16def tensor2video(frames):
17 frames = rearrange(frames, "C T H W -> T H W C")
18 frames = ((frames.float() + 1) * 127.5).clip(0, 255).cpu().numpy().astype(np.uint8)
19 frames = [Image.fromarray(frame) for frame in frames]
20 return frames
21
22def natural_key(name: str):
23 return [int(t) if t.isdigit() else t.lower() for t in re.split(r'([0-9]+)', os.path.basename(name))]

Callers 1

mainFunction · 0.70

Calls 1

cpuMethod · 0.80

Tested by

no test coverage detected