Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Qwen-VL是否支持bytes类型的图片输入? #112

Closed
DZ9 opened this issue Oct 12, 2023 · 2 comments
Closed

Qwen-VL是否支持bytes类型的图片输入? #112

DZ9 opened this issue Oct 12, 2023 · 2 comments

Comments

@DZ9
Copy link

DZ9 commented Oct 12, 2023

看了下目前的接口,图片输入都是基于本地或者http请求的,但是实际使用中拿到的图片输入需要crop之后再输入,无法提供crop之后图片的地址,Qwen-VL是否可以直接输入image bytes来进行训练和推理呢

@ShuaiBai623
Copy link
Collaborator

目前犹豫文件名长度和图像压缩长度会有冲突,没法直接用image bytes训练和推理,一个方案是中间做一次转存

def decode_base64_to_image(base64_string) -> Image:
    """Convert raw data into Pillow image."""
    image_data = base64.b64decode(base64_string)
    image = Image.open(io.BytesIO(image_data))
    return image
image = decode_base64_to_image(image_ bytes)
image.save("tmp/%d.jpg"%index)

@xinmaoge
Copy link

同样的问题,有办法解决了吗

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants