Skip to content

Missing check for Image instance for | from diffusers.utils import load_image #6865

@nikhil-swamix

Description

@nikhil-swamix

Describe the bug

check load_image method here, https://huggingface.co/transformers/v4.11.3/_modules/transformers/pipelines/image_classification.html ,
and check this image at path "C:\Users\User\AppData\Local\Programs\Python\Python311\Lib\site-packages\diffusers\utils\loading_utils.py"

image

compare

image

Reproduction

def imgloader(im, sz=512):
    im = Image.open(im)
    width, height = im.size
    # im = im.resize((sz, sz * height // width))
    print(im)
    # convert to Image instance
    # im = Image.open(im)
    return im

print(isinstance(imgloader("base2.png"), Image.Image))
load_image(imgloader("base2.png"))

throws error

Logs

No response

System Info

source code issue i believe, platform independent

Who can help?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions