tensorimage

package
v0.0.0-...-f691888 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 11, 2019 License: AGPL-3.0 Imports: 7 Imported by: 0

README

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GrayToBCHW

func GrayToBCHW(img *image.Gray, dst tensor.Tensor) error

GrayToBCHW convert an image to a BCHW tensor this function returns an error if:

  • dst is not a pointer
  • dst's shape is not 4
  • dst' second dimension is not 1
  • dst's third dimension != i.Bounds().Dy()
  • dst's fourth dimension != i.Bounds().Dx()
  • dst's type is not float32 or float64 (temporary)

func ImageToBCHW

func ImageToBCHW(img image.Image, dst tensor.Tensor) error

ImageToBCHW convert an image to a BCHW tensor this function returns an error if:

  • dst is not a pointer
  • dst's shape is not 4
  • dst' second dimension is not 1
  • dst's third dimension != i.Bounds().Dy()
  • dst's fourth dimension != i.Bounds().Dx()
  • dst's type is not float32 or float64 (temporary)

func TensorToImg

func TensorToImg(t tensor.Tensor) (image.Image, error)

TensorToImg turn a BCHW tensor into an image (BCHW with B=1)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL