package torch

  1. Overview
  2. Docs
val load_image : ?resize:(Base.int * Base.int) -> Base.string -> Torch.Tensor.t Base.Or_error.t

load_image ?resize filename returns a tensor containing the pixels for the image in filename. Supported image formats are JPEG and PNG. The resulting tensor has dimensions NCHW (with N = 1). When resize is set, the image is first resized preserving its original ratio then a center crop is taken.

val load_images : ?resize:(Base.int * Base.int) -> Base.string -> Torch.Tensor.t

load_images ?resize dir_name is similar to applying load_image to all the images in dir_name. The resulting tensor has dimensions NCHW where N is the number of images.

val load_dataset : dir:Base.string -> classes:Base.string Base.list -> with_cache:Base.string Base.option -> resize:(Base.int * Base.int) -> Torch.Dataset_helper.t
val write_image : Torch.Tensor.t -> filename:Base.string -> Base.unit
module Loader : sig ... end
OCaml

Innovation. Community. Security.