Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions docs/source/en/model_doc/bridgetower.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,11 @@ Tips:
[[autodoc]] BridgeTowerImageProcessor
- preprocess

## BridgeTowerImageProcessorFast

[[autodoc]] BridgeTowerImageProcessorFast
- preprocess

## BridgeTowerProcessor

[[autodoc]] BridgeTowerProcessor
Expand Down
5 changes: 5 additions & 0 deletions docs/source/ja/model_doc/bridgetower.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,11 @@ BridgeTower は、ビジュアル エンコーダー、テキスト エンコー
[[autodoc]] BridgeTowerImageProcessor
- preprocess

## BridgeTowerImageProcessorFast

[[autodoc]] BridgeTowerImageProcessorFast
- preprocess

## BridgeTowerProcessor

[[autodoc]] BridgeTowerProcessor
Expand Down
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 @@ -62,7 +62,7 @@
("bit", ("BitImageProcessor",)),
("blip", ("BlipImageProcessor", "BlipImageProcessorFast")),
("blip-2", ("BlipImageProcessor", "BlipImageProcessorFast")),
("bridgetower", ("BridgeTowerImageProcessor",)),
("bridgetower", ("BridgeTowerImageProcessor", "BridgeTowerImageProcessorFast")),
("chameleon", ("ChameleonImageProcessor",)),
("chinese_clip", ("ChineseCLIPImageProcessor",)),
("clip", ("CLIPImageProcessor", "CLIPImageProcessorFast")),
Expand Down
1 change: 1 addition & 0 deletions src/transformers/models/bridgetower/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
if TYPE_CHECKING:
from .configuration_bridgetower import *
from .image_processing_bridgetower import *
from .image_processing_bridgetower_fast import *
from .modeling_bridgetower import *
from .processing_bridgetower import *
else:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
infer_channel_dimension_format,
is_batched,
is_scaled_image,
make_flat_list_of_images,
to_numpy_array,
valid_images,
validate_preprocess_arguments,
Expand Down Expand Up @@ -455,7 +456,7 @@ def preprocess(
image_mean = image_mean if image_mean is not None else self.image_mean
image_std = image_std if image_std is not None else self.image_std
do_pad = do_pad if do_pad is not None else self.do_pad
do_center_crop if do_center_crop is not None else self.do_center_crop
do_center_crop = do_center_crop if do_center_crop is not None else self.do_center_crop
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch!

# For backwards compatibility. Initial version of this processor was cropping to the "size" argument, which
# it should default to if crop_size is undefined.
crop_size = (
Expand All @@ -464,6 +465,7 @@ def preprocess(

size = size if size is not None else self.size
size = get_size_dict(size, default_to_square=False)
images = make_flat_list_of_images(images)

if not is_batched(images):
images = [images]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be removed if we use make_flat_list_of_images

Expand Down
Loading