a-r-r-o-w HF Staff commited on
Commit
bb08075
·
verified ·
1 Parent(s): 21b3dab

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +89 -1
README.md CHANGED
@@ -42,4 +42,92 @@ dataset_info:
42
 
43
  Combination of part_id's from [bigdata-pw/OpenVid-1M](https://huggingface.co/datasets/bigdata-pw/OpenVid-1M) and video data from [nkp37/OpenVid-1M](https://huggingface.co/datasets/nkp37/OpenVid-1M).
44
 
45
- This is a 10k video split of the original dataset for faster iteration during testing. The split was obtained by filtering on aesthetic and motion scores by iteratively increasing their values until there were at most 1000 videos. Only videos containing between 80 and 240 frames were considered.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
42
 
43
  Combination of part_id's from [bigdata-pw/OpenVid-1M](https://huggingface.co/datasets/bigdata-pw/OpenVid-1M) and video data from [nkp37/OpenVid-1M](https://huggingface.co/datasets/nkp37/OpenVid-1M).
44
 
45
+ This is a 10k video split of the original dataset for faster iteration during testing. The split was obtained by filtering on aesthetic and motion scores by iteratively increasing their values until there were at most 1000 videos. Only videos containing between 80 and 240 frames were considered.
46
+
47
+ ```python
48
+ from datasets import load_dataset, disable_caching, DownloadMode
49
+ from torchcodec.decoders import VideoDecoder
50
+
51
+ # disable_caching()
52
+
53
+ def decode_float(sample):
54
+ return float(sample.decode("utf-8"))
55
+
56
+ def decode_int(sample):
57
+ return int(sample.decode("utf-8"))
58
+
59
+ def decode_str(sample):
60
+ return sample.decode("utf-8")
61
+
62
+ def decode_video(sample):
63
+ decoder = VideoDecoder(sample)
64
+ return decoder[:1024]
65
+
66
+ def decode_batch(batch):
67
+ decoded_sample = {
68
+ "__key__": batch["__key__"],
69
+ "__url__": batch["__url__"],
70
+ "video": list(map(decode_video, batch["video"])),
71
+ "caption": list(map(decode_str, batch["caption"])),
72
+ "aesthetic_score": list(map(decode_float, batch["aesthetic_score"])),
73
+ "motion_score": list(map(decode_float, batch["motion_score"])),
74
+ "temporal_consistency_score": list(map(decode_float, batch["temporal_consistency_score"])),
75
+ "camera_motion": list(map(decode_str, batch["camera_motion"])),
76
+ "frame": list(map(decode_int, batch["frame"])),
77
+ "fps": list(map(decode_float, batch["fps"])),
78
+ "seconds": list(map(decode_float, batch["seconds"])),
79
+ "part_id": list(map(decode_int, batch["part_id"])),
80
+ }
81
+ return decoded_sample
82
+
83
+ ds = load_dataset("finetrainers/OpenVid-10k-split", split="train", download_mode=DownloadMode.REUSE_DATASET_IF_EXISTS)
84
+ ds.set_transform(decode_batch)
85
+ iterator = iter(ds)
86
+
87
+ for i in range(10):
88
+ data = next(iterator)
89
+ breakpoint()
90
+ ```
91
+
92
+ Environment tested:
93
+
94
+ ```
95
+ - huggingface_hub version: 0.25.2
96
+ - Platform: macOS-15.3.1-arm64-arm-64bit
97
+ - Python version: 3.11.10
98
+ - Running in iPython ?: No
99
+ - Running in notebook ?: No
100
+ - Running in Google Colab ?: No
101
+ - Running in Google Colab Enterprise ?: No
102
+ - Token path ?: /Users/aryanvs/Desktop/huggingface/token
103
+ - Has saved token ?: True
104
+ - Who am I ?: a-r-r-o-w
105
+ - Configured git credential helpers: osxkeychain
106
+ - FastAI: N/A
107
+ - Tensorflow: N/A
108
+ - Torch: 2.6.0
109
+ - Jinja2: 3.1.4
110
+ - Graphviz: N/A
111
+ - keras: N/A
112
+ - Pydot: N/A
113
+ - Pillow: 10.4.0
114
+ - hf_transfer: 0.1.8
115
+ - gradio: 5.6.0
116
+ - tensorboard: N/A
117
+ - numpy: 1.26.4
118
+ - pydantic: 2.10.1
119
+ - aiohttp: 3.10.10
120
+ - ENDPOINT: https://huggingface.co
121
+ - HF_HUB_CACHE: /Users/aryanvs/Desktop/huggingface/hub
122
+ - HF_ASSETS_CACHE: /Users/aryanvs/Desktop/huggingface/assets
123
+ - HF_TOKEN_PATH: /Users/aryanvs/Desktop/huggingface/token
124
+ - HF_HUB_OFFLINE: False
125
+ - HF_HUB_DISABLE_TELEMETRY: False
126
+ - HF_HUB_DISABLE_PROGRESS_BARS: None
127
+ - HF_HUB_DISABLE_SYMLINKS_WARNING: False
128
+ - HF_HUB_DISABLE_EXPERIMENTAL_WARNING: False
129
+ - HF_HUB_DISABLE_IMPLICIT_TOKEN: False
130
+ - HF_HUB_ENABLE_HF_TRANSFER: True
131
+ - HF_HUB_ETAG_TIMEOUT: 10
132
+ - HF_HUB_DOWNLOAD_TIMEOUT: 10
133
+ ```