QwenLM / Qwen2-VL

Qwen2-VL is the multimodal large language model series developed by Qwen team, Alibaba Cloud.
Apache License 2.0
2.03k stars 116 forks source link

图片自动缩放存在问题 #220

Open verigle opened 1 day ago

verigle commented 1 day ago

当图片超过一定大小时,会自动缩小,例如原图69015420有可能可能会缩小到 23514 的分辨率,这个时候就会报错 报错代码: src/transformers/models/qwen2_vl/image_processing_qwen2_vl.py

if height < factor or width < factor:
        raise ValueError(f"height:{height} or width:{width} must be larger than factor:{factor}")

希望此处的代码之前增加一个padding 操作,避免因缩放问题而报错

ShuaiBai623 commented 17 hours ago

这主要针对太小的图的过滤,长或者宽小于28会抛出这个异常。如果想出来小尺寸图片,可以参考qwen-vl-util里的操作,直接resize到更大尺度