if (FALSE) {
# Multi-class version
oxford <- oxfordiiitpet_dataset(download = TRUE)
first_item <- oxford[1]
first_item$x # RGB image
first_item$y # Label in 1–37
oxford$classes[first_item$y] # Breed name
# Binary version
oxford_bin <- oxfordiiitpet_binary_dataset(download = TRUE)
first_item <- oxford_bin[1]
first_item$x # RGB image
first_item$y # 1 for Cat, 2 for Dog
oxford_bin$classes[first_item$y] # "Cat" or "Dog"
}
Run the code above in your browser using DataLab