Skip to content

[Benchmark] Add TimeLens-Bench for video temporal grounding - #1715

Merged
ssiq merged 4 commits into
open-compass:mainfrom
aliasgerovs:tvg-timelens-bench
Oct 13, 2026
Merged

ssiq merged 4 commits into
open-compass:mainfrom
aliasgerovs:tvg-timelens-bench

Conversation

@aliasgerovs

Copy link
Copy Markdown
Contributor

What this adds

This PR adds TimeLens-Bench, a video temporal grounding benchmark: the model gets a video and a sentence and has to say when the described event happens (start and end time in seconds). The benchmark is a manually cleaned-up version of three widely used grounding datasets:

Dataset Videos Queries Avg. video length Download
Charades-TimeLens 1,313 3,363 30 s 6.5 GB
ActivityNet-TimeLens 1,455 4,500 135 s 50 GB
QVHighlights-TimeLens 1,511 1,541 150 s 17.5 GB

Data: https://huggingface.co/datasets/TencentARC/TimeLens-Bench (BSD-3-Clause), from the TimeLens paper by TencentARC.

How it works

  • The annotations and videos are downloaded from Hugging Face the first time a dataset is used and are kept in LMUData/TimeLens-Bench.
  • The prompt and the scoring follow the official TimeLens evaluation. The first time span in the answer is compared with the ground truth, and the scores are R1@0.3, R1@0.5 and R1@0.7 (the share of answers whose IoU with the ground truth is at least 0.3, 0.5 or 0.7) and mIoU.
  • Video models get the video file at the dataset frame rate. Models that take a list of images get the frames with each frame's time written in front of it, together with the official prompt for that case.
  • Dataset names: Charades-TimeLens_2fps, ActivityNet-TimeLens_2fps, QVHighlights-TimeLens_2fps (2 fps is the official setting), plus _1fps versions.

The helpers for reading time spans from an answer, computing temporal IoU and getting frame timestamps are in vlmeval/dataset/utils/temporal_grounding.py, so other grounding benchmarks can reuse them. They have unit tests in tests/test_temporal_grounding.py.

Comparison with the official numbers

I ran Qwen3-VL-8B-Instruct with the official TimeLens settings (2 fps, at least 64 visual tokens per frame and at most 14,336 in total, greedy decoding, up to 512 new tokens) and compared with the scores in the TimeLens README:

Dataset VLMEvalKit (R1@0.3 / 0.5 / 0.7 / mIoU) Official Difference
Charades-TimeLens 69.4 / 50.6 / 27.2 / 48.0 69.2 / 53.4 / 27.5 / 48.3 +0.2 / -2.8 / -0.3 / -0.3
ActivityNet-TimeLens 62.6 / 50.7 / 34.6 / 46.9 62.1 / 51.2 / 34.4 / 46.8 +0.5 / -0.5 / +0.2 / +0.1
QVHighlights-TimeLens 74.0 / 64.1 / 49.5 / 59.6 74.2 / 64.6 / 49.3 / 59.4 -0.2 / -0.5 / +0.2 / +0.2

All 9,404 answers could be parsed. ActivityNet and QVHighlights are within 0.5 points of the official numbers on every metric. The one bigger gap is Charades R1@0.5. Charades labels and answers are mostly whole seconds, so a lot of predictions (6% here) land exactly on IoU 0.5, and tiny differences between machines push them over or under the threshold. The other Charades scores are within 0.3.

I also checked the scoring on its own: on about 47,000 answers from several models, the span parsing and IoU in this PR give exactly the same IoU for every answer as the official compute_metrics.py.

Config used:

{
  "model": {
    "Qwen3-VL-8B-Instruct": {
      "class": "Qwen3VLChat",
      "model_path": "Qwen/Qwen3-VL-8B-Instruct",
      "use_custom_prompt": false,
      "use_vllm": false,
      "min_pixels": 65536,
      "total_pixels": 14680064,
      "temperature": 0,
      "max_new_tokens": 512
    }
  },
  "data": {
    "Charades-TimeLens_2fps": {"preset": "Charades-TimeLens_2fps"}
  }
}
python run.py --config qwen3vl8b_timelens.json --mode all

Checks

  • flake8, isort and yapf with the repo settings pass on the new files.
  • pytest tests/test_temporal_grounding.py: 12 passed.

Adds Charades-TimeLens, ActivityNet-TimeLens and QVHighlights-TimeLens from
TencentARC/TimeLens-Bench. The data is downloaded from Hugging Face, and the prompt
and scoring follow the official TimeLens evaluation (R1@0.3/0.5/0.7 and mIoU).

Also adds a small shared module for temporal grounding (reading time spans from model
answers, temporal IoU, frame timestamps) with unit tests.
@ssiq

ssiq commented Oct 10, 2026

Copy link
Copy Markdown
Collaborator

@aliasgerovs Thanks for adding TimeLens-Bench. I found a few issues that should be addressed before merging:

  1. Predicted timestamps are not rounded as in the official pipeline.

    The official pipeline rounds timestamps to the dataset unit (1.0 second by default) before saving them (official eval_dataloader.py, lines 137–145 (https://github.com/TencentARC/TimeLens/blob/main/
    evaluation/eval_dataloader.py#L137-L145)). It saves both the rounded timestamps and raw answers (lines 152–157 (https://github.com/TencentARC/TimeLens/blob/main/evaluation/eval_dataloader.py#L152-
    L157)), and compute_metrics.py prioritizes timestamps (lines 52–56 (https://github.com/TencentARC/TimeLens/blob/main/evaluation/compute_metrics.py#L52-L56)).

    In this PR, TimeLensBench.evaluate() parses and scores the raw timestamps directly (https://github.com/aliasgerovs/VLMEvalKit/blob/c8bc291a2873b236df624dde539cde5ee06a81b3/vlmeval/dataset/
    timelens_bench.py#L155-L158), without applying the official rounding step.

    For example, [2.5, 7.5] against [0, 10] gives an IoU of 0.5 here, whereas the official pipeline rounds it to [2, 8], giving 0.6. This may explain the 2.8-point gap on Charades R1@0.5. Please apply
    the same rounding and update the comparison results and tests.

  2. Queries are not normalized in the same way as the official loader.

    The official loader collapses whitespace and removes trailing periods (official timelens_data.py, lines 8–10 (https://github.com/TencentARC/TimeLens/blob/main/timelens/dataset/timelens_data.py#L8-
    L10)) and applies this normalization to every query (lines 30–37 (https://github.com/TencentARC/TimeLens/blob/main/timelens/dataset/timelens_data.py#L30-L37)).

    In this PR, _build_tsv() stores the original query unchanged (https://github.com/aliasgerovs/VLMEvalKit/blob/c8bc291a2873b236df624dde539cde5ee06a81b3/vlmeval/dataset/timelens_bench.py#L68-L75).
    Therefore, the prompts may differ from those used to obtain the official results.

  3. The predefined dataset manifest is not updated.

    This PR adds six new presets in video_dataset_config.py (https://github.com/aliasgerovs/VLMEvalKit/blob/c8bc291a2873b236df624dde539cde5ee06a81b3/vlmeval/dataset/video_dataset_config.py#L447-L455),
    but the corresponding entries are missing from predefined_video_shortcuts_manifest.json (https://github.com/aliasgerovs/VLMEvalKit/blob/c8bc291a2873b236df624dde539cde5ee06a81b3/tests/fixtures/
    predefined_video_shortcuts_manifest.json).

    This violates the registry/manifest consistency assertion in test_dataset_alias.py (https://github.com/aliasgerovs/VLMEvalKit/blob/c8bc291a2873b236df624dde539cde5ee06a81b3/tests/
    test_dataset_alias.py#L311-L329):

python -m pytest -q tests/test_dataset_alias.py
1 failed, 28 passed

The timestamp parser and single-span IoU otherwise match the official implementation. multi_span_iou is not used by TimeLens-Bench.

- Round predicted spans to whole seconds before scoring, as the official
  eval_dataloader.py does (Python round, so [2.5, 7.5] becomes [2, 8]).
- Normalize queries like the official data loader: collapse whitespace and drop
  trailing periods.
- Add the six new presets to the predefined video shortcuts manifest.
aliasgerovs added a commit to aliasgerovs/VLMEvalKit that referenced this pull request Oct 11, 2026
aliasgerovs added a commit to aliasgerovs/VLMEvalKit that referenced this pull request Oct 11, 2026
TimeLens-Bench scores one span per query, so merge_spans and multi_span_iou are
not needed here. MomentSeeker and VUE-TR add them in their own PRs.
aliasgerovs added a commit to aliasgerovs/VLMEvalKit that referenced this pull request Oct 11, 2026
aliasgerovs added a commit to aliasgerovs/VLMEvalKit that referenced this pull request Oct 11, 2026
@aliasgerovs

Copy link
Copy Markdown
Contributor Author

@ssiq Thanks a lot for the careful review! All three points are fixed in the latest commits.

  1. Rounding. Predicted spans are now rounded to the dataset unit (1 s, Python round) before scoring, as in eval_dataloader.py. I added round_spans with a test for your example ([2.5, 7.5] vs [0, 10] -> IoU 0.6). You were right about the Charades gap. Re-scoring the same answers with rounding gives:

    Dataset R1@0.3 / 0.5 / 0.7 / mIoU Official
    Charades-TimeLens 69.4 / 53.6 / 27.8 / 48.2 69.2 / 53.4 / 27.5 / 48.3
    ActivityNet-TimeLens 62.2 / 51.3 / 34.2 / 46.7 62.1 / 51.2 / 34.4 / 46.8
    QVHighlights-TimeLens 74.2 / 64.2 / 49.4 / 59.5 74.2 / 64.6 / 49.3 / 59.4

    Everything is now within 0.4 points.

  2. Query normalization. The TSV is now built with the same cleaning as timelens_data.py (whitespace collapsed, trailing periods removed), with a test. This changes the prompt for most queries, so I'm re-running inference with the cleaned queries. Charades is done: 69.9 / 53.5 / 27.6 / 48.4 (official 69.2 / 53.4 / 27.5 / 48.3). ActivityNet and QVHighlights are still running, and I'll update the table in the description when they finish.

  3. Manifest. The six presets are now in predefined_video_shortcuts_manifest.json, and tests/test_dataset_alias.py passes (29 passed).

I also took merge_spans / multi_span_iou out of this PR, since TimeLens-Bench doesn't use them. They now live in the MomentSeeker (#1716) and VUE-TR (#1717) PRs, which need them. Both of those PRs include these fixes and their own manifest entries as well.

@ssiq
ssiq added this pull request to the merge queue Oct 13, 2026
Merged via the queue into open-compass:main with commit 350e828 Oct 13, 2026
11 checks passed
@aliasgerovs

Copy link
Copy Markdown
Contributor Author

Thanks for merging! For the record, here is the full re-run with the cleaned queries and the rounding (Qwen3-VL-8B-Instruct, official settings, all 9,404 answers parsed):

Dataset R1@0.3 / 0.5 / 0.7 / mIoU Official
Charades-TimeLens 69.9 / 53.5 / 27.6 / 48.4 69.2 / 53.4 / 27.5 / 48.3
ActivityNet-TimeLens 62.5 / 51.8 / 34.9 / 47.1 62.1 / 51.2 / 34.4 / 46.8
QVHighlights-TimeLens 74.2 / 64.7 / 49.4 / 59.5 74.2 / 64.6 / 49.3 / 59.4

Every score is within 0.7 points of the official numbers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants