MCPcopy Create free account
hub / github.com/Francis-Rings/FlashPortrait / VideoReader_contextmanager

Function VideoReader_contextmanager

wan/data/utils.py:115–121  ·  view source on GitHub ↗
(*args, **kwargs)

Source from the content-addressed store, hash-verified

113
114@contextmanager
115def VideoReader_contextmanager(*args, **kwargs):
116 vr = VideoReader(*args, **kwargs)
117 try:
118 yield vr
119 finally:
120 del vr
121 gc.collect()
122
123def get_video_reader_batch(video_reader, batch_index):
124 frames = video_reader.get_batch(batch_index).asnumpy()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected