{"record":{"id":"77c661e41989a694","repo":"huggingface/transformers","slug":"unsupported-annotation-format-format-must-be-on","errorCode":null,"errorMessage":"Unsupported annotation format: {format} must be one of {supported_annotation_formats}","messagePattern":"Unsupported annotation format: (.+?) must be one of (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"src/transformers/image_utils.py","lineNumber":985,"sourceCode":"        resample = resample if resample is not None else PIL.Image.NEAREST\n\n        self._ensure_format_supported(image)\n\n        if not isinstance(image, PIL.Image.Image):\n            image = self.to_pil_image(image)\n\n        return image.rotate(\n            angle, resample=resample, expand=expand, center=center, translate=translate, fillcolor=fillcolor\n        )\n\n\ndef validate_annotations(\n    annotation_format: AnnotationFormat,\n    supported_annotation_formats: tuple[AnnotationFormat, ...],\n    annotations: list[dict],\n) -> None:\n    if annotation_format not in supported_annotation_formats:\n        raise ValueError(f\"Unsupported annotation format: {format} must be one of {supported_annotation_formats}\")\n\n    if annotation_format is AnnotationFormat.COCO_DETECTION:\n        if not valid_coco_detection_annotations(annotations):\n            raise ValueError(\n                \"Invalid COCO detection annotations. Annotations must a dict (single image) or list of dicts \"\n                \"(batch of images) with the following keys: `image_id` and `annotations`, with the latter \"\n                \"being a list of annotations in the COCO format.\"\n            )\n\n    if annotation_format is AnnotationFormat.COCO_PANOPTIC:\n        if not valid_coco_panoptic_annotations(annotations):\n            raise ValueError(\n                \"Invalid COCO panoptic annotations. Annotations must a dict (single image) or list of dicts \"\n                \"(batch of images) with the following keys: `image_id`, `file_name` and `segments_info`, with \"\n                \"the latter being a list of annotations in the COCO format.\"\n            )\n\n","sourceCodeStart":967,"sourceCodeEnd":1003,"githubUrl":"https://github.com/huggingface/transformers/blob/a597f974857b3d92939971296bc0deb93d33d780/src/transformers/image_utils.py#L967-L1003","documentation":"Error \"Unsupported annotation format: {format} must be one of {supported_annotation_formats}\" thrown in huggingface/transformers.","triggerScenarios":"Raised in annotation format validation when format is not one of the supported COCO annotation formats.","commonSituations":"Passing an unknown format string (not coco_detection/coco_panoptic) to annotation processing utilities.","solutions":["Use one of the supported annotation formats (e.g. 'coco_detection' or 'coco_panoptic').","Convert annotations to a supported format first."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a597f974857b3d92939971296bc0deb93d33d780","analyzedAt":"2026-08-14T18:24:08.354Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}