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
425ff71c
Unverified
Commit
425ff71c
authored
Jan 20, 2023
by
Jitesh Jain
Committed by
GitHub
Jan 20, 2023
Browse files
Fix OneFormer Docstrings (#21215)
* Fix processor * Fix shape in docstring
parent
b0969caf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
src/transformers/models/oneformer/modeling_oneformer.py
src/transformers/models/oneformer/modeling_oneformer.py
+7
-7
No files found.
src/transformers/models/oneformer/modeling_oneformer.py
View file @
425ff71c
...
@@ -2917,7 +2917,7 @@ class OneFormerModel(OneFormerPreTrainedModel):
...
@@ -2917,7 +2917,7 @@ class OneFormerModel(OneFormerPreTrainedModel):
>>> class_predictions = outputs.transformer_decoder_class_predictions
>>> class_predictions = outputs.transformer_decoder_class_predictions
>>> f"👉 Mask Predictions Shape: {list(mask_predictions.shape)}, Class Predictions Shape: {list(class_predictions.shape)}"
>>> f"👉 Mask Predictions Shape: {list(mask_predictions.shape)}, Class Predictions Shape: {list(class_predictions.shape)}"
'👉 Mask Predictions Shape: [1, 150, 128, 17
6
], Class Predictions Shape: [1, 150, 151]'
'👉 Mask Predictions Shape: [1, 150, 128, 17
1
], Class Predictions Shape: [1, 150, 151]'
```"""
```"""
if
pixel_values
is
None
:
if
pixel_values
is
None
:
...
@@ -3112,8 +3112,8 @@ class OneFormerForUniversalSegmentation(OneFormerPreTrainedModel):
...
@@ -3112,8 +3112,8 @@ class OneFormerForUniversalSegmentation(OneFormerPreTrainedModel):
>>> class_queries_logits = outputs.class_queries_logits
>>> class_queries_logits = outputs.class_queries_logits
>>> masks_queries_logits = outputs.masks_queries_logits
>>> masks_queries_logits = outputs.masks_queries_logits
>>> # you can pass them to
feature_extract
or for semantic postprocessing
>>> # you can pass them to
process
or for semantic postprocessing
>>> predicted_semantic_map =
feature_extract
or.post_process_semantic_segmentation(
>>> predicted_semantic_map =
process
or.post_process_semantic_segmentation(
... outputs, target_sizes=[image.size[::-1]]
... outputs, target_sizes=[image.size[::-1]]
... )[0]
... )[0]
>>> f"👉 Semantic Predictions Shape: {list(predicted_semantic_map.shape)}"
>>> f"👉 Semantic Predictions Shape: {list(predicted_semantic_map.shape)}"
...
@@ -3129,8 +3129,8 @@ class OneFormerForUniversalSegmentation(OneFormerPreTrainedModel):
...
@@ -3129,8 +3129,8 @@ class OneFormerForUniversalSegmentation(OneFormerPreTrainedModel):
>>> class_queries_logits = outputs.class_queries_logits
>>> class_queries_logits = outputs.class_queries_logits
>>> masks_queries_logits = outputs.masks_queries_logits
>>> masks_queries_logits = outputs.masks_queries_logits
>>> # you can pass them to
feature_extract
or for instance postprocessing
>>> # you can pass them to
process
or for instance postprocessing
>>> predicted_instance_map =
feature_extract
or.post_process_instance_segmentation(
>>> predicted_instance_map =
process
or.post_process_instance_segmentation(
... outputs, target_sizes=[image.size[::-1]]
... outputs, target_sizes=[image.size[::-1]]
... )[0]["segmentation"]
... )[0]["segmentation"]
>>> f"👉 Instance Predictions Shape: {list(predicted_instance_map.shape)}"
>>> f"👉 Instance Predictions Shape: {list(predicted_instance_map.shape)}"
...
@@ -3146,8 +3146,8 @@ class OneFormerForUniversalSegmentation(OneFormerPreTrainedModel):
...
@@ -3146,8 +3146,8 @@ class OneFormerForUniversalSegmentation(OneFormerPreTrainedModel):
>>> class_queries_logits = outputs.class_queries_logits
>>> class_queries_logits = outputs.class_queries_logits
>>> masks_queries_logits = outputs.masks_queries_logits
>>> masks_queries_logits = outputs.masks_queries_logits
>>> # you can pass them to
feature_extract
or for panoptic postprocessing
>>> # you can pass them to
process
or for panoptic postprocessing
>>> predicted_panoptic_map =
feature_extract
or.post_process_panoptic_segmentation(
>>> predicted_panoptic_map =
process
or.post_process_panoptic_segmentation(
... outputs, target_sizes=[image.size[::-1]]
... outputs, target_sizes=[image.size[::-1]]
... )[0]["segmentation"]
... )[0]["segmentation"]
>>> f"👉 Panoptic Predictions Shape: {list(predicted_panoptic_map.shape)}"
>>> f"👉 Panoptic Predictions Shape: {list(predicted_panoptic_map.shape)}"
...
...
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