-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[Feature Request]: ImageLoader should also load images from remote URLs, not just local URIs #2401
Comments
@ahron1 looking at the PR you opened - and reviewing the multimodal docs - I think that this functionality should be in a new loader class... something like |
Thanks for checking! Indeed, it is better to split it off. With @tazarov 's idea about adding in authentication, it becomes a standalone remote image loader. |
I agree that this ought to be standalone, though the counter-argument is that other data loaders, e.g. HuggingFace |
HuggingFace was why I originally thought of handling both URIs and URLs together. But indeed, here it should be standalone. I just pushed the changes. |
Hi @atroyn any update on this? |
Describe the problem
Currently, the
ImageLoader
data loader loads only locally stored images.For loading remote images, one needs to write a wrapper to fetch the images first. It will be very helpful
ImageLoader
would also directly load remote images over HTTP/S.Describe the proposed solution
It is an easy fix. Just add an extra block to the
_load_image
definition inImageLoader
, to check if it is a remote or local URI. If it is a HTTP/S URI, use PIL and BytesIO to fetch the image before converting it to a NumPy array.I already have the code working locally. Happy to submit a PR if people are open to the idea.
Alternatives considered
No response
Importance
would make my life easier
Additional Information
No response
The text was updated successfully, but these errors were encountered: