gotflite

package module
v0.0.0-...-0bcc4df Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2019 License: MIT Imports: 5 Imported by: 0

README

gotflite

Go binding for tensorflow lite with gomobile react native examples

Tested on MobileNetV2 (see example for usage).

tensorflow lite code is included to make it go gettable. go get could take up to a few minutes.

Documentation

Overview

https://github.com/gonum/floats/blob/master/floats.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Argsort

func Argsort(dst []float32, inds []int)

Argsort sorts the elements of s while tracking their original order. At the conclusion of Argsort, s will contain the original elements of s but sorted in increasing order, and inds will contain the original position of the elements in the slice such that dst[i] = origDst[inds[i]]. It panics if the lengths of dst and inds do not match.

func InputFrom

func InputFrom(img image.Image, mean, std float32) ([]float32, error)

Types

type Predictor

type Predictor struct {
	Name string

	ImageProcessor func(img image.Image, width, height int) image.Image
	// contains filtered or unexported fields
}

func NewPredictor

func NewPredictor(modelFile string, imageWidth, imageHeight int, outputTensorIndex int) (*Predictor, error)

func (*Predictor) Cleanup

func (p *Predictor) Cleanup()

func (*Predictor) Run

func (p *Predictor) Run(img image.Image) (output []float32, err error)

Directories

Path Synopsis
example

Jump to

Keyboard shortcuts

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