Documentation ¶
Index ¶
- Constants
- Variables
- func GetImageFromFile(filename string) (gocv.Mat, error)
- func GetImageFromStream(data []byte) (gocv.Mat, error)
- func GetUrlID(url string) (uid string)
- func GetUrlParams(c *gin.Context, key string) string
- func LoadLabel(file string) (map[string]int64, error)
- func MakeImageTensorByCenter(src gocv.Mat) (*tf.Tensor, error)
- func MakeImageTensorByGocv(img gocv.Mat) (*tf.Tensor, error)
- func MakeImageTensorByPoint(src gocv.Mat, points [][]float32) (*tf.Tensor, error)
- func NewSavedModel(modelFile string) (*tf.SavedModel, error)
- func PicShow(src gocv.Mat, points, boxs [][]float32)
- func ToTensor(values []float32) *tf.Tensor
- type ImageItem
- type RedisInfo
- type ReqImage
- type SRT_Item
- type SRT_Request
- type SRT_Response
Constants ¶
View Source
const (
H, W = 299, 299
SH, SW = 112, 112
MAX_LNE = 1 << 7
)
View Source
const ( HANDLER_NAME_DOWNLOAD = "handlerdownload" HANDLER_NAME_MODEL = "handlermodel" )
View Source
const ( MODEL_NAME_IMAGE = "image" MODEL_NAME_CLASSIFY = "classify" MODEL_NAME_EMBEDDING = "embedding" MODEL_NAME_ESMM = "esmm" MODEL_NAME_MTCNN = "mtcnn" )
View Source
const (
SECTION_REDIS = "redis"
)
Variables ¶
View Source
var ( // 输入参数错误定义 ErrReqBody = &errno.Errno{10001, "recive body error"} ErrReqUUID = &errno.Errno{10002, "request body miss required parameter"} ErrServiceV1 = &errno.Errno{10003, "service_type or service_key error"} ErrServiceV2 = &errno.Errno{10004, "request body has no service_type or service_key"} ErrImageNoExist = &errno.Errno{10005, "image not in params"} ErrImageFormat = &errno.Errno{10006, "request body has no service_type or service_key"} ErrService = &errno.Errno{10007, "service error"} )
Functions ¶
func MakeImageTensorByPoint ¶
func NewSavedModel ¶
func NewSavedModel(modelFile string) (*tf.SavedModel, error)
Types ¶
type RedisInfo ¶
func GetRedisInfo ¶
func GetRedisInfo(cfg *goconfig.ConfigFile, section string) (*RedisInfo, error)
type SRT_Request ¶
type SRT_Request struct { Input map[string][]float32 `json:"input"` Items []*SRT_Item `json:"items"` Image map[string]*ImageItem `json:"image"` }
func LoadMock ¶
func LoadMock(filename string) (*SRT_Request, error)
type SRT_Response ¶
Click to show internal directories.
Click to hide internal directories.