models

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2021 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfOfHandler

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

自定义配置结构:用于保存处理器用到的配置信息 由fillConf()进行创建、赋值 程序启动时,在Init()中被调用

type DataOfHandler

type DataOfHandler struct {
}

自定义数据结构,用于保存用到的数据 由fillData()进行创建、赋值并返回 每次查询到来时,fillData()在PreHandle()中被调用 在Handle及 postHander 使用 此结构在处理结束后被自动释放

type Handler

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

处理器对象类型声明

func (*Handler) Cache

func (h *Handler) Cache(image *util.ReqImage) error

func (*Handler) CheckContext

func (h *Handler) CheckContext(ctx *chain.ChainContext) error

在Handle前调用,检查Context是否符合要求 返回错误时,不执行当前Handle(),直接跳到下一个Handler进行处理

func (*Handler) GetName

func (h *Handler) GetName() string

得到本处理器的名称

func (*Handler) GetNext

func (h *Handler) GetNext() chain.IF_Handler

获取下一步Handler

func (*Handler) Handle

func (h *Handler) Handle(ctx *chain.ChainContext) error

在Handle中完成自己负责的工作

func (*Handler) Init

func (h *Handler) Init(strName, strConf string) error

////////////////////////////////////////////////////////////////////////////// IHandler接口函数的实现,新增函数请加在文件尾部或新增文件 ////////////////////////////////////////////////////////////////////////////// 初始化全局处理器对象:传入处理器名称和配置文件

func (*Handler) PostHandle

func (h *Handler) PostHandle(ctx *chain.ChainContext) error

后处理函数:传入Context

func (*Handler) PreHandle

func (h *Handler) PreHandle(ctx *chain.ChainContext) error

前处理函数,传入Context

func (*Handler) SetNext

func (h *Handler) SetNext(hnd chain.IF_Handler)

设置下一步Handler

type IF_DeepModel

type IF_DeepModel interface {
	//得到本模型的名称
	GetName() string
	//初始化
	Init(config string) error
	//计算
	Predict(req *util.SRT_Request) (*util.SRT_Response, error)
	//释放
	Destruct()
}

type SRT_DeepModelClassify

type SRT_DeepModelClassify struct {
	Labels map[int64]string
	// contains filtered or unexported fields
}

func (*SRT_DeepModelClassify) Destruct

func (d *SRT_DeepModelClassify) Destruct()

func (*SRT_DeepModelClassify) GetName

func (d *SRT_DeepModelClassify) GetName() string

func (*SRT_DeepModelClassify) Init

func (d *SRT_DeepModelClassify) Init(config string) error

func (*SRT_DeepModelClassify) InitConfig

func (d *SRT_DeepModelClassify) InitConfig(config string) error

func (*SRT_DeepModelClassify) Predict

参考 def predict(self, request, logger):

type SRT_DeepModelEmbedding

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

func (*SRT_DeepModelEmbedding) Destruct

func (d *SRT_DeepModelEmbedding) Destruct()

func (*SRT_DeepModelEmbedding) GetName

func (d *SRT_DeepModelEmbedding) GetName() string

func (*SRT_DeepModelEmbedding) Init

func (d *SRT_DeepModelEmbedding) Init(config string) error

func (*SRT_DeepModelEmbedding) InitConfig

func (d *SRT_DeepModelEmbedding) InitConfig(config string) error

func (*SRT_DeepModelEmbedding) Predict

参考 def predict(self, request, logger):

type SRT_DeepModelImage

type SRT_DeepModelImage struct {
	Labels map[int64]string
	// contains filtered or unexported fields
}

func (*SRT_DeepModelImage) Destruct

func (d *SRT_DeepModelImage) Destruct()

func (*SRT_DeepModelImage) GetName

func (d *SRT_DeepModelImage) GetName() string

func (*SRT_DeepModelImage) Init

func (d *SRT_DeepModelImage) Init(config string) error

func (*SRT_DeepModelImage) InitConfig

func (d *SRT_DeepModelImage) InitConfig(config string) error

func (*SRT_DeepModelImage) Predict

func (*SRT_DeepModelImage) PredictOne

func (d *SRT_DeepModelImage) PredictOne(image *util.ImageItem) error

参考 def predict(self, request, logger):

type SRT_DeepModelMtcnn

type SRT_DeepModelMtcnn struct {
	Labels map[int64]string
	// contains filtered or unexported fields
}

func (*SRT_DeepModelMtcnn) Destruct

func (d *SRT_DeepModelMtcnn) Destruct()

func (*SRT_DeepModelMtcnn) GetName

func (d *SRT_DeepModelMtcnn) GetName() string

func (*SRT_DeepModelMtcnn) Init

func (d *SRT_DeepModelMtcnn) Init(config string) error

func (*SRT_DeepModelMtcnn) InitConfig

func (d *SRT_DeepModelMtcnn) InitConfig(config string) error

func (*SRT_DeepModelMtcnn) Predict

func (*SRT_DeepModelMtcnn) PredictOne

func (d *SRT_DeepModelMtcnn) PredictOne(image *util.ImageItem) error

参考 def predict(self, request, logger):

type SRT_DeepModeliESMM

type SRT_DeepModeliESMM struct {
	Labels map[int64]string
	// contains filtered or unexported fields
}

func (*SRT_DeepModeliESMM) Destruct

func (d *SRT_DeepModeliESMM) Destruct()

func (*SRT_DeepModeliESMM) GetName

func (d *SRT_DeepModeliESMM) GetName() string

func (*SRT_DeepModeliESMM) Init

func (d *SRT_DeepModeliESMM) Init(config string) error

func (*SRT_DeepModeliESMM) InitConfig

func (d *SRT_DeepModeliESMM) InitConfig(config string) error

func (*SRT_DeepModeliESMM) Predict

参考 def predict(self, request, logger):

type SRT_Model

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

////////////////////////////////////////////////////////////////////////////// 可在tensorflow中使用的模型

func (*SRT_Model) GetModelObj

func (m *SRT_Model) GetModelObj() *SRT_ModelObj

func (*SRT_Model) Init

func (m *SRT_Model) Init(config, modelName, readyFile string) error

type SRT_ModelManager

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

func (*SRT_ModelManager) GetModelObj

func (m *SRT_ModelManager) GetModelObj(name string) (*SRT_ModelObj, error)

func (*SRT_ModelManager) Init

func (m *SRT_ModelManager) Init(strConf string) error

func (*SRT_ModelManager) Predict

func (m *SRT_ModelManager) Predict(modelName string, req *util.SRT_Request) (*util.SRT_Response, error)

type SRT_ModelObj

type SRT_ModelObj struct {
	ModifyTime time.Time //模型修改时间
	Model      IF_DeepModel
}

//////////////////////////////////////////////////////////////////////////////

func (*SRT_ModelObj) Predict

func (m *SRT_ModelObj) Predict(req *util.SRT_Request) (*util.SRT_Response, error)

Jump to

Keyboard shortcuts

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