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

Function tensor2video

examples/WanVSR/infer_flashvsr_full.py:15–19  ·  view source on GitHub ↗
(frames: torch.Tensor)

Source from the content-addressed store, hash-verified

13from utils.utils import Buffer_LQ4x_Proj
14
15def tensor2video(frames: torch.Tensor):
16 frames = rearrange(frames, "C T H W -> T H W C")
17 frames = ((frames.float() + 1) * 127.5).clip(0, 255).cpu().numpy().astype(np.uint8)
18 frames = [Image.fromarray(frame) for frame in frames]
19 return frames
20
21def natural_key(name: str):
22 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