{"record":{"id":"b3cc800b353db011","repo":"open-mmlab/mmdetection","slug":"unknown-ioutype-for-iou-computation","errorCode":null,"errorMessage":"unknown iouType for iou computation","messagePattern":"unknown iouType for iou computation","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"mmdet/evaluation/functional/ytviseval.py","lineNumber":205,"sourceCode":"            dt = self._dts[vidId, catId]\n        else:\n            gt = [_ for cId in p.catIds for _ in self._gts[vidId, cId]]\n            dt = [_ for cId in p.catIds for _ in self._dts[vidId, cId]]\n        if len(gt) == 0 and len(dt) == 0:\n            return []\n        inds = np.argsort([-d['score'] for d in dt], kind='mergesort')\n        dt = [dt[i] for i in inds]\n        if len(dt) > p.maxDets[-1]:\n            dt = dt[0:p.maxDets[-1]]\n\n        if p.iouType == 'segm':\n            g = [g['segmentations'] for g in gt]\n            d = [d['segmentations'] for d in dt]\n        elif p.iouType == 'bbox':\n            g = [g['bboxes'] for g in gt]\n            d = [d['bboxes'] for d in dt]\n        else:\n            raise Exception('unknown iouType for iou computation')\n\n        # compute iou between each dt and gt region\n\n        def iou_seq(d_seq, g_seq):\n            i = .0\n            u = .0\n            for d, g in zip(d_seq, g_seq):\n                if d and g:\n                    i += maskUtils.area(maskUtils.merge([d, g], True))\n                    u += maskUtils.area(maskUtils.merge([d, g], False))\n                elif not d and g:\n                    u += maskUtils.area(g)\n                elif d and not g:\n                    u += maskUtils.area(d)\n            if not u > .0:\n                print('Mask sizes in video {} and category {} may not match!'.\n                      format(vidId, catId))\n            iou = i / u if u > .0 else .0","sourceCodeStart":187,"sourceCodeEnd":223,"githubUrl":"https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/mmdet/evaluation/functional/ytviseval.py#L187-L223","documentation":"YTVISEval.computeIoU dispatches on params.iouType and only supports 'segm' (and 'bbox'); any other value (e.g. 'keypoints') reaches the else branch and raises a generic Exception.","triggerScenarios":"Constructing YTVISParams/Eval with iouType='keypoints' or a typo like 'mask', then calling evaluate() which triggers computeIoU.","commonSituations":"Adapting COCO keypoint eval code to YouTube-VIS; copy-paste from cocoeval where 'keypoints' is valid but unsupported here.","solutions":["Use iouType='segm' or 'bbox' for YouTube-VIS evaluation","For keypoint tasks, use the COCO eval API (mmdet's CocoMetric) instead of YTVISEval"],"exampleFix":"# before\nytvisEval = YTVISEval(gt, dt, iouType='keypoints')\n# after\nytvisEval = YTVISEval(gt, dt, iouType='segm')","handlingStrategy":"validation","validationCode":"assert iouType in ('segm', 'bbox'), f'YTVIS computeIoU unsupported: {iouType}'","typeGuard":"def is_ytvis_iou_type(t: str) -> bool:\n    return t in ('segm', 'bbox')","tryCatchPattern":null,"preventionTips":["Use only segm/bbox with YTVISEval","Do not port keypoint eval code from pycocoeval to YTVIS"],"tags":["ytvis","video-instance-segmentation","iou-type","mmdetection"],"backgroundTag":"unsupported-enum-value","analyzedSha":"cfd5d3a985b0249de009b67d04f37263e11cdf3d","analyzedAt":"2026-08-27T20:54:20.183Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}