Skip to content

How can I view huggingface dataset images? #2747

Answered by jaychia
asmith26 asked this question in Q&A
Discussion options

You must be logged in to vote

Oh interesting. Looks like this particular dataset stores images as some kind of struct column, with both the URL and bytes for some reason 🤷

You can try:

df = df.with_column("decoded_image", daft.col("image.bytes").image.decode())

.image.decode() works on a binary column, which in this case is a nested column under the image struct column.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@asmith26
Comment options

Answer selected by asmith26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants