Implementation:Open compass VLMEvalKit Spotting Metric
| Field | Value |
|---|---|
| source | VLMEvalKit |
| domain | Vision, Evaluation, OCR, Text Spotting |
Overview
Implements text spotting evaluation metrics for OCRBench v2, including bounding box extraction and text detection scoring.
Description
This module provides robust parsing of model predictions containing bounding box coordinates and text content for OCR text spotting tasks. The `extract_bounding_boxes_robust` function handles multiple formats (list/tuple parsing, regex extraction) to reliably extract [x1, y1, x2, y2, text] tuples from model output. It integrates with the RRC evaluation framework for standardized text spotting assessment using `rrc_evaluation_funcs`.
Usage
Called internally by the corresponding dataset class during evaluation.
Code Reference
- Source:
vlmeval/dataset/utils/Ocrbench_v2/spotting_metric.py, Lines: L1-185 - Import:
from vlmeval.dataset.utils.Ocrbench_v2.spotting_metric import extract_bounding_boxes_robust
Key Functions:
def extract_bounding_boxes_robust(predict_str): ...
I/O Contract
| Direction | Description |
|---|---|
| Inputs | Model prediction string containing bounding box coordinates and text content |
| Outputs | List of extracted data in the format [[x1, y1, x2, y2, text_content], ...] or None if no valid data |
Usage Examples
from vlmeval.dataset.utils.Ocrbench_v2.spotting_metric import extract_bounding_boxes_robust
results = extract_bounding_boxes_robust("[[100, 200, 300, 400, 'hello']]")