Read an image in JuliaHub with DataSets

Cheers,

I have a number of images in a folder, stored in the Data area in JuliaHub. Apparently, package DataSets is used to read an image in it. For instance:

using DataSets
using Images
path = "ciro-rosa-583/figs"
tree=open(BlobTree, dataset(path))
imgs = tree["padded"]["images"]
imgf = imgs["2011_003256.jpg"]
jpeg_data = read(imgf)

The “image” in jpeg_data is represented as a UInt8 vector. Could not find a way to convert it back to the original (512,512) RGB image.

Alternatively, is there a way to create a symlink in the project which points out to the main dataset folder? Could not find storage location in the shell.

Thanks in advance for advising.

1 Like

Ah, I don’t think you’re reading what you think you are there. When you have a “BlobTree” like this, you need two open steps — you first open the tree itself and then you can open an individual file.

I think you want something like:

jpeg_data = open(Images.load, IO, imgf)
1 Like