imqol

package
v0.0.0-...-708736a Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func JPEG

func JPEG(f io.Reader, opts ...FnOpt) (*tensor.Dense, error)

JPEG loads a JPEG file into a *tensor.Dense of HWC format.

Example
filename := "testdata/smile.jpeg"
f, err := os.Open(filename)
if err != nil {
	fmt.Printf("ERR: %v\n", err)
}

t, err := JPEG(f)
if err != nil {
	fmt.Printf("ERR: %v\n", err)
}

fmt.Printf("%v %v", t.Shape(), t.Dtype)
Output:

(12, 14, 4) float64

func PNG

func PNG(f io.Reader, opts ...FnOpt) (*tensor.Dense, error)

PNG loads a PNG file into a *tensor.Dense of HWC format

Example
filename := "testdata/smile.png"
f, err := os.Open(filename)
if err != nil {
	fmt.Printf("ERR: %v\n", err)
}

t, err := PNG(f)
if err != nil {
	fmt.Printf("ERR: %v\n", err)
}

fmt.Printf("%v %v", t.Shape(), t.Dtype())
Output:

(12, 14, 4) float64

Types

type AsType

type AsType int

AsType is a construction option

const (
	AsFloat64 AsType = iota
	AsFloat32
)

type FnOpt

type FnOpt interface {
	// contains filtered or unexported methods
}

FnOpt is an option to configure the running of a function.

Jump to

Keyboard shortcuts

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