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
305f41e4
Unverified
Commit
305f41e4
authored
Jan 03, 2023
by
Alara Dirik
Committed by
GitHub
Jan 03, 2023
Browse files
Fix post_process_object_detection method descriptions (#20977)
fix post_process_object_detection descriptions
parent
367fdf33
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
18 additions
and
17 deletions
+18
-17
src/transformers/models/conditional_detr/image_processing_conditional_detr.py
...els/conditional_detr/image_processing_conditional_detr.py
+2
-2
src/transformers/models/deformable_detr/image_processing_deformable_detr.py
...odels/deformable_detr/image_processing_deformable_detr.py
+4
-4
src/transformers/models/detr/image_processing_detr.py
src/transformers/models/detr/image_processing_detr.py
+4
-4
src/transformers/models/owlvit/image_processing_owlvit.py
src/transformers/models/owlvit/image_processing_owlvit.py
+2
-1
src/transformers/models/yolos/image_processing_yolos.py
src/transformers/models/yolos/image_processing_yolos.py
+6
-6
No files found.
src/transformers/models/conditional_detr/image_processing_conditional_detr.py
View file @
305f41e4
...
...
@@ -1302,8 +1302,8 @@ class ConditionalDetrImageProcessor(BaseImageProcessor):
self
,
outputs
,
threshold
:
float
=
0.5
,
target_sizes
:
Union
[
TensorType
,
List
[
Tuple
]]
=
None
):
"""
Converts the output of [`ConditionalDetrForObjectDetection`] into
the format expected by the COCO api. Only
supports PyTorch.
Converts the
raw
output of [`ConditionalDetrForObjectDetection`] into
final bounding boxes in (top_left_x,
top_left_y, bottom_right_x, bottom_right_y) format. Only
supports PyTorch.
Args:
outputs ([`DetrObjectDetectionOutput`]):
...
...
src/transformers/models/deformable_detr/image_processing_deformable_detr.py
View file @
305f41e4
...
...
@@ -1251,8 +1251,8 @@ class DeformableDetrImageProcessor(BaseImageProcessor):
# POSTPROCESSING METHODS - TODO: add support for other frameworks
def
post_process
(
self
,
outputs
,
target_sizes
):
"""
Converts the output of [`DeformableDetrForObjectDetection`] into
the format expected by the COCO api. Only
supports PyTorch.
Converts the
raw
output of [`DeformableDetrForObjectDetection`] into
final bounding boxes in (top_left_x,
top_left_y, bottom_right_x, bottom_right_y) format. Only
supports PyTorch.
Args:
outputs ([`DeformableDetrObjectDetectionOutput`]):
...
...
@@ -1299,8 +1299,8 @@ class DeformableDetrImageProcessor(BaseImageProcessor):
self
,
outputs
,
threshold
:
float
=
0.5
,
target_sizes
:
Union
[
TensorType
,
List
[
Tuple
]]
=
None
):
"""
Converts the output of [`DeformableDetrForObjectDetection`] into
the format expected by the COCO api. Only
supports PyTorch.
Converts the
raw
output of [`DeformableDetrForObjectDetection`] into
final bounding boxes in (top_left_x,
top_left_y, bottom_right_x, bottom_right_y) format. Only
supports PyTorch.
Args:
outputs ([`DetrObjectDetectionOutput`]):
...
...
src/transformers/models/detr/image_processing_detr.py
View file @
305f41e4
...
...
@@ -1222,8 +1222,8 @@ class DetrImageProcessor(BaseImageProcessor):
# inspired by https://github.com/facebookresearch/detr/blob/master/models/detr.py#L258
def
post_process
(
self
,
outputs
,
target_sizes
):
"""
Converts the output of [`DetrForObjectDetection`] into
the format expected by the COCO api. Only supports
PyTorch.
Converts the
raw
output of [`DetrForObjectDetection`] into
final bounding boxes in (top_left_x, top_left_y,
bottom_right_x, bottom_right_y) format. Only supports
PyTorch.
Args:
outputs ([`DetrObjectDetectionOutput`]):
...
...
@@ -1499,8 +1499,8 @@ class DetrImageProcessor(BaseImageProcessor):
self
,
outputs
,
threshold
:
float
=
0.5
,
target_sizes
:
Union
[
TensorType
,
List
[
Tuple
]]
=
None
):
"""
Converts the output of [`DetrForObjectDetection`] into
the format expected by the COCO api. Only supports
PyTorch.
Converts the
raw
output of [`DetrForObjectDetection`] into
final bounding boxes in (top_left_x, top_left_y,
bottom_right_x, bottom_right_y) format. Only supports
PyTorch.
Args:
outputs ([`DetrObjectDetectionOutput`]):
...
...
src/transformers/models/owlvit/image_processing_owlvit.py
View file @
305f41e4
...
...
@@ -329,7 +329,8 @@ class OwlViTImageProcessor(BaseImageProcessor):
def
post_process
(
self
,
outputs
,
target_sizes
):
"""
Converts the output of [`OwlViTForObjectDetection`] into the format expected by the COCO api.
Converts the raw output of [`OwlViTForObjectDetection`] into final bounding boxes in (top_left_x, top_left_y,
bottom_right_x, bottom_right_y) format.
Args:
outputs ([`OwlViTObjectDetectionOutput`]):
...
...
src/transformers/models/yolos/image_processing_yolos.py
View file @
305f41e4
...
...
@@ -1116,14 +1116,14 @@ class YolosImageProcessor(BaseImageProcessor):
return
encoded_inputs
# POSTPROCESSING METHODS - TODO: add support for other frameworks
# Copied from transformers.models.detr.image_processing_detr.DetrImageProcessor.post_process
# Copied from transformers.models.detr.image_processing_detr.DetrImageProcessor.post_process
with Detr->Yolos
def
post_process
(
self
,
outputs
,
target_sizes
):
"""
Converts the output of [`
Detr
ForObjectDetection`] into
the format expected by the COCO api. Only supports
PyTorch.
Converts the
raw
output of [`
Yolos
ForObjectDetection`] into
final bounding boxes in (top_left_x, top_left_y,
bottom_right_x, bottom_right_y) format. Only supports
PyTorch.
Args:
outputs ([`
Detr
ObjectDetectionOutput`]):
outputs ([`
Yolos
ObjectDetectionOutput`]):
Raw outputs of the model.
target_sizes (`torch.Tensor` of shape `(batch_size, 2)`):
Tensor containing the size (height, width) of each image of the batch. For evaluation, this must be the
...
...
@@ -1164,8 +1164,8 @@ class YolosImageProcessor(BaseImageProcessor):
self
,
outputs
,
threshold
:
float
=
0.5
,
target_sizes
:
Union
[
TensorType
,
List
[
Tuple
]]
=
None
):
"""
Converts the output of [`YolosForObjectDetection`] into
the format expected by the COCO api. Only supports
PyTorch.
Converts the
raw
output of [`YolosForObjectDetection`] into
final bounding boxes in (top_left_x, top_left_y,
bottom_right_x, bottom_right_y) format. Only supports
PyTorch.
Args:
outputs ([`YolosObjectDetectionOutput`]):
...
...
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