KERAS_WRAPPER$image_to_array {autovi} | R Documentation |
This function loads an image from file and convert it to a numpy array.
KERAS_WRAPPER$image_to_array( path, height = self$get_input_height(), width = self$get_input_width() )
path |
Character. Path to the image. |
height |
Integer. Target height of the image. |
width |
Integer. Target width of the image. |
A numpy array.
p <- ggplot2::ggplot(cars) + ggplot2::geom_point(ggplot2::aes(dist, speed))
path <- save_plot(p)
result <- try(KERAS_WRAPPER$image_to_array(path, 32L, 32L))
if (!inherits(result, "try-error")) {
result
}