MCPcopy Create free account
hub / github.com/modelscope/modelscope / video_open

Method video_open

modelscope/preprocessors/multi_modal.py:577–582  ·  view source on GitHub ↗
(self, path: str)

Source from the content-addressed store, hash-verified

575 return self._num_frames
576
577 def video_open(self, path: str) -> Tuple[decord.VideoReader, int]:
578 if path not in self._video_map:
579 index = len(self._video_map)
580 vr = decord.VideoReader(path, ctx=decord.cpu(0))
581 self._video_map[path] = (vr, index)
582 return self._video_map[path]
583
584 def sample_frames(self, num_frames: int, vlen: int) -> List[int]:
585 acc_samples = min(num_frames, vlen)

Callers 1

__call__Method · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected