Sign up to take part
Registered users can ask their own questions, contribute to discussions, and be part of the Community!
Registered users can ask their own questions, contribute to discussions, and be part of the Community!
Hi,
I am trying to access image files in a sub-folder of the managed folder that is mapped to S3.
Could you guide me how to do that?
My current code works if image is directly under managed folder but not if it is under subfolder.
For testing if i map subfolder directly to managed folder, i can access images.
Thanks,
Raghu
Hi,
This should work to access the images directly:
import dataiku
images_folder = dataiku.Folder('folder')
from PIL import Image
plt.figure(figsize=(20,100))
files = images_folder.list_paths_in_partition()
for file in files:
with images_folder.get_download_stream(path=file) as stream:
img = Image.open(stream)
plt.imshow(img)
plt.show()
Thanks!
Jordan
Hi,
This should work to access the images directly:
import dataiku
images_folder = dataiku.Folder('folder')
from PIL import Image
plt.figure(figsize=(20,100))
files = images_folder.list_paths_in_partition()
for file in files:
with images_folder.get_download_stream(path=file) as stream:
img = Image.open(stream)
plt.imshow(img)
plt.show()
Thanks!
Jordan