predict

package
v0.2.17 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2017 License: NCSA Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Base

type Base struct {
	Framework dlframework.FrameworkManifest
	Model     dlframework.ModelManifest
}

func (Base) Info added in v0.2.16

type ImagePredictor

type ImagePredictor struct {
	Base
	WorkDir string
}

func (ImagePredictor) Close added in v0.2.16

func (p ImagePredictor) Close() error

func (ImagePredictor) GetFeaturesPath

func (p ImagePredictor) GetFeaturesPath() string

func (ImagePredictor) GetFeaturesUrl

func (p ImagePredictor) GetFeaturesUrl() string

func (ImagePredictor) GetGraphPath

func (p ImagePredictor) GetGraphPath() string

func (ImagePredictor) GetGraphUrl

func (p ImagePredictor) GetGraphUrl() string

func (ImagePredictor) GetImageDimensions

func (p ImagePredictor) GetImageDimensions() ([]uint32, error)

func (ImagePredictor) GetMeanImage

func (p ImagePredictor) GetMeanImage() ([]float32, error)

func (ImagePredictor) GetMeanPath

func (p ImagePredictor) GetMeanPath() string

func (ImagePredictor) GetScale

func (p ImagePredictor) GetScale() (float32, error)

func (ImagePredictor) GetWeightsPath

func (p ImagePredictor) GetWeightsPath() string

func (ImagePredictor) GetWeightsUrl

func (p ImagePredictor) GetWeightsUrl() string

func (ImagePredictor) PreprocessOptions added in v0.2.16

func (p ImagePredictor) PreprocessOptions(ctx context.Context) (PreprocessOptions, error)

func (ImagePredictor) Reset added in v0.2.16

func (p ImagePredictor) Reset(ctx context.Context) error

type Predictor

type Predictor interface {
	// Gets framework and model manifests
	Info() (dlframework.FrameworkManifest, dlframework.ModelManifest, error)
	// Load model from manifest
	Load(ctx context.Context, model dlframework.ModelManifest) (Predictor, error)
	// Returns the preprocess options
	PreprocessOptions(ctx context.Context) (PreprocessOptions, error)
	// Returns the features
	Predict(ctx context.Context, data []float32) (dlframework.Features, error)
	// Clears the internal state of a predictor
	Reset(ctx context.Context) error

	io.Closer
}

type PreprocessOptions added in v0.2.16

type PreprocessOptions struct {
	MeanImage []float32
	Size      []int
	Scale     float32
	ColorMode types.Mode
}

Jump to

Keyboard shortcuts

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