Skip to content

Commit

Permalink
Add copied from
Browse files Browse the repository at this point in the history
  • Loading branch information
NielsRogge committed Aug 31, 2024
1 parent 0adae27 commit 2b77160
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/transformers/models/auto/image_processing_auto.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
("layoutlmv2", ("LayoutLMv2ImageProcessor",)),
("layoutlmv3", ("LayoutLMv3ImageProcessor",)),
("levit", ("LevitImageProcessor",)),
("llava", ("CLIPImageProcessor",)),
("llava", ("LlavaImageProcessor",)),
("llava_next", ("LlavaNextImageProcessor",)),
("llava_next_video", ("LlavaNextVideoImageProcessor",)),
("mask2former", ("Mask2FormerImageProcessor",)),
Expand Down
9 changes: 1 addition & 8 deletions src/transformers/models/llava/image_processing_llava.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ def pad_to_square(

return result

# Copied from transformers.models.clip.image_processing_clip.CLIPImageProcessor.resize
def resize(
self,
image: np.ndarray,
Expand Down Expand Up @@ -389,10 +390,6 @@ def preprocess(
# We assume that all images have the same channel dimension format.
input_data_format = infer_channel_dimension_format(images[0])

print("Input data format:", input_data_format)
for image in images:
print(image.shape)

if do_pad:
images = [
self.pad_to_square(
Expand All @@ -403,10 +400,6 @@ def preprocess(
for image in images
]

print("After padding:")
for image in images:
print(image.shape)

if do_resize:
images = [
self.resize(image=image, size=size, resample=resample, input_data_format=input_data_format)
Expand Down

0 comments on commit 2b77160

Please sign in to comment.