deeplake icon indicating copy to clipboard operation
deeplake copied to clipboard

[BUG] np.array(hub.read(path)) fails if path is remote url

Open farizrahman4u opened this issue 3 years ago • 2 comments

🐛🐛 Bug Report

⚗️ Current Behavior

image = hub.read("https://picsum.photos/200/300")
print(np.array(image))  # >> fails with file not found error

Expected behavior/code The remote image should be downloaded and decompressed

🧰 Possible Solution

Check if path is a remote path before calling Pillow here: https://github.com/activeloopai/Hub/blob/main/hub/core/sample.py#L236 (If remote path, read the bytes and then pass the bytes to pillow.)

farizrahman4u avatar Mar 15 '22 08:03 farizrahman4u

I would like to work on this.

gaurav879 avatar Mar 18 '22 18:03 gaurav879

Hi @gaurav879 ! Go for it:)

tatevikh avatar Mar 18 '22 18:03 tatevikh