Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
ae3e3bc6
Unverified
Commit
ae3e3bc6
authored
Oct 07, 2022
by
Alara Dirik
Committed by
GitHub
Oct 07, 2022
Browse files
fix docs example, add object_detection to DETR docs (#19377)
parent
ce262019
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
docs/source/en/model_doc/detr.mdx
docs/source/en/model_doc/detr.mdx
+1
-0
src/transformers/models/detr/modeling_detr.py
src/transformers/models/detr/modeling_detr.py
+3
-3
No files found.
docs/source/en/model_doc/detr.mdx
View file @
ae3e3bc6
...
...
@@ -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
...
...
src/transformers/models/detr/modeling_detr.py
View file @
ae3e3bc6
...
...
@@ -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_size
s
=[(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
id
s
to
semantic class ids
>>> # Get
prediction score and
segment
_
id to
class_id mapping of each segment
>>> panoptic_segments_info = result[0]["segments_info"]
```"""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment