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

Class AutoShotDataset

benchmark/autoshot_dataset.py:5–31  ·  view source on GitHub ↗

The AutoShot Dataset (test splits) proposed by Zhu et al. in AutoShot: A Short Video Dataset and State-of-the-Art Shot Boundary Detection Link: https://openaccess.thecvf.com/content/CVPR2023W/NAS/html/Zhu_AutoShot_A_Short_Video_Dataset_and_State-of-the-Art_Shot_Boundary_Detection_CVPRW_2023

Source from the content-addressed store, hash-verified

3
4
5class AutoShotDataset:
6 """
7 The AutoShot Dataset (test splits) proposed by Zhu et al. in AutoShot: A Short Video Dataset and State-of-the-Art Shot Boundary Detection
8 Link: https://openaccess.thecvf.com/content/CVPR2023W/NAS/html/Zhu_AutoShot_A_Short_Video_Dataset_and_State-of-the-Art_Shot_Boundary_Detection_CVPRW_2023_paper.html
9 The original test set consists of 200 videos, but 36 videos are missing (AutoShot/videos/<video_id>.mp4).
10 The annotated scenes are provided in corresponding files (AutoShot/annotations/<video_id>.txt)
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, "annotations", "*.txt")))
19 ]
20 for video_file, scene_file in zip(self._video_files, self._scene_files, strict=True):
21 video_id = os.path.basename(video_file).split(".")[0]
22 scene_id = os.path.basename(scene_file).split(".")[0]
23 assert video_id == scene_id
24
25 def __getitem__(self, index):
26 video_file = self._video_files[index]
27 scene_file = self._scene_files[index]
28 return video_file, scene_file
29
30 def __len__(self):
31 return len(self._video_files)

Callers 1

__main__.pyFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected