File size: 3,292 Bytes
3d613ee | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 | # EventActivityNet Dataset Format
## Overview
EventActivityNet v1.0 stores one HDF5 file per video. Scale membership and train/validation splits are defined by manifests, so files do not need to be physically moved to use a particular split or scale.
File size varies substantially with video duration and spatial resolution.
Every production HDF5 file has exactly these root datasets:
```text
events
voxel_event_start
voxel_event_count
```
Every production HDF5 file has these required root attributes:
```text
fps
height
width
num_bins
interpolate_bins
```
## HDF5 Schema
### `events`
| Property | Value |
|---|---|
| Shape | `(T, 5, H, W)` |
| Dtype | `int16` |
| Compression | gzip |
| Shuffle | enabled |
| Chunking | `(1, 5, min(H, 256), min(W, 256))` |
`T`, `H`, and `W` vary by video. Spatial resolution is preserved from the source video.
### `voxel_event_start`
| Property | Value |
|---|---|
| Shape | `(T,)` |
| Dtype | `int64` |
| Compression | LZF |
| Shuffle | enabled |
| Chunking | `(1024,)` |
### `voxel_event_count`
| Property | Value |
|---|---|
| Shape | `(T,)` |
| Dtype | `int32` |
| Compression | LZF |
| Shuffle | enabled |
| Chunking | `(1024,)` |
## Root Attributes
| Attribute | Meaning |
|---|---|
| `fps` | Source video FPS metadata |
| `height` | Source video height |
| `width` | Source video width |
| `num_bins` | Number of voxel bins; always `5` in v1.0 |
| `interpolate_bins` | Whether temporal bin interpolation was used |
## Semantics
The generator emits event slices from adjacent grayscale video frames and accumulates them into 5-bin voxel samples.
- `events[t]` is the 5-bin voxel tensor for timestep `t`.
- `voxel_event_start[t]` is the zero-based generated-slice start index for voxel sample `t`.
- `voxel_event_count[t]` is the number of generated slices accumulated into voxel sample `t`.
For normal full samples with `frames_per_bin=1`, `voxel_event_count[t]` is typically `5`. Final partial samples may be smaller.
## Manifest Fields
Release scale manifests include one record per video. Typical fields:
| Field | Meaning |
|---|---|
| `video_id` | Canonical ActivityNet video ID, including `v_` prefix |
| `split` | `train` or `validation` |
| `class_label` | ActivityNet action class label |
| `duration_seconds` | Verified duration used for scale construction |
| `duration_source` | Duration field source, `src_fmt_dur` |
| `duration_bucket` | `short`, `medium`, or `long` |
| `event_friendly` | Boolean event-friendly flag |
| `event_keyword_hits` | Matched event-friendly caption keywords |
| `first_frame_mean` | Normalized first-frame brightness used for the darkness rule |
| `dark_first_frame` | Whether first-frame mean is below `0.4` |
## Memory-Safe Loading Example
```python
import h5py
path = "path/to/video.h5"
with h5py.File(path, "r") as f:
events = f["events"]
starts = f["voxel_event_start"]
counts = f["voxel_event_count"]
print(events.shape) # (T, 5, H, W)
print(events.dtype) # int16
print(starts.shape) # (T,)
print(counts.shape) # (T,)
print(f.attrs["num_bins"]) # 5
first_voxel = events[0] # loads one timestep, not the whole file
```
Avoid loading entire HDF5 arrays into memory unless your system has sufficient RAM.
|