Documentation
¶
Index ¶
- Variables
- type Base
- func (b Base) BatchSize() int
- func (b Base) FeatureLimit() int
- func (p Base) GetFeaturesChecksum() string
- func (p Base) GetFeaturesPath() string
- func (p Base) GetFeaturesUrl() string
- func (p Base) GetGraphChecksum() string
- func (p Base) GetGraphPath() string
- func (p Base) GetGraphUrl() string
- func (p Base) GetInputLayerName(defaultValue string) string
- func (p Base) GetLayerName(typeParameters map[string]*dlframework.ModelManifest_Type_Parameter) (string, error)
- func (p Base) GetOutputLayerName(defaultValue string) string
- func (b Base) GetPredictionOptions(ctx context.Context) (*options.Options, error)
- func (p Base) GetPreprocessOptions(ctx context.Context) (PreprocessOptions, error)
- func (p Base) GetWeightsChecksum() string
- func (p Base) GetWeightsPath() string
- func (p Base) GetWeightsUrl() string
- func (b Base) Info() (dlframework.FrameworkManifest, dlframework.ModelManifest, error)
- func (b Base) TraceLevel() tracer.Level
- type ImagePredictor
- func (p ImagePredictor) Close() error
- func (p ImagePredictor) CreatePredictedFeatures(ctx context.Context, probabilities []float32, labels []string) ([]dlframework.Features, error)
- func (p ImagePredictor) GetColorMode(defaultMode types.Mode) types.Mode
- func (p ImagePredictor) GetImageDimensions() ([]int, error)
- func (p ImagePredictor) GetLayout(defaultLayout image.Layout) image.Layout
- func (p ImagePredictor) GetMeanImage() ([]float32, error)
- func (p ImagePredictor) GetMeanPath() string
- func (p ImagePredictor) GetScale() (float32, error)
- func (p ImagePredictor) Reset(ctx context.Context) error
- type Predictor
- type PreprocessOptions
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
WorkDir string
Options *options.Options
}
func (Base) FeatureLimit ¶
func (Base) GetFeaturesChecksum ¶
func (Base) GetFeaturesPath ¶
func (Base) GetFeaturesUrl ¶
func (Base) GetGraphChecksum ¶
func (Base) GetGraphPath ¶
func (Base) GetGraphUrl ¶
func (Base) GetInputLayerName ¶
func (Base) GetLayerName ¶
func (p Base) GetLayerName(typeParameters map[string]*dlframework.ModelManifest_Type_Parameter) (string, error)
func (Base) GetOutputLayerName ¶
func (Base) GetPredictionOptions ¶
func (Base) GetPreprocessOptions ¶
func (p Base) GetPreprocessOptions(ctx context.Context) (PreprocessOptions, error)
func (Base) GetWeightsChecksum ¶
func (Base) GetWeightsPath ¶
func (Base) GetWeightsUrl ¶
func (Base) Info ¶
func (b Base) Info() (dlframework.FrameworkManifest, dlframework.ModelManifest, error)
func (Base) TraceLevel ¶
type ImagePredictor ¶
func (ImagePredictor) Close ¶
func (p ImagePredictor) Close() error
func (ImagePredictor) CreatePredictedFeatures ¶
func (p ImagePredictor) CreatePredictedFeatures(ctx context.Context, probabilities []float32, labels []string) ([]dlframework.Features, error)
ReadPredictedFeatures ...
func (ImagePredictor) GetColorMode ¶
func (p ImagePredictor) GetColorMode(defaultMode types.Mode) types.Mode
func (ImagePredictor) GetImageDimensions ¶
func (p ImagePredictor) GetImageDimensions() ([]int, 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) GetScale ¶
func (p ImagePredictor) GetScale() (float32, error)
type Predictor ¶
type Predictor interface {
// Gets framework and model manifests
Info() (dlframework.FrameworkManifest, dlframework.ModelManifest, error)
// Downloads model from manifest
Download(ctx context.Context, model dlframework.ModelManifest, opts ...options.Option) 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 handle to features
Predict(ctx context.Context, data [][]float32, opts ...options.Option) error
// Returns the features
ReadPredictedFeatures(ctx context.Context) ([]dlframework.Features, error)
// Clears the internal state of a predictor
Reset(ctx context.Context) error
io.Closer
}
Click to show internal directories.
Click to hide internal directories.