Documentation ¶
Index ¶
- Variables
- type Base
- func (b Base) BatchSize() int
- func (b Base) FeatureLimit() int
- func (b Base) GPUMetrics() string
- func (p Base) GetFeaturesUrl() string
- func (p Base) GetGraphChecksum() string
- func (p Base) GetGraphPath() string
- func (p Base) GetGraphUrl() string
- func (b Base) GetPredictionOptions() (*options.Options, error)
- func (p Base) GetPreprocessOptions() (PreprocessOptions, error)
- func (p Base) GetTypeParameter(typeParameters map[string]*dlframework.ModelManifest_Type_Parameter, ...) (string, 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) Modality() (dlframework.Modality, error)
- func (b Base) TraceLevel() tracer.Level
- func (b Base) UseGPU() bool
- type ImagePredictor
- func (p ImagePredictor) Close() error
- func (p ImagePredictor) CreateBoundingBoxFeatures(ctx context.Context, probabilities0 interface{}, classes0 interface{}, ...) ([]dlframework.Features, error)
- func (p ImagePredictor) CreateBoundingBoxFeaturesFlattened(ctx context.Context, probabilities []float32, classes []float32, ...) ([]dlframework.Features, error)
- func (p ImagePredictor) CreateBoundingBoxFeaturesUnflattened(ctx context.Context, probabilities [][]float32, classes [][]float32, ...) ([]dlframework.Features, error)
- func (p ImagePredictor) CreateClassificationFeatures(ctx context.Context, probabilities0 interface{}, labels []string) ([]dlframework.Features, error)
- func (p ImagePredictor) CreateClassificationFeaturesFrom1D(ctx context.Context, probabilities []float32, labels []string) ([]dlframework.Features, error)
- func (p ImagePredictor) CreateClassificationFeaturesFrom2D(ctx context.Context, probabilities [][]float32, labels []string) ([]dlframework.Features, error)
- func (p ImagePredictor) CreateImageFeatures(ctx context.Context, images [][][][]float32) ([]dlframework.Features, error)
- func (p ImagePredictor) CreateInstanceSegmentFeatures(ctx context.Context, probabilities [][]float32, classes [][]float32, ...) ([]dlframework.Features, error)
- func (p ImagePredictor) CreateRawImageFeatures(ctx context.Context, images [][][][]float32) ([]dlframework.Features, error)
- func (p ImagePredictor) CreateSemanticSegmentFeatures(ctx context.Context, masks0 interface{}, labels []string) ([]dlframework.Features, error)
- func (p ImagePredictor) CreateSemanticSegmentFeaturesFrom2D(ctx context.Context, masks [][][]int64, labels []string) ([]dlframework.Features, error)
- func (p ImagePredictor) GetBackgroundIndex() (bool, int)
- func (p ImagePredictor) GetBoxIndex() []int
- func (p ImagePredictor) GetBoxScaling() (float32, float32)
- func (p ImagePredictor) GetColorMode(defaultMode types.Mode) types.Mode
- func (p ImagePredictor) GetCropMethod(defaultMethod cutter.AnchorMode) cutter.AnchorMode
- func (p ImagePredictor) GetCropRatio(defaultCropRatio float32) float32
- func (p ImagePredictor) GetFeatureType() dlframework.FeatureType
- func (p ImagePredictor) GetFeaturesChecksum() string
- func (p ImagePredictor) GetFeaturesPath() string
- func (p ImagePredictor) GetInputDimensions() ([]int, error)
- func (p ImagePredictor) GetInputLayerName(layer string) (string, error)
- func (p ImagePredictor) GetKeepAspectRatio() (bool, error)
- func (p ImagePredictor) GetLabels() ([]string, error)
- func (p ImagePredictor) GetLayout(defaultLayout raiimage.Layout) raiimage.Layout
- func (p ImagePredictor) GetMaxDimension() (int, error)
- func (p ImagePredictor) GetMeanImage() ([]float32, error)
- func (p ImagePredictor) GetMeanPath() string
- func (p ImagePredictor) GetOutputLayerIndex(layer string) (int, error)
- func (p ImagePredictor) GetPreprocessOptions() (PreprocessOptions, error)
- func (p ImagePredictor) GetProbabilitiesTransform() string
- func (p ImagePredictor) GetScale() ([]float32, error)
- func (p ImagePredictor) Reset(ctx context.Context) error
- type Predictor
- type PreprocessOptions
- type RawPredictor
- func (p RawPredictor) Close() error
- func (p RawPredictor) GetInputDataByIdx(idx int) ([]interface{}, error)
- func (p RawPredictor) GetInputParams(name string) ([]string, error)
- func (p RawPredictor) GetInputParamsByIdx(idx int, name string) (string, error)
- func (p RawPredictor) GetInputURLs() ([]string, error)
- func (p RawPredictor) GetOutputLayerName(layer string) (string, error)
- func (p RawPredictor) ReadPredictedFeatures(ctx context.Context) ([]dlframework.Features, error)
- func (p RawPredictor) Reset(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DefaultInputLayerName = "input" DefaultOutputLayerNames = []string{"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) GPUMetrics ¶
func (Base) GetFeaturesUrl ¶
func (Base) GetGraphChecksum ¶
func (Base) GetGraphPath ¶
func (Base) GetGraphUrl ¶
func (Base) GetPreprocessOptions ¶
func (p Base) GetPreprocessOptions() (PreprocessOptions, error)
func (Base) GetTypeParameter ¶
func (p Base) GetTypeParameter(typeParameters map[string]*dlframework.ModelManifest_Type_Parameter, name string) (string, 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) CreateBoundingBoxFeatures ¶
func (p ImagePredictor) CreateBoundingBoxFeatures(ctx context.Context, probabilities0 interface{}, classes0 interface{}, boxes0 interface{}, labels []string) ([]dlframework.Features, error)
func (ImagePredictor) CreateBoundingBoxFeaturesFlattened ¶
func (p ImagePredictor) CreateBoundingBoxFeaturesFlattened(ctx context.Context, probabilities []float32, classes []float32, boxes []float32, labels []string) ([]dlframework.Features, error)
func (ImagePredictor) CreateBoundingBoxFeaturesUnflattened ¶
func (p ImagePredictor) CreateBoundingBoxFeaturesUnflattened(ctx context.Context, probabilities [][]float32, classes [][]float32, boxes [][][]float32, labels []string) ([]dlframework.Features, error)
func (ImagePredictor) CreateClassificationFeatures ¶
func (p ImagePredictor) CreateClassificationFeatures(ctx context.Context, probabilities0 interface{}, labels []string) ([]dlframework.Features, error)
func (ImagePredictor) CreateClassificationFeaturesFrom1D ¶
func (p ImagePredictor) CreateClassificationFeaturesFrom1D(ctx context.Context, probabilities []float32, labels []string) ([]dlframework.Features, error)
func (ImagePredictor) CreateClassificationFeaturesFrom2D ¶
func (p ImagePredictor) CreateClassificationFeaturesFrom2D(ctx context.Context, probabilities [][]float32, labels []string) ([]dlframework.Features, error)
func (ImagePredictor) CreateImageFeatures ¶
func (p ImagePredictor) CreateImageFeatures(ctx context.Context, images [][][][]float32) ([]dlframework.Features, error)
func (ImagePredictor) CreateInstanceSegmentFeatures ¶
func (ImagePredictor) CreateRawImageFeatures ¶
func (p ImagePredictor) CreateRawImageFeatures(ctx context.Context, images [][][][]float32) ([]dlframework.Features, error)
func (ImagePredictor) CreateSemanticSegmentFeatures ¶
func (p ImagePredictor) CreateSemanticSegmentFeatures(ctx context.Context, masks0 interface{}, labels []string) ([]dlframework.Features, error)
func (ImagePredictor) CreateSemanticSegmentFeaturesFrom2D ¶
func (p ImagePredictor) CreateSemanticSegmentFeaturesFrom2D(ctx context.Context, masks [][][]int64, labels []string) ([]dlframework.Features, error)
func (ImagePredictor) GetBackgroundIndex ¶ added in v0.3.2
func (p ImagePredictor) GetBackgroundIndex() (bool, int)
func (ImagePredictor) GetBoxIndex ¶ added in v0.3.2
func (p ImagePredictor) GetBoxIndex() []int
func (ImagePredictor) GetBoxScaling ¶ added in v0.3.3
func (p ImagePredictor) GetBoxScaling() (float32, float32)
func (ImagePredictor) GetColorMode ¶
func (p ImagePredictor) GetColorMode(defaultMode types.Mode) types.Mode
func (ImagePredictor) GetCropMethod ¶
func (p ImagePredictor) GetCropMethod(defaultMethod cutter.AnchorMode) cutter.AnchorMode
func (ImagePredictor) GetCropRatio ¶
func (p ImagePredictor) GetCropRatio(defaultCropRatio float32) float32
func (ImagePredictor) GetFeatureType ¶
func (p ImagePredictor) GetFeatureType() dlframework.FeatureType
func (ImagePredictor) GetFeaturesChecksum ¶
func (p ImagePredictor) GetFeaturesChecksum() string
func (ImagePredictor) GetFeaturesPath ¶
func (p ImagePredictor) GetFeaturesPath() string
func (ImagePredictor) GetInputDimensions ¶
func (p ImagePredictor) GetInputDimensions() ([]int, error)
func (ImagePredictor) GetInputLayerName ¶
func (p ImagePredictor) GetInputLayerName(layer string) (string, error)
func (ImagePredictor) GetKeepAspectRatio ¶
func (p ImagePredictor) GetKeepAspectRatio() (bool, error)
func (ImagePredictor) GetLabels ¶
func (p ImagePredictor) GetLabels() ([]string, error)
func (ImagePredictor) GetLayout ¶
func (p ImagePredictor) GetLayout(defaultLayout raiimage.Layout) raiimage.Layout
func (ImagePredictor) GetMaxDimension ¶
func (p ImagePredictor) GetMaxDimension() (int, error)
func (ImagePredictor) GetMeanImage ¶
func (p ImagePredictor) GetMeanImage() ([]float32, error)
func (ImagePredictor) GetMeanPath ¶
func (p ImagePredictor) GetMeanPath() string
func (ImagePredictor) GetOutputLayerIndex ¶
func (p ImagePredictor) GetOutputLayerIndex(layer string) (int, error)
func (ImagePredictor) GetPreprocessOptions ¶
func (p ImagePredictor) GetPreprocessOptions() (PreprocessOptions, error)
func (ImagePredictor) GetProbabilitiesTransform ¶
func (p ImagePredictor) GetProbabilitiesTransform() 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) // Gets predictor's Modality Modality() (dlframework.Modality, 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() (*options.Options, error) // Returns the preprocess options GetPreprocessOptions() (PreprocessOptions, error) // Returns the handle to features Predict(ctx context.Context, data interface{}, 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 }
type PreprocessOptions ¶
type RawPredictor ¶
func (RawPredictor) Close ¶
func (p RawPredictor) Close() error
func (RawPredictor) GetInputDataByIdx ¶
func (p RawPredictor) GetInputDataByIdx(idx int) ([]interface{}, error)
func (RawPredictor) GetInputParams ¶
func (p RawPredictor) GetInputParams(name string) ([]string, error)
func (RawPredictor) GetInputParamsByIdx ¶
func (p RawPredictor) GetInputParamsByIdx(idx int, name string) (string, error)
func (RawPredictor) GetInputURLs ¶
func (p RawPredictor) GetInputURLs() ([]string, error)
func (RawPredictor) GetOutputLayerName ¶
func (p RawPredictor) GetOutputLayerName(layer string) (string, error)
func (RawPredictor) ReadPredictedFeatures ¶
func (p RawPredictor) ReadPredictedFeatures(ctx context.Context) ([]dlframework.Features, error)
Click to show internal directories.
Click to hide internal directories.