if (FALSE) {
# Load the small plankton dataset and turn images into tensor images
plankton <- whoi_small_plankton_dataset(download = TRUE, transform = transform_to_tensor)
# Access the first item
first_item <- plankton[1]
first_item$x # a tensor grayscale image with shape {1, H, W}
first_item$y # id of the plankton class.
plankton$classes[first_item$y] # name of the plankton class
# Load the full plankton dataset
plankton <- whoi_plankton_dataset(download = TRUE)
# Access the first item
first_item <- plankton[1]
first_item$x # grayscale image array with shape {H, W}
first_item$y # id of the plankton class.
}
Run the code above in your browser using DataLab