aps commited on
Commit
bc05460
1 Parent(s): a4a96fc

Fix some of the issues and update readme

Browse files
Files changed (3) hide show
  1. README.md +212 -42
  2. dataset_infos.json +1 -0
  3. something_something_v2.py +17 -17
README.md CHANGED
@@ -50,11 +50,11 @@ task_ids:
50
 
51
  ## Dataset Description
52
 
53
- - **Homepage:** https://prior.allenai.org/projects/charades
54
- - **Repository:** https://github.com/gsig/charades-algorithms
55
- - **Paper:** https://arxiv.org/abs/1604.01753
56
- - **Leaderboard:** https://paperswithcode.com/sota/action-classification-on-charades
57
- - **Point of Contact:** mailto: vision.amt@allenai.org
58
 
59
  ### Dataset Summary
60
 
@@ -62,7 +62,7 @@ The Something-Something dataset (version 2) is a collection of 220,847 labeled v
62
 
63
  ### Supported Tasks and Leaderboards
64
 
65
- - `action-classification`: The goal of this task is to classify actions happening in a video. This is a multilabel classification. The leaderboard is available [here](https://paperswithcode.com/sota/action-classification-on-charades)
66
 
67
 
68
  ### Languages
@@ -75,47 +75,200 @@ The annotations in the dataset are in English.
75
 
76
  ```
77
  {
78
- "video_id": "46GP8",
79
- "video": "/home/amanpreet_huggingface_co/.cache/huggingface/datasets/downloads/extracted/3f022da5305aaa189f09476dbf7d5e02f6fe12766b927c076707360d00deb44d/46GP8.mp4",
80
- "subject": "HR43",
81
- "scene": "Kitchen",
82
- "quality": 6,
83
- "relevance": 7,
84
- "verified": "Yes",
85
- "script": "A person cooking on a stove while watching something out a window.",
86
- "objects": ["food", "stove", "window"],
87
- "descriptions": [
88
- "A person cooks food on a stove before looking out of a window."
89
- ],
90
- "labels": [92, 147],
91
- "action_timings": [
92
- [11.899999618530273, 21.200000762939453],
93
- [0.0, 12.600000381469727]
94
- ],
95
- "length": 24.829999923706055
96
  }
97
  ```
98
 
99
  ### Data Fields
100
 
101
  - `video_id`: `str` Unique identifier for each video.
102
- - `video`: `str` Path to the video file
103
- - `subject`: `str` Unique identifier for each subject in the dataset
104
- - `scene`: `str` One of 15 indoor scenes in the dataset, such as Kitchen
105
- - `quality`: `int` The quality of the video judged by an annotator (7-point scale, 7=high quality), -100 if missing
106
- - `relevance`: `int` The relevance of the video to the script judged by an annotated (7-point scale, 7=very relevant), -100 if missing
107
- - `verified`: `str` 'Yes' if an annotator successfully verified that the video matches the script, else 'No'
108
- - `script`: `str` The human-generated script used to generate the video
109
- - `descriptions`: `List[str]` List of descriptions by annotators watching the video
110
- - `labels`: `List[int]` Multi-label actions found in the video. Indices from 0 to 156.
111
- - `action_timings`: `List[Tuple[int, int]]` Timing where each of the above actions happened.
112
- - `length`: `float` The length of the video in seconds
113
 
114
  <details>
115
  <summary>
116
- Click here to see the full list of ImageNet class labels mapping:
117
  </summary>
118
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
119
  </details>
120
 
121
  ### Data Splits
@@ -123,39 +276,54 @@ The annotations in the dataset are in English.
123
 
124
  | |train |validation| test |
125
  |-------------|------:|---------:|------:|
126
- |# of examples|1281167|50000 |100000 |
127
 
128
 
129
  ## Dataset Creation
130
 
131
  ### Curation Rationale
132
 
 
 
 
 
 
 
 
 
 
 
133
 
134
 
135
  ### Source Data
136
 
137
  #### Initial Data Collection and Normalization
138
-
 
 
 
139
 
140
  #### Who are the source language producers?
141
 
 
142
 
143
  ### Annotations
144
 
145
  #### Annotation process
146
 
 
147
 
148
  #### Who are the annotators?
149
-
150
 
151
  ### Personal and Sensitive Information
152
-
153
 
154
  ## Considerations for Using the Data
155
 
156
  ### Social Impact of Dataset
157
 
158
- [More Information Needed]
159
 
160
  ### Discussion of Biases
161
 
@@ -172,6 +340,8 @@ The annotations in the dataset are in English.
172
 
173
  ### Licensing Information
174
 
 
 
175
  ### Citation Information
176
 
177
  ```bibtex
 
50
 
51
  ## Dataset Description
52
 
53
+ - **Homepage:** https://developer.qualcomm.com/software/ai-datasets/something-something
54
+ - **Repository:**
55
+ - **Paper:** https://arxiv.org/abs/1706.04261
56
+ - **Leaderboard:** https://paperswithcode.com/sota/action-recognition-in-videos-on-something
57
+ - **Point of Contact:** mailto: research.datasets@qti.qualcomm.com
58
 
59
  ### Dataset Summary
60
 
 
62
 
63
  ### Supported Tasks and Leaderboards
64
 
65
+ - `action-recognition`: The goal of this task is to classify actions happening in a video. This is a multilabel classification. The leaderboard is available [here](https://paperswithcode.com/sota/action-recognition-in-videos-on-something)
66
 
67
 
68
  ### Languages
 
75
 
76
  ```
77
  {
78
+ "video_id": "41775",
79
+ "video": "<ExFileObject name="">",
80
+ "text": "moving drawer of night stand",
81
+ "label": 33,
82
+ "placeholders": ["drawer", "night stand"]}
 
 
 
 
 
 
 
 
 
 
 
 
 
83
  }
84
  ```
85
 
86
  ### Data Fields
87
 
88
  - `video_id`: `str` Unique identifier for each video.
89
+ - `video`: `str` File object
90
+ - `placeholders`: `List[str]` Objects present in the video
91
+ - `text`: `str` Description of what is happening in the video
92
+ - `labels`: `int` Action found in the video. Indices from 0 to 173.
 
 
 
 
 
 
 
93
 
94
  <details>
95
  <summary>
96
+ Click here to see the full list of Something-Something-v2 class labels mapping:
97
  </summary>
98
+ |0 | Approaching something with your camera |
99
+ |1 | Attaching something to something |
100
+ |2 | Bending something so that it deforms |
101
+ |3 | Bending something until it breaks |
102
+ |4 | Burying something in something |
103
+ |5 | Closing something |
104
+ |6 | Covering something with something |
105
+ |7 | Digging something out of something |
106
+ |8 | Dropping something behind something |
107
+ |9 | Dropping something in front of something |
108
+ |10 | Dropping something into something |
109
+ |11 | Dropping something next to something |
110
+ |12 | Dropping something onto something |
111
+ |13 | Failing to put something into something because something does not fit |
112
+ |14 | Folding something |
113
+ |15 | Hitting something with something |
114
+ |16 | Holding something |
115
+ |17 | Holding something behind something |
116
+ |18 | Holding something in front of something |
117
+ |19 | Holding something next to something |
118
+ |20 | Holding something over something |
119
+ |21 | Laying something on the table on its side, not upright |
120
+ |22 | Letting something roll along a flat surface |
121
+ |23 | Letting something roll down a slanted surface |
122
+ |24 | Letting something roll up a slanted surface, so it rolls back down |
123
+ |25 | Lifting a surface with something on it but not enough for it to slide down |
124
+ |26 | Lifting a surface with something on it until it starts sliding down |
125
+ |27 | Lifting something up completely without letting it drop down |
126
+ |28 | Lifting something up completely, then letting it drop down |
127
+ |29 | Lifting something with something on it |
128
+ |30 | Lifting up one end of something without letting it drop down |
129
+ |31 | Lifting up one end of something, then letting it drop down |
130
+ |32 | Moving away from something with your camera |
131
+ |33 | Moving part of something |
132
+ |34 | Moving something across a surface until it falls down |
133
+ |35 | Moving something across a surface without it falling down |
134
+ |36 | Moving something and something away from each other |
135
+ |37 | Moving something and something closer to each other |
136
+ |38 | Moving something and something so they collide with each other |
137
+ |39 | Moving something and something so they pass each other |
138
+ |40 | Moving something away from something |
139
+ |41 | Moving something away from the camera |
140
+ |42 | Moving something closer to something |
141
+ |43 | Moving something down |
142
+ |44 | Moving something towards the camera |
143
+ |45 | Moving something up |
144
+ |46 | Opening something |
145
+ |47 | Picking something up |
146
+ |48 | Piling something up |
147
+ |49 | Plugging something into something |
148
+ |50 | Plugging something into something but pulling it right out as you remove your hand |
149
+ |51 | Poking a hole into some substance |
150
+ |52 | Poking a hole into something soft |
151
+ |53 | Poking a stack of something so the stack collapses |
152
+ |54 | Poking a stack of something without the stack collapsing |
153
+ |55 | Poking something so it slightly moves |
154
+ |56 | Poking something so lightly that it doesn't or almost doesn't move |
155
+ |57 | Poking something so that it falls over |
156
+ |58 | Poking something so that it spins around |
157
+ |59 | Pouring something into something |
158
+ |60 | Pouring something into something until it overflows |
159
+ |61 | Pouring something onto something |
160
+ |62 | Pouring something out of something |
161
+ |63 | Pretending or failing to wipe something off of something |
162
+ |64 | Pretending or trying and failing to twist something |
163
+ |65 | Pretending to be tearing something that is not tearable |
164
+ |66 | Pretending to close something without actually closing it |
165
+ |67 | Pretending to open something without actually opening it |
166
+ |68 | Pretending to pick something up |
167
+ |69 | Pretending to poke something |
168
+ |70 | Pretending to pour something out of something, but something is empty |
169
+ |71 | Pretending to put something behind something |
170
+ |72 | Pretending to put something into something |
171
+ |73 | Pretending to put something next to something |
172
+ |74 | Pretending to put something on a surface |
173
+ |75 | Pretending to put something onto something |
174
+ |76 | Pretending to put something underneath something |
175
+ |77 | Pretending to scoop something up with something |
176
+ |78 | Pretending to spread air onto something |
177
+ |79 | Pretending to sprinkle air onto something |
178
+ |80 | Pretending to squeeze something |
179
+ |81 | Pretending to take something from somewhere |
180
+ |82 | Pretending to take something out of something |
181
+ |83 | Pretending to throw something |
182
+ |84 | Pretending to turn something upside down |
183
+ |85 | Pulling something from behind of something |
184
+ |86 | Pulling something from left to right |
185
+ |87 | Pulling something from right to left |
186
+ |88 | Pulling something onto something |
187
+ |89 | Pulling something out of something |
188
+ |90 | Pulling two ends of something but nothing happens |
189
+ |91 | Pulling two ends of something so that it gets stretched |
190
+ |92 | Pulling two ends of something so that it separates into two pieces |
191
+ |93 | Pushing something from left to right |
192
+ |94 | Pushing something from right to left |
193
+ |95 | Pushing something off of something |
194
+ |96 | Pushing something onto something |
195
+ |97 | Pushing something so it spins |
196
+ |98 | Pushing something so that it almost falls off but doesn't |
197
+ |99 | Pushing something so that it falls off the table |
198
+ |100 | Pushing something so that it slightly moves |
199
+ |101 | Pushing something with something |
200
+ |102 | Putting number of something onto something |
201
+ |103 | Putting something and something on the table |
202
+ |104 | Putting something behind something |
203
+ |105 | Putting something in front of something |
204
+ |106 | Putting something into something |
205
+ |107 | Putting something next to something |
206
+ |108 | Putting something on a flat surface without letting it roll |
207
+ |109 | Putting something on a surface |
208
+ |110 | Putting something on the edge of something so it is not supported and falls down |
209
+ |111 | Putting something onto a slanted surface but it doesn't glide down |
210
+ |112 | Putting something onto something |
211
+ |113 | Putting something onto something else that cannot support it so it falls down |
212
+ |114 | Putting something similar to other things that are already on the table |
213
+ |115 | Putting something that can't roll onto a slanted surface, so it slides down |
214
+ |116 | Putting something that can't roll onto a slanted surface, so it stays where it is |
215
+ |117 | Putting something that cannot actually stand upright upright on the table, so it falls on its side |
216
+ |118 | Putting something underneath something |
217
+ |119 | Putting something upright on the table |
218
+ |120 | Putting something, something and something on the table |
219
+ |121 | Removing something, revealing something behind |
220
+ |122 | Rolling something on a flat surface |
221
+ |123 | Scooping something up with something |
222
+ |124 | Showing a photo of something to the camera |
223
+ |125 | Showing something behind something |
224
+ |126 | Showing something next to something |
225
+ |127 | Showing something on top of something |
226
+ |128 | Showing something to the camera |
227
+ |129 | Showing that something is empty |
228
+ |130 | Showing that something is inside something |
229
+ |131 | Something being deflected from something |
230
+ |132 | Something colliding with something and both are being deflected |
231
+ |133 | Something colliding with something and both come to a halt |
232
+ |134 | Something falling like a feather or paper |
233
+ |135 | Something falling like a rock |
234
+ |136 | Spilling something behind something |
235
+ |137 | Spilling something next to something |
236
+ |138 | Spilling something onto something |
237
+ |139 | Spinning something so it continues spinning |
238
+ |140 | Spinning something that quickly stops spinning |
239
+ |141 | Spreading something onto something |
240
+ |142 | Sprinkling something onto something |
241
+ |143 | Squeezing something |
242
+ |144 | Stacking number of something |
243
+ |145 | Stuffing something into something |
244
+ |146 | Taking one of many similar things on the table |
245
+ |147 | Taking something from somewhere |
246
+ |148 | Taking something out of something |
247
+ |149 | Tearing something into two pieces |
248
+ |150 | Tearing something just a little bit |
249
+ |151 | Throwing something |
250
+ |152 | Throwing something against something |
251
+ |153 | Throwing something in the air and catching it |
252
+ |154 | Throwing something in the air and letting it fall |
253
+ |155 | Throwing something onto a surface |
254
+ |156 | Tilting something with something on it slightly so it doesn't fall down |
255
+ |157 | Tilting something with something on it until it falls off |
256
+ |158 | Tipping something over |
257
+ |159 | Tipping something with something in it over, so something in it falls out |
258
+ |160 | Touching (without moving) part of something |
259
+ |161 | Trying but failing to attach something to something because it doesn't stick |
260
+ |162 | Trying to bend something unbendable so nothing happens |
261
+ |163 | Trying to pour something into something, but missing so it spills next to it |
262
+ |164 | Turning something upside down |
263
+ |165 | Turning the camera downwards while filming something |
264
+ |166 | Turning the camera left while filming something |
265
+ |167 | Turning the camera right while filming something |
266
+ |168 | Turning the camera upwards while filming something |
267
+ |169 | Twisting (wringing) something wet until water comes out |
268
+ |170 | Twisting something |
269
+ |171 | Uncovering something |
270
+ |172 | Unfolding something |
271
+ |173 | Wiping something off of something |
272
  </details>
273
 
274
  ### Data Splits
 
276
 
277
  | |train |validation| test |
278
  |-------------|------:|---------:|------:|
279
+ |# of examples|168913|24777 |27157 |
280
 
281
 
282
  ## Dataset Creation
283
 
284
  ### Curation Rationale
285
 
286
+ From the paper:
287
+ > Neural networks trained on datasets such as ImageNet have led to major advances
288
+ in visual object classification. One obstacle that prevents networks from reasoning more
289
+ deeply about complex scenes and situations, and from integrating visual knowledge with natural language,
290
+ like humans do, is their lack of common sense knowledge about the physical world.
291
+ Videos, unlike still images, contain a wealth of detailed information about the physical world.
292
+ However, most labelled video datasets represent high-level concepts rather than detailed physical aspects
293
+ about actions and scenes. In this work, we describe our ongoing collection of the
294
+ “something-something” database of video prediction tasks whose solutions require a common sense
295
+ understanding of the depicted situation
296
 
297
 
298
  ### Source Data
299
 
300
  #### Initial Data Collection and Normalization
301
+ From the paper:
302
+ > As outlined is Section 3 videos available online are largely unsuitable for the goal of learning
303
+ simple (but finegrained) visual concepts. We therefore ask crowd-workers to provide videos
304
+ given labels instead of the other way around.
305
 
306
  #### Who are the source language producers?
307
 
308
+ The dataset authors
309
 
310
  ### Annotations
311
 
312
  #### Annotation process
313
 
314
+ The label is given first and then the video is collected by an AMT worker. More fine-grained details on the process are in the Section 4 of the work.
315
 
316
  #### Who are the annotators?
317
+ AMT workers
318
 
319
  ### Personal and Sensitive Information
320
+ Nothing specifically discussed in the paper.
321
 
322
  ## Considerations for Using the Data
323
 
324
  ### Social Impact of Dataset
325
 
326
+ The dataset is useful for action recognition pretraining due to diverse set of actions that happen in it.
327
 
328
  ### Discussion of Biases
329
 
 
340
 
341
  ### Licensing Information
342
 
343
+ License is a one-page document as defined by QualComm. Please read the license document in detail before using this dataset [here](https://developer.qualcomm.com/downloads/data-license-agreement-research-use?referrer=node/68935).
344
+
345
  ### Citation Information
346
 
347
  ```bibtex
dataset_infos.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"default": {"description": "The Something-Something dataset (version 2) is a collection of 220,847 labeled video clips of humans performing pre-defined, basic actions with everyday objects. It is designed to train machine learning models in fine-grained understanding of human hand gestures like putting something into something, turning something upside down and covering something with something.\n", "citation": "\n@inproceedings{goyal2017something,\n title={The\" something something\" video database for learning and evaluating visual common sense},\n author={Goyal, Raghav and Ebrahimi Kahou, Samira and Michalski, Vincent and Materzynska, Joanna and Westphal, Susanne and Kim, Heuna and Haenel, Valentin and Fruend, Ingo and Yianilos, Peter and Mueller-Freitag, Moritz and others},\n booktitle={Proceedings of the IEEE international conference on computer vision},\n pages={5842--5850},\n year={2017}\n}\n", "homepage": "", "license": "", "features": {"video_id": {"dtype": "string", "id": null, "_type": "Value"}, "video": {"dtype": "string", "id": null, "_type": "Value"}, "text": {"dtype": "string", "id": null, "_type": "Value"}, "label": {"num_classes": 174, "names": ["Approaching something with your camera", "Attaching something to something", "Bending something so that it deforms", "Bending something until it breaks", "Burying something in something", "Closing something", "Covering something with something", "Digging something out of something", "Dropping something behind something", "Dropping something in front of something", "Dropping something into something", "Dropping something next to something", "Dropping something onto something", "Failing to put something into something because something does not fit", "Folding something", "Hitting something with something", "Holding something", "Holding something behind something", "Holding something in front of something", "Holding something next to something", "Holding something over something", "Laying something on the table on its side, not upright", "Letting something roll along a flat surface", "Letting something roll down a slanted surface", "Letting something roll up a slanted surface, so it rolls back down", "Lifting a surface with something on it but not enough for it to slide down", "Lifting a surface with something on it until it starts sliding down", "Lifting something up completely without letting it drop down", "Lifting something up completely, then letting it drop down", "Lifting something with something on it", "Lifting up one end of something without letting it drop down", "Lifting up one end of something, then letting it drop down", "Moving away from something with your camera", "Moving part of something", "Moving something across a surface until it falls down", "Moving something across a surface without it falling down", "Moving something and something away from each other", "Moving something and something closer to each other", "Moving something and something so they collide with each other", "Moving something and something so they pass each other", "Moving something away from something", "Moving something away from the camera", "Moving something closer to something", "Moving something down", "Moving something towards the camera", "Moving something up", "Opening something", "Picking something up", "Piling something up", "Plugging something into something", "Plugging something into something but pulling it right out as you remove your hand", "Poking a hole into some substance", "Poking a hole into something soft", "Poking a stack of something so the stack collapses", "Poking a stack of something without the stack collapsing", "Poking something so it slightly moves", "Poking something so lightly that it doesn't or almost doesn't move", "Poking something so that it falls over", "Poking something so that it spins around", "Pouring something into something", "Pouring something into something until it overflows", "Pouring something onto something", "Pouring something out of something", "Pretending or failing to wipe something off of something", "Pretending or trying and failing to twist something", "Pretending to be tearing something that is not tearable", "Pretending to close something without actually closing it", "Pretending to open something without actually opening it", "Pretending to pick something up", "Pretending to poke something", "Pretending to pour something out of something, but something is empty", "Pretending to put something behind something", "Pretending to put something into something", "Pretending to put something next to something", "Pretending to put something on a surface", "Pretending to put something onto something", "Pretending to put something underneath something", "Pretending to scoop something up with something", "Pretending to spread air onto something", "Pretending to sprinkle air onto something", "Pretending to squeeze something", "Pretending to take something from somewhere", "Pretending to take something out of something", "Pretending to throw something", "Pretending to turn something upside down", "Pulling something from behind of something", "Pulling something from left to right", "Pulling something from right to left", "Pulling something onto something", "Pulling something out of something", "Pulling two ends of something but nothing happens", "Pulling two ends of something so that it gets stretched", "Pulling two ends of something so that it separates into two pieces", "Pushing something from left to right", "Pushing something from right to left", "Pushing something off of something", "Pushing something onto something", "Pushing something so it spins", "Pushing something so that it almost falls off but doesn't", "Pushing something so that it falls off the table", "Pushing something so that it slightly moves", "Pushing something with something", "Putting number of something onto something", "Putting something and something on the table", "Putting something behind something", "Putting something in front of something", "Putting something into something", "Putting something next to something", "Putting something on a flat surface without letting it roll", "Putting something on a surface", "Putting something on the edge of something so it is not supported and falls down", "Putting something onto a slanted surface but it doesn't glide down", "Putting something onto something", "Putting something onto something else that cannot support it so it falls down", "Putting something similar to other things that are already on the table", "Putting something that can't roll onto a slanted surface, so it slides down", "Putting something that can't roll onto a slanted surface, so it stays where it is", "Putting something that cannot actually stand upright upright on the table, so it falls on its side", "Putting something underneath something", "Putting something upright on the table", "Putting something, something and something on the table", "Removing something, revealing something behind", "Rolling something on a flat surface", "Scooping something up with something", "Showing a photo of something to the camera", "Showing something behind something", "Showing something next to something", "Showing something on top of something", "Showing something to the camera", "Showing that something is empty", "Showing that something is inside something", "Something being deflected from something", "Something colliding with something and both are being deflected", "Something colliding with something and both come to a halt", "Something falling like a feather or paper", "Something falling like a rock", "Spilling something behind something", "Spilling something next to something", "Spilling something onto something", "Spinning something so it continues spinning", "Spinning something that quickly stops spinning", "Spreading something onto something", "Sprinkling something onto something", "Squeezing something", "Stacking number of something", "Stuffing something into something", "Taking one of many similar things on the table", "Taking something from somewhere", "Taking something out of something", "Tearing something into two pieces", "Tearing something just a little bit", "Throwing something", "Throwing something against something", "Throwing something in the air and catching it", "Throwing something in the air and letting it fall", "Throwing something onto a surface", "Tilting something with something on it slightly so it doesn't fall down", "Tilting something with something on it until it falls off", "Tipping something over", "Tipping something with something in it over, so something in it falls out", "Touching (without moving) part of something", "Trying but failing to attach something to something because it doesn't stick", "Trying to bend something unbendable so nothing happens", "Trying to pour something into something, but missing so it spills next to it", "Turning something upside down", "Turning the camera downwards while filming something", "Turning the camera left while filming something", "Turning the camera right while filming something", "Turning the camera upwards while filming something", "Twisting (wringing) something wet until water comes out", "Twisting something", "Uncovering something", "Unfolding something", "Wiping something off of something"], "id": null, "_type": "ClassLabel"}, "placeholders": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": null, "builder_name": "something_something_v2", "config_name": "default", "version": {"version_str": "0.0.0", "description": null, "major": 0, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 12036633, "num_examples": 168913, "dataset_name": "something_something_v2"}, "validation": {"name": "validation", "num_bytes": 1743189, "num_examples": 24777, "dataset_name": "something_something_v2"}, "test": {"name": "test", "num_bytes": 1452851, "num_examples": 27157, "dataset_name": "something_something_v2"}}, "download_checksums": {}, "download_size": 0, "post_processing_size": null, "dataset_size": 15232673, "size_in_bytes": 15232673}}
something_something_v2.py CHANGED
@@ -54,10 +54,10 @@ class SomethingSomethingV2(datasets.GeneratorBasedBuilder):
54
  "video_id": datasets.Value("string"),
55
  "video": datasets.Value("string"),
56
  "text": datasets.Value("string"),
57
- "labels": datasets.features.ClassLabel(
58
  num_classes=len(SOMETHING_SOMETHING_V2_CLASSES), names=SOMETHING_SOMETHING_V2_CLASSES
59
  ),
60
- "objects": datasets.Sequence(datasets.Value("string")),
61
  }
62
  ),
63
  supervised_keys=None,
@@ -72,11 +72,12 @@ class SomethingSomethingV2(datasets.GeneratorBasedBuilder):
72
  "from 'https://developer.qualcomm.com/software/ai-datasets/something-something'. "
73
  "Unzip the 19 files and concatenate the extracts in order into a tar file named '20bn-something-something-v2.tar.gz. "
74
  "Use command like `cat 20bn-something-something-v2-?? >> 20bn-something-something-v2.tar.gz` "
75
- "Place the labels zip file and the tar file into a folder '/path/to/data/' and load the dataset using "
76
  "`load_dataset('something-something-v2', data_dir='/path/to/data')`"
77
  )
78
 
79
- def _split_generators(self, dl_manager, data_dir):
 
80
  labels_path = os.path.join(data_dir, "labels.zip")
81
  videos_path = os.path.join(data_dir, "20bn-something-something-v2.tar.gz")
82
  if not os.path.exists(labels_path):
@@ -90,23 +91,23 @@ class SomethingSomethingV2(datasets.GeneratorBasedBuilder):
90
  datasets.SplitGenerator(
91
  name=datasets.Split.TRAIN,
92
  gen_kwargs={
93
- "annotation_file": os.path.join(labels_path, "train.json"),
94
- "videos_files": dl_manager.iter_archive(videos_path),
95
  },
96
  ),
97
  datasets.SplitGenerator(
98
  name=datasets.Split.VALIDATION,
99
  gen_kwargs={
100
- "annotation_file": os.path.join(labels_path, "validation.json"),
101
- "videos_files": dl_manager.iter_archive(videos_path),
102
  },
103
  ),
104
  datasets.SplitGenerator(
105
- name=datasets.Split.TRAIN,
106
  gen_kwargs={
107
- "annotation_file": os.path.join(labels_path, "test.json"),
108
- "videos_files": dl_manager.iter_archive(videos_path),
109
- "labels_file": os.path.join(labels_path, "test_labels.csv"),
110
  },
111
  ),
112
  ]
@@ -125,7 +126,7 @@ class SomethingSomethingV2(datasets.GeneratorBasedBuilder):
125
  annotations = json.load(fobj)
126
  for annotation in annotations:
127
  if "template" in annotation:
128
- annotation["template"] = annotation["template"].replace("[something]", "something")
129
  if labels:
130
  annotation["template"] = labels[annotation["id"]]
131
  data[annotation["id"]] = annotation
@@ -138,13 +139,12 @@ class SomethingSomethingV2(datasets.GeneratorBasedBuilder):
138
  continue
139
 
140
  info = data[video_id]
141
-
142
  yield idx, {
143
  "video_id": video_id,
144
  "video": file,
145
- "objects": info["objects"],
146
- "label": data["template"],
147
- "text": data["text"] if "text" in data else -1
148
  }
149
 
150
  idx += 1
 
54
  "video_id": datasets.Value("string"),
55
  "video": datasets.Value("string"),
56
  "text": datasets.Value("string"),
57
+ "label": datasets.features.ClassLabel(
58
  num_classes=len(SOMETHING_SOMETHING_V2_CLASSES), names=SOMETHING_SOMETHING_V2_CLASSES
59
  ),
60
+ "placeholders": datasets.Sequence(datasets.Value("string")),
61
  }
62
  ),
63
  supervised_keys=None,
 
72
  "from 'https://developer.qualcomm.com/software/ai-datasets/something-something'. "
73
  "Unzip the 19 files and concatenate the extracts in order into a tar file named '20bn-something-something-v2.tar.gz. "
74
  "Use command like `cat 20bn-something-something-v2-?? >> 20bn-something-something-v2.tar.gz` "
75
+ "Place the `labels.zip` file and the tar file into a folder '/path/to/data/' and load the dataset using "
76
  "`load_dataset('something-something-v2', data_dir='/path/to/data')`"
77
  )
78
 
79
+ def _split_generators(self, dl_manager):
80
+ data_dir = dl_manager.manual_dir
81
  labels_path = os.path.join(data_dir, "labels.zip")
82
  videos_path = os.path.join(data_dir, "20bn-something-something-v2.tar.gz")
83
  if not os.path.exists(labels_path):
 
91
  datasets.SplitGenerator(
92
  name=datasets.Split.TRAIN,
93
  gen_kwargs={
94
+ "annotation_file": os.path.join(labels_path, "labels", "train.json"),
95
+ "video_files": dl_manager.iter_archive(videos_path),
96
  },
97
  ),
98
  datasets.SplitGenerator(
99
  name=datasets.Split.VALIDATION,
100
  gen_kwargs={
101
+ "annotation_file": os.path.join(labels_path, "labels", "validation.json"),
102
+ "video_files": dl_manager.iter_archive(videos_path),
103
  },
104
  ),
105
  datasets.SplitGenerator(
106
+ name=datasets.Split.TEST,
107
  gen_kwargs={
108
+ "annotation_file": os.path.join(labels_path, "labels", "test.json"),
109
+ "video_files": dl_manager.iter_archive(videos_path),
110
+ "labels_file": os.path.join(labels_path, "labels", "test-answers.csv"),
111
  },
112
  ),
113
  ]
 
126
  annotations = json.load(fobj)
127
  for annotation in annotations:
128
  if "template" in annotation:
129
+ annotation["template"] = annotation["template"].replace("[", "").replace("]", "")
130
  if labels:
131
  annotation["template"] = labels[annotation["id"]]
132
  data[annotation["id"]] = annotation
 
139
  continue
140
 
141
  info = data[video_id]
 
142
  yield idx, {
143
  "video_id": video_id,
144
  "video": file,
145
+ "placeholders": info.get("placeholders", []),
146
+ "label": info["template"],
147
+ "text": info["label"] if "label" in info else -1
148
  }
149
 
150
  idx += 1