{"record":{"id":"c1552ca01b317f22","repo":"open-mmlab/mmdetection","slug":"pascal-voc2012-uses-area-as-default-evaluate-mod","errorCode":null,"errorMessage":"Pascal VOC2012 uses `area` as default evaluate mode, but you are using {self.eval_mode}.","messagePattern":"Pascal VOC2012 uses `area` as default evaluate mode, but you are using (.+?)\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"mmdet/evaluation/metrics/voc_metric.py","lineNumber":132,"sourceCode":"\n        Returns:\n            dict: The computed metrics. The keys are the names of the metrics,\n            and the values are corresponding results.\n        \"\"\"\n        logger: MMLogger = MMLogger.get_current_instance()\n        gts, preds = zip(*results)\n        eval_results = OrderedDict()\n        if self.metric == 'mAP':\n            assert isinstance(self.iou_thrs, list)\n            dataset_type = self.dataset_meta.get('dataset_type')\n            if dataset_type in ['VOC2007', 'VOC2012']:\n                dataset_name = 'voc'\n                if dataset_type == 'VOC2007' and self.eval_mode != '11points':\n                    warnings.warn('Pascal VOC2007 uses `11points` as default '\n                                  'evaluate mode, but you are using '\n                                  f'{self.eval_mode}.')\n                elif dataset_type == 'VOC2012' and self.eval_mode != 'area':\n                    warnings.warn('Pascal VOC2012 uses `area` as default '\n                                  'evaluate mode, but you are using '\n                                  f'{self.eval_mode}.')\n            else:\n                dataset_name = self.dataset_meta['classes']\n\n            mean_aps = []\n            for iou_thr in self.iou_thrs:\n                logger.info(f'\\n{\"-\" * 15}iou_thr: {iou_thr}{\"-\" * 15}')\n                # Follow the official implementation,\n                # http://host.robots.ox.ac.uk/pascal/VOC/voc2012/VOCdevkit_18-May-2011.tar\n                # we should use the legacy coordinate system in mmdet 1.x,\n                # which means w, h should be computed as 'x2 - x1 + 1` and\n                # `y2 - y1 + 1`\n                mean_ap, _ = eval_map(\n                    preds,\n                    gts,\n                    scale_ranges=self.scale_ranges,\n                    iou_thr=iou_thr,","sourceCodeStart":114,"sourceCodeEnd":150,"githubUrl":"https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/mmdet/evaluation/metrics/voc_metric.py#L114-L150","documentation":"VOCMetric.compute_metrics() warns that VOC2012's standard protocol uses 'area' (all-points) interpolation for mAP, but the metric is configured otherwise (typically '11points'). Reported mAP will differ from official VOC2012 numbers.","triggerScenarios":"eval_mode != 'area' (e.g. '11points') combined with dataset_meta['dataset_type'] == 'VOC2012' in a VOCMetric mAP evaluation.","commonSituations":"Reusing a VOC2007 config on VOC2012 data, or defaulting eval_mode without adjusting per dataset year.","solutions":["Set eval_mode='area' in VOCMetric for VOC2012 datasets","Verify dataset_type in dataset meta is 'VOC2012' and matches your data","If comparing to VOC2007-style numbers deliberately, ignore the warning but document it"],"exampleFix":"# before\nval_evaluator = dict(type='VOCMetric', metric='mAP', eval_mode='11points')\n# after\nval_evaluator = dict(type='VOCMetric', metric='mAP', eval_mode='area')  # VOC2012 default","handlingStrategy":"validation","validationCode":"if dataset_meta['dataset_type'] == 'VOC2012':\n    assert eval_mode == 'area', 'VOC2012 standard protocol is area'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Set eval_mode='area' for all VOC2012 evaluations","Automate eval_mode selection from dataset_type","Document protocol when intentionally deviating"],"tags":["mmdet","voc","evaluation-protocol","map","config"],"backgroundTag":"evaluation-protocol-mismatch","analyzedSha":"cfd5d3a985b0249de009b67d04f37263e11cdf3d","analyzedAt":"2026-08-27T20:54:20.183Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}