Documentation ¶
Index ¶
- Variables
- type MachineLearningInterface
- type TensorflowMachineLearning
- func (tml *TensorflowMachineLearning) DecodeBitmapGraph() (tfGraph *tf.Graph, input, output tf.Output, err error)
- func (tml *TensorflowMachineLearning) LoadSavedModel(modelPath string) (model *tf.SavedModel, tfSession *tf.Session, err error)
- func (tml *TensorflowMachineLearning) MakeTensorFromImage(imageTarget []byte) (tensor *tf.Tensor, imageDecode image.Image, err error)
- func (tml *TensorflowMachineLearning) PredictObjectBoxes(input *tf.Tensor) (probabilities, classes []float32, boxes [][]float32, err error)
Constants ¶
This section is empty.
Variables ¶
View Source
var COCO_SSD_LABELS = map[int]string{}/* 183 elements not displayed */
Functions ¶
This section is empty.
Types ¶
type MachineLearningInterface ¶
type MachineLearningInterface interface { LoadSavedModel(modelPath string) (model *tf.SavedModel, tfSession *tf.Session, err error) DecodeBitmapGraph() (tfGraph *tf.Graph, input, output tf.Output, err error) MakeTensorFromImage(imageTarget []byte) (tensor *tf.Tensor, imageDecode image.Image, err error) PredictObjectBoxes(input *tf.Tensor) (probabilities, classes []float32, boxes [][]float32, err error) }
type TensorflowMachineLearning ¶
type TensorflowMachineLearning struct{}
func NewTensorflowMachineLearning ¶
func NewTensorflowMachineLearning() *TensorflowMachineLearning
func (*TensorflowMachineLearning) DecodeBitmapGraph ¶
func (tml *TensorflowMachineLearning) DecodeBitmapGraph() (tfGraph *tf.Graph, input, output tf.Output, err error)
Build a graph to decode bitmap input into the proper tensor shape The object detection models take an input of [1, ?, ?, 3]
func (*TensorflowMachineLearning) LoadSavedModel ¶
func (tml *TensorflowMachineLearning) LoadSavedModel(modelPath string) (model *tf.SavedModel, tfSession *tf.Session, err error)
Load pre-trained model from COCO SSD
func (*TensorflowMachineLearning) MakeTensorFromImage ¶
func (tml *TensorflowMachineLearning) MakeTensorFromImage(imageTarget []byte) (tensor *tf.Tensor, imageDecode image.Image, err error)
Create a tensor from an image bytes
func (*TensorflowMachineLearning) PredictObjectBoxes ¶
func (tml *TensorflowMachineLearning) PredictObjectBoxes(input *tf.Tensor) (probabilities, classes []float32, boxes [][]float32, err error)
Returns the probabilities, classes and boxes located in the processed frame
Click to show internal directories.
Click to hide internal directories.