{"record":{"id":"1ce279181303578c","repo":"open-mmlab/mmdetection","slug":"imagecorruptions-is-not-installed","errorCode":null,"errorMessage":"imagecorruptions is not installed","messagePattern":"imagecorruptions is not installed","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"mmdet/datasets/transforms/transforms.py","lineNumber":1530,"sourceCode":"        severity (int): The severity of corruption. Defaults to 1.\n    \"\"\"\n\n    def __init__(self, corruption: str, severity: int = 1) -> None:\n        self.corruption = corruption\n        self.severity = severity\n\n    def transform(self, results: dict) -> dict:\n        \"\"\"Call function to corrupt image.\n\n        Args:\n            results (dict): Result dict from loading pipeline.\n\n        Returns:\n            dict: Result dict with images corrupted.\n        \"\"\"\n\n        if corrupt is None:\n            raise RuntimeError('imagecorruptions is not installed')\n        results['img'] = corrupt(\n            results['img'].astype(np.uint8),\n            corruption_name=self.corruption,\n            severity=self.severity)\n        return results\n\n    def __repr__(self) -> str:\n        repr_str = self.__class__.__name__\n        repr_str += f'(corruption={self.corruption}, '\n        repr_str += f'severity={self.severity})'\n        return repr_str\n\n\n@TRANSFORMS.register_module()\n@avoid_cache_randomness\nclass Albu(BaseTransform):\n    \"\"\"Albumentation augmentation.\n","sourceCodeStart":1512,"sourceCodeEnd":1548,"githubUrl":"https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/mmdet/datasets/transforms/transforms.py#L1512-L1548","documentation":"PhotoMetricDistortion-like Corrupt transform (mmdet) requires the optional `imagecorruptions` package to apply synthetic corruptions (gaussian noise, fog, etc.). At runtime, if the lazy import failed, the transform raises RuntimeError immediately.","triggerScenarios":"Using a pipeline config containing dict(type='Corrupt', corruption='gaussian_noise', severity=...) in testing pipelines (e.g. robustness benchmarks on COCO-C) without imagecorruptions installed.","commonSituations":"Running corruption/robustness test configs (COCO-C, VOC-C) in a fresh environment; extra deps are not installed by default `pip install mmdet`.","solutions":["pip install imagecorruptions","Verify import: python -c \"from imagecorruptions import corrupt\"","Remove the Corrupt transform if robustness testing is not intended"],"exampleFix":"# before\npipeline=[dict(type='Corrupt', corruption='fog', severity=3)]\n# after\npip install imagecorruptions  # keep the pipeline unchanged","handlingStrategy":"validation","validationCode":"import importlib.util\nassert importlib.util.find_spec('imagecorruptions') is not None, 'install imagecorruptions'","typeGuard":null,"tryCatchPattern":"try:\n    from mmdet.datasets.transforms import Corrupt\n    out = Corrupt(corruption='fog', severity=3).transform(results)\nexcept RuntimeError as e:\n    if 'imagecorruptions' in str(e):\n        raise SystemExit('pip install imagecorruptions') from e","preventionTips":["Install extras before running robustness configs","Gate corruption benchmarks behind a dependency check in scripts"],"tags":["mmdet","dependency","imagecorruptions","robustness"],"backgroundTag":"missing-optional-dependency","analyzedSha":"cfd5d3a985b0249de009b67d04f37263e11cdf3d","analyzedAt":"2026-08-27T20:54:20.183Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}