KERAS_WRAPPER$image_to_array {autovi}R Documentation

Load an image as numpy array

Description

This function loads an image from file and convert it to a numpy array.

Usage

KERAS_WRAPPER$image_to_array(
  path,
  height = self$get_input_height(),
  width = self$get_input_width()
)

Arguments

path

Character. Path to the image.

height

Integer. Target height of the image.

width

Integer. Target width of the image.

Value

A numpy array.

Examples

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
}


[Package autovi version 0.4.0 Index]