if (FALSE) {
ds <- coco_caption_dataset(
train = FALSE,
download = TRUE
)
example <- ds[1]
# Access image and caption
x <- example$x
y <- example$y
# Prepare image for plotting
image_array <- as.numeric(x)
dim(image_array) <- dim(x)
plot(as.raster(image_array))
title(main = y, col.main = "black")
}
Run the code above in your browser using DataLab