Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DefaultConfig = Config{
Height: 299,
Width: 299,
Mean: 0,
Scale: 255,
InputLayer: "Placeholder",
OutputLayer: "final_result",
NumPredictions: 5,
}
DefaultConfig is used in the case where a config is not defined by the user
Functions ¶
This section is empty.
Types ¶
type Classifier ¶
type Classifier struct {
// contains filtered or unexported fields
}
Classifier is a struct used for classifying images
func NewClassifier ¶
func NewClassifier(graphPath, labelPath string) (*Classifier, error)
NewClassifier creates a new Classifier using the default config
func NewClassifierWithConfig ¶
func NewClassifierWithConfig(graphPath, labelPath string, config Config) (*Classifier, error)
NewClassifierWithConfig creates a new image Classifier for processing image predictions
func (*Classifier) ClassifyBytes ¶
func (c *Classifier) ClassifyBytes(img []byte, ext string) ([]Prediction, error)
ClassifyBytes classifies the passed images bytes and returns the predictions as a slice of Predictions
func (*Classifier) ClassifyImage ¶
func (c *Classifier) ClassifyImage(img image.Image) ([]Prediction, error)
ClassifyImage takes an image Image, writes it to a bytes Buffer, performs a classification and returns a slice of predictions
func (*Classifier) ClassifyMultipart ¶
func (c *Classifier) ClassifyMultipart(fh *multipart.FileHeader) ([]Prediction, error)
ClassifyMultipart takes a multipart Fileheader, performs a classification and returns a slice of predictions
func (*Classifier) Close ¶
func (c *Classifier) Close() error
Close closes the Classifier by closing all it's closers ;)
type Config ¶
type Config struct {
Height, Width int32
Mean, Scale float32
InputLayer, OutputLayer string
NumPredictions int
}
Config is a struct used for configuring the classifier
type Prediction ¶
Prediction is a struct containing a class label and the probability of the classified image being the cooresponding label