Don't use min_pixels/max_pixels from Qwen2VL's processor (#33208)
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
This commit is contained in:
@@ -841,8 +841,8 @@ class Qwen2VLProcessingInfo(BaseProcessingInfo):
|
|||||||
height=image_height,
|
height=image_height,
|
||||||
width=image_width,
|
width=image_width,
|
||||||
factor=patch_size * merge_size,
|
factor=patch_size * merge_size,
|
||||||
min_pixels=image_processor.min_pixels,
|
min_pixels=image_processor.size["shortest_edge"],
|
||||||
max_pixels=image_processor.max_pixels,
|
max_pixels=image_processor.size["longest_edge"],
|
||||||
)
|
)
|
||||||
preprocessed_size = ImageSize(width=resized_width, height=resized_height)
|
preprocessed_size = ImageSize(width=resized_width, height=resized_height)
|
||||||
else:
|
else:
|
||||||
@@ -914,9 +914,7 @@ class Qwen2VLProcessingInfo(BaseProcessingInfo):
|
|||||||
merge_size = vision_config.spatial_merge_size
|
merge_size = vision_config.spatial_merge_size
|
||||||
if max_pixels is None:
|
if max_pixels is None:
|
||||||
image_processor = self.get_image_processor()
|
image_processor = self.get_image_processor()
|
||||||
max_pixels = (
|
max_pixels = image_processor.size["longest_edge"]
|
||||||
image_processor.max_pixels or image_processor.size["longest_edge"]
|
|
||||||
)
|
|
||||||
unit = patch_size * merge_size
|
unit = patch_size * merge_size
|
||||||
max_seq_len = max_pixels // (unit * unit)
|
max_seq_len = max_pixels // (unit * unit)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user