Implementation:Open compass VLMEvalKit VCRBench Cau Acc
| Field | Value |
|---|---|
| source | VLMEvalKit |
| domain | Vision, Evaluation, Video Understanding, Temporal IoU |
Overview
Provides causal accuracy computation for the VCR-Bench benchmark with time interval IoU calculation and validity checking.
Description
This module implements `calculate_time_iou` for computing temporal Intersection-over-Union between predicted and ground-truth time intervals, and `is_valid_time_interval` for validating time interval string formats. The time IoU calculation computes the overlap ratio of two temporal segments, handling edge cases where union is zero. JSON/JSONL file I/O utilities (`read_json`, `read_jsonl`, `save_json`, `save_jsonl`) support data loading and result persistence.
Usage
Called internally by the corresponding dataset class during evaluation.
Code Reference
- Source:
vlmeval/dataset/utils/vcrbench/cau_acc.py, Lines: L1-113 - Import:
from vlmeval.dataset.utils.vcrbench.cau_acc import calculate_time_iou, is_valid_time_interval
Key Functions:
def calculate_time_iou(interval1, interval2): ...
def is_valid_time_interval(interval_str): ...
def read_json(file_path): ...
I/O Contract
| Direction | Description |
|---|---|
| Inputs | Two time intervals as (start, end) tuples; interval strings for validation |
| Outputs | Float IoU score (0-1) for temporal overlap; boolean validity for interval format |
Usage Examples
from vlmeval.dataset.utils.vcrbench.cau_acc import calculate_time_iou
iou = calculate_time_iou([0.0, 5.0], [3.0, 8.0])