Documentation ¶
Index ¶
- type ConfOfHandler
- type DataOfHandler
- type Handler
- func (h *Handler) Cache(image *util.ReqImage) error
- func (h *Handler) CheckContext(ctx *chain.ChainContext) error
- func (h *Handler) GetName() string
- func (h *Handler) GetNext() chain.IF_Handler
- func (h *Handler) Handle(ctx *chain.ChainContext) error
- func (h *Handler) Init(strName, strConf string) error
- func (h *Handler) PostHandle(ctx *chain.ChainContext) error
- func (h *Handler) PreHandle(ctx *chain.ChainContext) error
- func (h *Handler) SetNext(hnd chain.IF_Handler)
- type IF_DeepModel
- type SRT_DeepModelClassify
- func (d *SRT_DeepModelClassify) Destruct()
- func (d *SRT_DeepModelClassify) GetName() string
- func (d *SRT_DeepModelClassify) Init(config string) error
- func (d *SRT_DeepModelClassify) InitConfig(config string) error
- func (d *SRT_DeepModelClassify) Predict(req *util.SRT_Request) (*util.SRT_Response, error)
- type SRT_DeepModelEmbedding
- func (d *SRT_DeepModelEmbedding) Destruct()
- func (d *SRT_DeepModelEmbedding) GetName() string
- func (d *SRT_DeepModelEmbedding) Init(config string) error
- func (d *SRT_DeepModelEmbedding) InitConfig(config string) error
- func (d *SRT_DeepModelEmbedding) Predict(req *util.SRT_Request) (*util.SRT_Response, error)
- type SRT_DeepModelImage
- func (d *SRT_DeepModelImage) Destruct()
- func (d *SRT_DeepModelImage) GetName() string
- func (d *SRT_DeepModelImage) Init(config string) error
- func (d *SRT_DeepModelImage) InitConfig(config string) error
- func (d *SRT_DeepModelImage) Predict(req *util.SRT_Request) (*util.SRT_Response, error)
- func (d *SRT_DeepModelImage) PredictOne(image *util.ImageItem) error
- type SRT_DeepModelMtcnn
- func (d *SRT_DeepModelMtcnn) Destruct()
- func (d *SRT_DeepModelMtcnn) GetName() string
- func (d *SRT_DeepModelMtcnn) Init(config string) error
- func (d *SRT_DeepModelMtcnn) InitConfig(config string) error
- func (d *SRT_DeepModelMtcnn) Predict(req *util.SRT_Request) (*util.SRT_Response, error)
- func (d *SRT_DeepModelMtcnn) PredictOne(image *util.ImageItem) error
- type SRT_DeepModeliESMM
- type SRT_Model
- type SRT_ModelManager
- type SRT_ModelObj
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) CheckContext ¶
func (h *Handler) CheckContext(ctx *chain.ChainContext) error
在Handle前调用,检查Context是否符合要求 返回错误时,不执行当前Handle(),直接跳到下一个Handler进行处理
func (*Handler) Init ¶
////////////////////////////////////////////////////////////////////////////// IHandler接口函数的实现,新增函数请加在文件尾部或新增文件 ////////////////////////////////////////////////////////////////////////////// 初始化全局处理器对象:传入处理器名称和配置文件
func (*Handler) PostHandle ¶
func (h *Handler) PostHandle(ctx *chain.ChainContext) error
后处理函数:传入Context
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 ¶
func (d *SRT_DeepModelClassify) Predict(req *util.SRT_Request) (*util.SRT_Response, error)
参考 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 ¶
func (d *SRT_DeepModelEmbedding) Predict(req *util.SRT_Request) (*util.SRT_Response, error)
参考 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 (d *SRT_DeepModelImage) Predict(req *util.SRT_Request) (*util.SRT_Response, error)
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 (d *SRT_DeepModelMtcnn) Predict(req *util.SRT_Request) (*util.SRT_Response, error)
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 ¶
func (d *SRT_DeepModeliESMM) Predict(req *util.SRT_Request) (*util.SRT_Response, error)
参考 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
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)