a-r-r-o-w HF Staff commited on
Commit
34576cd
·
verified ·
1 Parent(s): 38d8f12

Update README.md

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