Skip to content

Allow Path type in transformers.image_utils.load_image function#43382

Open
mrdbourke wants to merge 3 commits into
huggingface:mainfrom
mrdbourke:patch-1
Open

Allow Path type in transformers.image_utils.load_image function#43382
mrdbourke wants to merge 3 commits into
huggingface:mainfrom
mrdbourke:patch-1

Conversation

@mrdbourke

Copy link
Copy Markdown

Updated transformers.image_utils.load_image helper function to accept Path type for image input.

I've been extracting images from folders with pathlib so added a simple fix to load_image to allow Path types as input.

Updated load_image function to accept Path type for image input.

@Rocketknight1 Rocketknight1 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, but the code is self-explanatory without the comment!

Comment thread src/transformers/image_utils.py Outdated
@Rocketknight1

Copy link
Copy Markdown
Member

@bot /style

@github-actions

Copy link
Copy Markdown
Contributor

Style fix is beginning .... View the workflow run here.

@Rocketknight1 Rocketknight1 enabled auto-merge (squash) January 21, 2026 13:19
@HuggingFaceDocBuilderDev

Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@github-actions

Copy link
Copy Markdown
Contributor

View the CircleCI Test Summary for this PR:

https://huggingface.co/spaces/transformers-community/circle-ci-viz?pr=43382&sha=3857c1

@Rocketknight1

Copy link
Copy Markdown
Member

Red CI due to torch 2.10 issues, we'll pin 2.9 and try rerunning

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

Successfully merging this pull request may close these issues.

3 participants