tfsymbol

package
v0.0.0-...-ddb766c Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ImageToTensorValue

func ImageToTensorValue(img image.Image) [][][][]float32

ImageToTensorValue return an array with shape [1,50,180,4] for tensor as an input

Types

type HttpClient

type HttpClient interface {
	Do(*http.Request) (*http.Response, error)
}

type LabelLookup

type LabelLookup interface {
	BestMatch(probabilities []float32) string
}

type Labels

type Labels []string

func ReadLabels

func ReadLabels(labelsFile string) (Labels, error)

func (Labels) BestMatch

func (s Labels) BestMatch(probabilities []float32) string

type PredictReponse

type PredictReponse struct {
	Predictions [][]float32 `json:"predictions"`
}

type PredictRequest

type PredictRequest struct {
	Instances [][][][]float32 `json:"instances"`
}

type RemoteResolver

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

func NewRemoteResolver

func NewRemoteResolver(
	baseURL, modelName string,
	client HttpClient,
	labels LabelLookup,
) (*RemoteResolver, error)

func (*RemoteResolver) SymbolResolve

func (s *RemoteResolver) SymbolResolve(ctx context.Context, img image.Image) (string, error)

Jump to

Keyboard shortcuts

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