Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ImageToTensorValue ¶
ImageToTensorValue return an array with shape [1,50,180,4] for tensor as an input
Types ¶
type LabelLookup ¶
type LabelLookup interface {
// BestMatch returns the label with the highest probability.
BestMatch(probabilities []float32) (string, error)
}
LabelLookup is an interface that provides a way to look up the label of the symbol.
type Labels ¶
type Labels []string
Labels is a slice of strings that represents the labels of the model.
func ReadLabels ¶
ReadLabels reads the labels from a file and returns them as a slice of strings.
type Option ¶
type Option func(*options) error
Option is a function that sets an option on the RemoteResolver.
func WithBaseURL ¶
WithBaseURL sets the base URL of the TensorFlow Serving server. The default is http://localhost:8501.
func WithHTTPClient ¶
WithHTTPClient sets the HTTP client to use for making requests to the TensorFlow Serving server. The default is http.DefaultClient.
func WithModelName ¶
WithModelName sets the name of the model to use for prediction.
The default is "resnet".
type RemoteResolver ¶
type RemoteResolver struct {
// contains filtered or unexported fields
}
RemoteResolver is a struct that resolves the symbol of the image using the TensorFlow Serving server.
func NewRemoteResolver ¶
func NewRemoteResolver(labels LabelLookup, opt ...Option) (*RemoteResolver, error)
NewRemoteResolver creates a new RemoteResolver that uses the TensorFlow Serving server to resolve symbols.
func (*RemoteResolver) SymbolResolve ¶
SymbolResolve resolves the symbol of the image using the TensorFlow Serving server.