EventActivityNet / docs /DATASET_FORMAT.md
IIS-CVL's picture
Add EventActivityNet v1.0 documentation and metadata
3d613ee verified
|
Raw
History Blame
3.29 kB

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:

events
voxel_event_start
voxel_event_count

Every production HDF5 file has these required root attributes:

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

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.