predict

package
v0.0.0-...-eb0b993 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2018 License: NCSA Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultInputLayerName  = "input"
	DefaultOutputLayerName = "output"
)

Functions

This section is empty.

Types

type Base

type Base struct {
	Framework dlframework.FrameworkManifest
	Model     dlframework.ModelManifest
	Options   *options.Options
}

func (Base) BatchSize

func (b Base) BatchSize() uint32

func (Base) GetPredictionOptions

func (b Base) GetPredictionOptions(ctx context.Context) (*options.Options, error)

func (Base) TraceLevel

func (b Base) TraceLevel() tracer.Level

type ImagePredictor

type ImagePredictor struct {
	Base
	WorkDir string
}

func (ImagePredictor) Close

func (p ImagePredictor) Close() error

func (ImagePredictor) GetColorMode

func (p ImagePredictor) GetColorMode(defaultMode types.Mode) types.Mode

func (ImagePredictor) GetFeaturesChecksum

func (p ImagePredictor) GetFeaturesChecksum() string

func (ImagePredictor) GetFeaturesPath

func (p ImagePredictor) GetFeaturesPath() string

func (ImagePredictor) GetFeaturesUrl

func (p ImagePredictor) GetFeaturesUrl() string

func (ImagePredictor) GetGraphChecksum

func (p ImagePredictor) GetGraphChecksum() 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) GetInputLayerName

func (p ImagePredictor) GetInputLayerName(defaultValue string) string

func (ImagePredictor) GetLayerName

func (p ImagePredictor) GetLayerName(typeParameters map[string]*dlframework.ModelManifest_Type_Parameter) (string, error)

func (ImagePredictor) GetLayout

func (p ImagePredictor) GetLayout(defaultLayout image.Layout) image.Layout

func (ImagePredictor) GetMeanImage

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

func (ImagePredictor) GetMeanPath

func (p ImagePredictor) GetMeanPath() string

func (ImagePredictor) GetOutputLayerName

func (p ImagePredictor) GetOutputLayerName(defaultValue string) string

func (ImagePredictor) GetPreprocessOptions

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

func (ImagePredictor) GetScale

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

func (ImagePredictor) GetWeightsChecksum

func (p ImagePredictor) GetWeightsChecksum() string

func (ImagePredictor) GetWeightsPath

func (p ImagePredictor) GetWeightsPath() string

func (ImagePredictor) GetWeightsUrl

func (p ImagePredictor) GetWeightsUrl() string

func (ImagePredictor) Reset

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, opts ...options.Option) (Predictor, error)
	// Returns the prediction options
	GetPredictionOptions(ctx context.Context) (*options.Options, error)
	// Returns the preprocess options
	GetPreprocessOptions(ctx context.Context) (PreprocessOptions, error)
	// Returns the features
	Predict(ctx context.Context, data [][]float32, opts ...options.Option) ([]dlframework.Features, error)
	// Clears the internal state of a predictor
	Reset(ctx context.Context) error

	io.Closer
}

type PreprocessOptions

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

Jump to

Keyboard shortcuts

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