tensorflow

package
v0.0.0-...-6dbabcf Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

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

Jump to

Keyboard shortcuts

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