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
1486d2ae
Unverified
Commit
1486d2ae
authored
Jul 26, 2023
by
amyeroberts
Committed by
GitHub
Jul 26, 2023
Browse files
Move common image processing methods to BaseImageProcessor (#25089)
Move out common methods
parent
d30cf3d0
Changes
41
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
14 deletions
+0
-14
src/transformers/models/yolos/image_processing_yolos.py
src/transformers/models/yolos/image_processing_yolos.py
+0
-14
No files found.
src/transformers/models/yolos/image_processing_yolos.py
View file @
1486d2ae
...
...
@@ -26,7 +26,6 @@ from ...image_transforms import (
center_to_corners_format
,
corners_to_center_format
,
id_to_rgb
,
normalize
,
pad
,
rescale
,
resize
,
...
...
@@ -852,19 +851,6 @@ class YolosImageProcessor(BaseImageProcessor):
"""
return
rescale
(
image
,
rescale_factor
,
data_format
=
data_format
)
# Copied from transformers.models.detr.image_processing_detr.DetrImageProcessor.normalize
def
normalize
(
self
,
image
:
np
.
ndarray
,
mean
:
Union
[
float
,
Iterable
[
float
]],
std
:
Union
[
float
,
Iterable
[
float
]],
data_format
:
Optional
[
ChannelDimension
]
=
None
,
)
->
np
.
ndarray
:
"""
Normalize the image with the given mean and standard deviation.
"""
return
normalize
(
image
,
mean
=
mean
,
std
=
std
,
data_format
=
data_format
)
# Copied from transformers.models.detr.image_processing_detr.DetrImageProcessor.normalize_annotation
def
normalize_annotation
(
self
,
annotation
:
Dict
,
image_size
:
Tuple
[
int
,
int
])
->
Dict
:
"""
...
...
Prev
1
2
3
Next
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