tfmodel

package
v0.0.0-...-9b9b30a Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	EfficientNetB7    = NewConfig("EfficientNetB7.tf", "serving_default_input_1")
	EfficientNetB6    = NewConfig("EfficientNetB6.tf", "serving_default_input_2")
	InceptionResNetV2 = NewConfig("InceptionResNetV2.tf", "serving_default_input_3")
	DenseNet201       = NewConfig("DenseNet201.tf", "serving_default_input_4")
	InceptionV3       = NewConfig("InceptionV3.tf", "serving_default_input_5")
	NASNetLarge       = NewConfig("NASNetLarge.tf", "serving_default_input_6")
	ResNet152V2       = NewConfig("ResNet152V2.tf", "serving_default_input_7")
)

Configs of the available models.

AllConfigs contains configs of all models.

Functions

This section is empty.

Types

type Config

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

Config represents information about the exported model.

func NewConfig

func NewConfig(path, input string) Config

NewConfig returns a new Config instantce.

type List

type List []*TFModel

List represents multiple TFModel.

func NewList

func NewList(configs []Config) List

NewList returns a new List instance.

func (*List) Exec

func (models *List) Exec(ctx context.Context, value interface{}) ([][]float32, error)

Exec executes the nodes/tensors that must be present in the loaded models.

func (*List) Load

func (models *List) Load(ctx context.Context, baseDir string) error

Load loads models data from the baseDir.

type TFModel

type TFModel struct {
	sync.Mutex

	Config
	// contains filtered or unexported fields
}

TFModel represents tensorflow exported model.

func NewModel

func NewModel(info Config) *TFModel

NewModel returns a new TFModel instance.

func (*TFModel) Exec

func (model *TFModel) Exec(ctx context.Context, value interface{}) ([]float32, error)

Exec executes the nodes/tensors that must be present in the loaded model.

func (*TFModel) Load

func (model *TFModel) Load(ctx context.Context, baseDir string) error

Load loads model data from the baseDir. The graph loaded is identified by the set of tags specified when exporting it.

func (*TFModel) String

func (model *TFModel) String() string

String implements fmt.Stringer.String

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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