{"record":{"id":"792fae1311a0f380","repo":"open-mmlab/mmdetection","slug":"randomcentercroppad-only-supports-bbox","errorCode":null,"errorMessage":"RandomCenterCropPad only supports bbox.","messagePattern":"RandomCenterCropPad only supports bbox\\.","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"mmdet/datasets/transforms/transforms.py","lineNumber":2099,"sourceCode":"                    gt_bboxes.clip_([new_h, new_w])\n                keep = gt_bboxes.is_inside([new_h, new_w]).numpy()\n                gt_bboxes = gt_bboxes[keep]\n\n                results['gt_bboxes'] = gt_bboxes\n\n                # ignore_flags\n                if results.get('gt_ignore_flags', None) is not None:\n                    gt_ignore_flags = results['gt_ignore_flags'][mask]\n                    results['gt_ignore_flags'] = \\\n                        gt_ignore_flags[keep]\n\n                # labels\n                if results.get('gt_bboxes_labels', None) is not None:\n                    gt_labels = results['gt_bboxes_labels'][mask]\n                    results['gt_bboxes_labels'] = gt_labels[keep]\n\n                if 'gt_masks' in results or 'gt_seg_map' in results:\n                    raise NotImplementedError(\n                        'RandomCenterCropPad only supports bbox.')\n\n                return results\n\n    def _test_aug(self, results):\n        \"\"\"Around padding the original image without cropping.\n\n        The padding mode and value are from ``test_pad_mode``.\n\n        Args:\n            results (dict): Image infomations in the augment pipeline.\n\n        Returns:\n            results (dict): The updated dict.\n        \"\"\"\n        img = results['img']\n        h, w, c = img.shape\n        if self.test_pad_mode[0] in ['logical_or']:","sourceCodeStart":2081,"sourceCodeEnd":2117,"githubUrl":"https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/mmdet/datasets/transforms/transforms.py#L2081-L2117","documentation":"RandomCenterCropPad (used by YOLOX-style training) only operates on bounding boxes; if results contain 'gt_masks' or 'gt_seg_map' it raises NotImplementedError in the train branch.","triggerScenarios":"A config combines RandomCenterCropPad with mask/segmentation annotations loaded (with_mask=True or with_seg=True in LoadAnnotations, or dataset providing them).","commonSituations":"Reusing YOLOX COCO detection configs for instance segmentation without removing RandomCenterCropPad.","solutions":["Remove mask/seg loading (with_mask=False, with_seg=False) from LoadAnnotations","Replace RandomCenterCropPad with e.g. RandomAffine or default crop/resize when doing segmentation","Only use RandomCenterCropPad for pure detection pipelines"],"exampleFix":"# before\ntrain_pipeline=[dict(type='LoadAnnotations', with_bbox=True, with_mask=True), dict(type='RandomCenterCropPad', ...)]\n# after\ntrain_pipeline=[dict(type='LoadAnnotations', with_bbox=True), dict(type='RandomCenterCropPad', ...)]","handlingStrategy":"validation","validationCode":"assert 'gt_masks' not in results and 'gt_seg_map' not in results, 'RandomCenterCropPad is bbox-only'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep YOLOX crop transform in detection-only configs","Review with_mask/with_seg flags when porting configs"],"tags":["mmdet","yolox","randomcentercroppad","segmentation"],"backgroundTag":"unsupported-pipeline-combination","analyzedSha":"cfd5d3a985b0249de009b67d04f37263e11cdf3d","analyzedAt":"2026-08-27T20:54:20.183Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}