MCPcopy Create free account
hub / github.com/Breakthrough/PySceneDetect / __init__

Method __init__

benchmark/bbc_dataset.py:13–24  ·  view source on GitHub ↗
(self, dataset_dir: str)

Source from the content-addressed store, hash-verified

11 """
12
13 def __init__(self, dataset_dir: str):
14 self._video_files = [
15 file for file in sorted(glob.glob(os.path.join(dataset_dir, "videos", "*.mp4")))
16 ]
17 self._scene_files = [
18 file for file in sorted(glob.glob(os.path.join(dataset_dir, "fixed", "*.txt")))
19 ]
20 assert len(self._video_files) == len(self._scene_files)
21 for video_file, scene_file in zip(self._video_files, self._scene_files, strict=True):
22 video_id = os.path.basename(video_file).replace("bbc_", "").split(".")[0]
23 scene_id = os.path.basename(scene_file).split("-")[0]
24 assert video_id == scene_id
25
26 def __getitem__(self, index):
27 video_file = self._video_files[index]

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected