Documentation ¶
Index ¶
- func ElementTypeSliceToTensor(data [][]ElementType, shape []int64) (*tf.Tensor, error)
- func Float32SliceToTensor(data [][]float32, shape []int64) (*tf.Tensor, error)
- func Float64SliceToTensor(data [][]float64, shape []int64) (*tf.Tensor, error)
- func Int16SliceToTensor(data [][]int16, shape []int64) (*tf.Tensor, error)
- func Int32SliceToTensor(data [][]int32, shape []int64) (*tf.Tensor, error)
- func Int64SliceToTensor(data [][]int64, shape []int64) (*tf.Tensor, error)
- func Int8SliceToTensor(data [][]int8, shape []int64) (*tf.Tensor, error)
- func NewImageClassificationPredictor(model dlframework.ModelManifest, opts ...options.Option) (common.Predictor, error)
- func NewImageEnhancementPredictor(model dlframework.ModelManifest, opts ...options.Option) (common.Predictor, error)
- func NewInstanceSegmentationPredictor(model dlframework.ModelManifest, opts ...options.Option) (common.Predictor, error)
- func NewObjectDetectionPredictor(model dlframework.ModelManifest, opts ...options.Option) (common.Predictor, error)
- func NewRawPredictor(model dlframework.ModelManifest, opts ...options.Option) (common.Predictor, error)
- func NewSemanticSegmentationPredictor(model dlframework.ModelManifest, opts ...options.Option) (common.Predictor, error)
- func Uint16SliceToTensor(data [][]uint16, shape []int64) (*tf.Tensor, error)
- func Uint32SliceToTensor(data [][]uint32, shape []int64) (*tf.Tensor, error)
- func Uint64SliceToTensor(data [][]uint64, shape []int64) (*tf.Tensor, error)
- func Uint8SliceToTensor(data [][]uint8, shape []int64) (*tf.Tensor, error)
- type Device
- type ElementType
- type Graph
- type ImageClassificationPredictor
- func (self *ImageClassificationPredictor) Load(ctx context.Context, modelManifest dlframework.ModelManifest, ...) (common.Predictor, error)
- func (p ImageClassificationPredictor) Modality() (dlframework.Modality, error)
- func (p *ImageClassificationPredictor) Predict(ctx context.Context, data interface{}, opts ...options.Option) error
- func (p *ImageClassificationPredictor) ReadPredictedFeatures(ctx context.Context) ([]dlframework.Features, error)
- type ImageEnhancementPredictor
- func (self *ImageEnhancementPredictor) Load(ctx context.Context, modelManifest dlframework.ModelManifest, ...) (common.Predictor, error)
- func (p ImageEnhancementPredictor) Modality() (dlframework.Modality, error)
- func (p *ImageEnhancementPredictor) Predict(ctx context.Context, data interface{}, opts ...options.Option) error
- func (p *ImageEnhancementPredictor) ReadPredictedFeatures(ctx context.Context) ([]dlframework.Features, error)
- type ImagePredictor
- func (p *ImagePredictor) Close() error
- func (p *ImagePredictor) Download(ctx context.Context, model dlframework.ModelManifest, opts ...options.Option) error
- func (p *ImagePredictor) GetInputLayerName(reader io.Reader, layer string) (string, error)
- func (p *ImagePredictor) GetOutputLayerName(reader io.Reader, layer string) (string, error)
- func (p *ImagePredictor) GetOutputParameter(key string) string
- func (p *ImagePredictor) Load(ctx context.Context, model dlframework.ModelManifest, opts ...options.Option) (*ImagePredictor, error)
- type InstanceSegmentationPredictor
- func (self *InstanceSegmentationPredictor) Load(ctx context.Context, modelManifest dlframework.ModelManifest, ...) (common.Predictor, error)
- func (p InstanceSegmentationPredictor) Modality() (dlframework.Modality, error)
- func (p *InstanceSegmentationPredictor) Predict(ctx context.Context, data interface{}, opts ...options.Option) error
- func (p *InstanceSegmentationPredictor) ReadPredictedFeatures(ctx context.Context) ([]dlframework.Features, error)
- type ObjectDetectionPredictor
- func (self *ObjectDetectionPredictor) Load(ctx context.Context, modelManifest dlframework.ModelManifest, ...) (common.Predictor, error)
- func (p ObjectDetectionPredictor) Modality() (dlframework.Modality, error)
- func (p *ObjectDetectionPredictor) Predict(ctx context.Context, data interface{}, opts ...options.Option) error
- func (p *ObjectDetectionPredictor) ReadPredictedFeatures(ctx context.Context) ([]dlframework.Features, error)
- type Operation
- type Output
- type RawPredictor
- func (p *RawPredictor) Close() error
- func (p *RawPredictor) Download(ctx context.Context, model dlframework.ModelManifest, opts ...options.Option) error
- func (p *RawPredictor) Load(ctx context.Context, model dlframework.ModelManifest, opts ...options.Option) (common.Predictor, error)
- func (p RawPredictor) Modality() (dlframework.Modality, error)
- func (p *RawPredictor) Predict(ctx context.Context, data interface{}, opts ...options.Option) error
- type SemanticSegmentationPredictor
- func (self *SemanticSegmentationPredictor) Load(ctx context.Context, modelManifest dlframework.ModelManifest, ...) (common.Predictor, error)
- func (p SemanticSegmentationPredictor) Modality() (dlframework.Modality, error)
- func (p *SemanticSegmentationPredictor) Predict(ctx context.Context, data interface{}, opts ...options.Option) error
- func (p *SemanticSegmentationPredictor) ReadPredictedFeatures(ctx context.Context) ([]dlframework.Features, error)
- type Session
- type SessionOptions
- type Tensor
- type Trace
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ElementTypeSliceToTensor ¶
func ElementTypeSliceToTensor(data [][]ElementType, shape []int64) (*tf.Tensor, error)
func Float32SliceToTensor ¶
func Float64SliceToTensor ¶
func Int16SliceToTensor ¶
func Int32SliceToTensor ¶
func Int64SliceToTensor ¶
func NewImageClassificationPredictor ¶
func NewImageClassificationPredictor(model dlframework.ModelManifest, opts ...options.Option) (common.Predictor, error)
func NewImageEnhancementPredictor ¶
func NewImageEnhancementPredictor(model dlframework.ModelManifest, opts ...options.Option) (common.Predictor, error)
func NewInstanceSegmentationPredictor ¶
func NewInstanceSegmentationPredictor(model dlframework.ModelManifest, opts ...options.Option) (common.Predictor, error)
func NewObjectDetectionPredictor ¶
func NewObjectDetectionPredictor(model dlframework.ModelManifest, opts ...options.Option) (common.Predictor, error)
func NewRawPredictor ¶
func NewRawPredictor(model dlframework.ModelManifest, opts ...options.Option) (common.Predictor, error)
func NewSemanticSegmentationPredictor ¶
func NewSemanticSegmentationPredictor(model dlframework.ModelManifest, opts ...options.Option) (common.Predictor, error)
func Uint16SliceToTensor ¶
func Uint32SliceToTensor ¶
func Uint64SliceToTensor ¶
Types ¶
type Device ¶
Device structure contains information about a device associated with a session, as returned by ListDevices()
type ElementType ¶
type ImageClassificationPredictor ¶
type ImageClassificationPredictor struct { *ImagePredictor // contains filtered or unexported fields }
func (*ImageClassificationPredictor) Load ¶
func (self *ImageClassificationPredictor) Load(ctx context.Context, modelManifest dlframework.ModelManifest, opts ...options.Option) (common.Predictor, error)
func (ImageClassificationPredictor) Modality ¶
func (p ImageClassificationPredictor) Modality() (dlframework.Modality, error)
func (*ImageClassificationPredictor) Predict ¶
func (p *ImageClassificationPredictor) Predict(ctx context.Context, data interface{}, opts ...options.Option) error
Predict ...
func (*ImageClassificationPredictor) ReadPredictedFeatures ¶
func (p *ImageClassificationPredictor) ReadPredictedFeatures(ctx context.Context) ([]dlframework.Features, error)
ReadPredictedFeatures ...
type ImageEnhancementPredictor ¶
type ImageEnhancementPredictor struct { *ImagePredictor // contains filtered or unexported fields }
func (*ImageEnhancementPredictor) Load ¶
func (self *ImageEnhancementPredictor) Load(ctx context.Context, modelManifest dlframework.ModelManifest, opts ...options.Option) (common.Predictor, error)
func (ImageEnhancementPredictor) Modality ¶
func (p ImageEnhancementPredictor) Modality() (dlframework.Modality, error)
func (*ImageEnhancementPredictor) Predict ¶
func (p *ImageEnhancementPredictor) Predict(ctx context.Context, data interface{}, opts ...options.Option) error
Predict ...
func (*ImageEnhancementPredictor) ReadPredictedFeatures ¶
func (p *ImageEnhancementPredictor) ReadPredictedFeatures(ctx context.Context) ([]dlframework.Features, error)
ReadPredictedFeatures ...
type ImagePredictor ¶
type ImagePredictor struct { common.ImagePredictor // contains filtered or unexported fields }
func (*ImagePredictor) Close ¶
func (p *ImagePredictor) Close() error
func (*ImagePredictor) Download ¶
func (p *ImagePredictor) Download(ctx context.Context, model dlframework.ModelManifest, opts ...options.Option) error
Download ...
func (*ImagePredictor) GetInputLayerName ¶
func (*ImagePredictor) GetOutputLayerName ¶
func (*ImagePredictor) GetOutputParameter ¶
func (p *ImagePredictor) GetOutputParameter(key string) string
func (*ImagePredictor) Load ¶
func (p *ImagePredictor) Load(ctx context.Context, model dlframework.ModelManifest, opts ...options.Option) (*ImagePredictor, error)
type InstanceSegmentationPredictor ¶
type InstanceSegmentationPredictor struct { *ImagePredictor // contains filtered or unexported fields }
func (*InstanceSegmentationPredictor) Load ¶
func (self *InstanceSegmentationPredictor) Load(ctx context.Context, modelManifest dlframework.ModelManifest, opts ...options.Option) (common.Predictor, error)
func (InstanceSegmentationPredictor) Modality ¶
func (p InstanceSegmentationPredictor) Modality() (dlframework.Modality, error)
func (*InstanceSegmentationPredictor) Predict ¶
func (p *InstanceSegmentationPredictor) Predict(ctx context.Context, data interface{}, opts ...options.Option) error
Predict ...
func (*InstanceSegmentationPredictor) ReadPredictedFeatures ¶
func (p *InstanceSegmentationPredictor) ReadPredictedFeatures(ctx context.Context) ([]dlframework.Features, error)
ReadPredictedFeatures ...
type ObjectDetectionPredictor ¶
type ObjectDetectionPredictor struct { *ImagePredictor // contains filtered or unexported fields }
func (*ObjectDetectionPredictor) Load ¶
func (self *ObjectDetectionPredictor) Load(ctx context.Context, modelManifest dlframework.ModelManifest, opts ...options.Option) (common.Predictor, error)
func (ObjectDetectionPredictor) Modality ¶
func (p ObjectDetectionPredictor) Modality() (dlframework.Modality, error)
func (*ObjectDetectionPredictor) Predict ¶
func (p *ObjectDetectionPredictor) Predict(ctx context.Context, data interface{}, opts ...options.Option) error
Predict ...
func (*ObjectDetectionPredictor) ReadPredictedFeatures ¶
func (p *ObjectDetectionPredictor) ReadPredictedFeatures(ctx context.Context) ([]dlframework.Features, error)
ReadPredictedFeatures ...
type RawPredictor ¶
type RawPredictor struct { common.RawPredictor // contains filtered or unexported fields }
func (*RawPredictor) Close ¶
func (p *RawPredictor) Close() error
func (*RawPredictor) Download ¶
func (p *RawPredictor) Download(ctx context.Context, model dlframework.ModelManifest, opts ...options.Option) error
Download ...
func (*RawPredictor) Load ¶
func (p *RawPredictor) Load(ctx context.Context, model dlframework.ModelManifest, opts ...options.Option) (common.Predictor, error)
func (RawPredictor) Modality ¶
func (p RawPredictor) Modality() (dlframework.Modality, error)
type SemanticSegmentationPredictor ¶
type SemanticSegmentationPredictor struct { *ImagePredictor // contains filtered or unexported fields }
func (*SemanticSegmentationPredictor) Load ¶
func (self *SemanticSegmentationPredictor) Load(ctx context.Context, modelManifest dlframework.ModelManifest, opts ...options.Option) (common.Predictor, error)
func (SemanticSegmentationPredictor) Modality ¶
func (p SemanticSegmentationPredictor) Modality() (dlframework.Modality, error)
func (*SemanticSegmentationPredictor) Predict ¶
func (p *SemanticSegmentationPredictor) Predict(ctx context.Context, data interface{}, opts ...options.Option) error
Predict ...
func (*SemanticSegmentationPredictor) ReadPredictedFeatures ¶
func (p *SemanticSegmentationPredictor) ReadPredictedFeatures(ctx context.Context) ([]dlframework.Features, error)
ReadPredictedFeatures ...
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
Session drives a TensorFlow graph computation.
When a Session is created with a given target, a new Session object is bound to the universe of resources specified by that target. Those resources are available to this session to perform computation described in the GraphDef. After creating the session with a graph, the caller uses the Run() API to perform the computation and potentially fetch outputs as Tensors. A Session allows concurrent calls to Run().
func NewSession ¶
func NewSession(graph *Graph, options *SessionOptions) (*Session, error)
NewSession creates a new execution session with the associated graph. options may be nil to use the default options.
func (*Session) Close ¶
Close a session. This contacts any other processes associated with this session, if applicable. Blocks until all previous calls to Run have returned.
func (*Session) ListDevices ¶
ListDevices returns the list of devices associated with a Session.
type SessionOptions ¶
type SessionOptions struct { // Target indicates the TensorFlow runtime to connect to. // // If 'target' is empty or unspecified, the local TensorFlow runtime // implementation will be used. Otherwise, the TensorFlow engine // defined by 'target' will be used to perform all computations. // // "target" can be either a single entry or a comma separated list // of entries. Each entry is a resolvable address of one of the // following formats: // local // ip:port // host:port // ... other system-specific formats to identify tasks and jobs ... // // NOTE: at the moment 'local' maps to an in-process service-based // runtime. // // Upon creation, a single session affines itself to one of the // remote processes, with possible load balancing choices when the // "target" resolves to a list of possible processes. // // If the session disconnects from the remote process during its // lifetime, session calls may fail immediately. Target string // Config is a binary-serialized representation of the // tensorflow.ConfigProto protocol message // (https://www.tensorflow.org/code/tensorflow/core/protobuf/config.proto). Config []byte }
SessionOptions contains configuration information for a session.
type Trace ¶
type Trace struct {
// contains filtered or unexported fields
}
func NewTrace ¶
https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/client/timeline.py
func (*Trace) Publish ¶
func (t *Trace) Publish(ctx context.Context, opts ...opentracing.StartSpanOption) error
Notes about start and end time from the NodeExecStats proto: For GPU, there is no difference between op_end_rel_micros and all_end_rel_micros. All are kernel times. For CPU, op_end_rel is the kernel time, while all_end_rel_micros includes some post-processing. Besides, currently, there is no way to measure the execution time of async ops accurately.
Source Files ¶
- alias.go
- gen-reshape.go
- image_classification_predictor.go
- image_enhancement_predictor.go
- image_instance_segmentation_predictor.go
- image_object_detection_predictor.go
- image_predictor.go
- image_semanitc_segmentation_predictor.go
- init.go
- libs.go
- raw_predictor.go
- reshape.go
- session.go
- tf_private.go
- tf_status.go
- trace.go
- utils.go