def match(cls, responses, targets) -> float:
        """Exact match between targets and responses."""
        if not isinstance(responses, (tuple | list)):
            responses = str(responses) if not isinstance(responses, str) else responses
            responses = str_to_bboxes(responses)
        if not isinstance(targets, (tuple | list)):
            targets = str_to_bboxes(targets)

        if len(targets) != len(responses):
            return 0

        scores = []
        for res, tgt in zip(responses, targets):
            scores.append(
                calculate_iou(
                    [
                        res,
                    ],
                    [
                        tgt,
                    ],
                )
            )
        avg_iou = np.mean(scores)

        return avg_iou
Exact match between targets and responses.
vlmeval/dataset/utils/megabench/scoring/nbbox_iou.py