Unverified Commit 1486d2ae authored by amyeroberts's avatar amyeroberts Committed by GitHub
Browse files

Move common image processing methods to BaseImageProcessor (#25089)

Move out common methods
parent d30cf3d0
......@@ -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:
"""
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment