tfclient

package module
v0.0.0-...-dcaac4f Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

README

tfclient

A Tensorflow Serving client.

This client can request remote predictions from the inception server described here: https://tensorflow.github.io/serving/serving_inception

Copyright 2016 Casey Marshall. See LICENSE for more information.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BoxPrediction

type BoxPrediction struct {
	Class string  `json:"class"`
	Score float32 `json:"score"`
	Y1    float32 `json:"y1"`
	X1    float32 `json:"x1"`
	Y2    float32 `json:"y2"`
	X2    float32 `json:"x2"`
}

type InputConfig

type InputConfig struct {
	SignatureName  string
	InputName      string
	Dtype          tfcore.DataType
	SequenceLength int64
	Height         int64
	Width          int64
	Version        int64
}

type ModelSpec

type ModelSpec = tf.ModelSpec

type PredictionClient

type PredictionClient struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(addr string) (*PredictionClient, error)

func (*PredictionClient) Close

func (c *PredictionClient) Close() error

func (*PredictionClient) FormatBoxes

func (c *PredictionClient) FormatBoxes(resp map[string]*tfcore.TensorProto, minConfidence float32) []BoxPrediction

func (*PredictionClient) FormatInputImages

func (c *PredictionClient) FormatInputImages(images []image.Image, inputConf *InputConfig, scaler draw.Scaler) (*tfcore.TensorProto, error)

func (*PredictionClient) GetInputConfig

func (c *PredictionClient) GetInputConfig(modelName string) (*InputConfig, error)

func (*PredictionClient) GetModelSpec

func (c *PredictionClient) GetModelSpec(modelName, signatureName string, inputConf *InputConfig) *tf.ModelSpec

func (*PredictionClient) GetOutput

func (c *PredictionClient) GetOutput(modelName, signatureName string) (map[string]*tfcore.TensorProto, error)

func (*PredictionClient) PredictImages

func (c *PredictionClient) PredictImages(modelName, signatureName string, images []image.Image, scaler draw.Scaler) (map[string]*tfcore.TensorProto, error)

func (*PredictionClient) PredictRaw

func (c *PredictionClient) PredictRaw(modelSpec *tf.ModelSpec, inputConf *InputConfig, inputProto *tfcore.TensorProto) (map[string]*tfcore.TensorProto, error)

func (*PredictionClient) SetDebugging

func (c *PredictionClient) SetDebugging(debug bool)

type TensorProto

type TensorProto = tfcore.TensorProto

type TensorShapeProto

type TensorShapeProto = tfcore.TensorShapeProto

type TensorShapeProto_Dim

type TensorShapeProto_Dim = tfcore.TensorShapeProto_Dim

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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