From ae3e3bc60a5f0834d952dfead4b28b1ce506125d Mon Sep 17 00:00:00 2001 From: Alara Dirik <8944735+alaradirik@users.noreply.github.com> Date: Fri, 7 Oct 2022 01:02:26 +0300 Subject: [PATCH] fix docs example, add object_detection to DETR docs (#19377) --- docs/source/en/model_doc/detr.mdx | 1 + src/transformers/models/detr/modeling_detr.py | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/source/en/model_doc/detr.mdx b/docs/source/en/model_doc/detr.mdx index a6025580a6..e2e7dbf5ff 100644 --- a/docs/source/en/model_doc/detr.mdx +++ b/docs/source/en/model_doc/detr.mdx @@ -171,6 +171,7 @@ mean Average Precision (mAP) and Panoptic Quality (PQ). The latter objects are i [[autodoc]] DetrFeatureExtractor - __call__ - pad_and_create_pixel_mask + - post_process_object_detection - post_process_semantic_segmentation - post_process_instance_segmentation - post_process_panoptic_segmentation diff --git a/src/transformers/models/detr/modeling_detr.py b/src/transformers/models/detr/modeling_detr.py index 724c2b71a7..8fcbfe09c0 100644 --- a/src/transformers/models/detr/modeling_detr.py +++ b/src/transformers/models/detr/modeling_detr.py @@ -1605,11 +1605,11 @@ class DetrForSegmentation(DetrPreTrainedModel): >>> # Use the `post_process_panoptic_segmentation` method of `DetrFeatureExtractor` to retrieve post-processed panoptic segmentation maps >>> # Segmentation results are returned as a list of dictionaries - >>> result = feature_extractor.post_process_panoptic_segmentation(outputs, target_size=[(300, 500)]) + >>> result = feature_extractor.post_process_panoptic_segmentation(outputs, target_sizes=[(300, 500)]) - >>> # A tensor of shape (height, width) where each value denotes a segment id + >>> # A tensor of shape (height, width) where each value denotes a segment id, filled with -1 if no segment is found >>> panoptic_seg = result[0]["segmentation"] - >>> # Get mapping of segment ids to semantic class ids + >>> # Get prediction score and segment_id to class_id mapping of each segment >>> panoptic_segments_info = result[0]["segments_info"] ```"""