Documentation ¶
Index ¶
- Variables
- func AddNum(num int, loop int) int
- func AliImgSplit(picPath string) (string, error)
- func BaiduImgSplit(picPath string) (string, error)
- func DeCodeBase64(data string, savePath string)
- func GetAccessToken(id, secret string) (string, error)
- func GetFilePath(imgPath string) (file1Path string)
- func HmacWithShaTobase64(algorithm, data, key string) string
- func ImageSplit(firstSplitImage int, urlPath string) (newImgBase64, serverInfo string, err error)
- func Pic2Base64(url string) string
- func TencentImgSplit(picPath string) (string, error)
- type BaiduRequest
- type BodyRequest
- type BodyReturn
- type FaceCompareResult
- type FaceCompareResultReturn
- type FaceVerify
- func (f *FaceVerify) AliCheckFace(img1path, img2path string) (float64, error)
- func (f *FaceVerify) BaiduCheckFace(img1path, img2path string) (float64, error)
- func (f *FaceVerify) CheckFace(firstSplitImage int, url1Path, url2Path string) (result float64, serverInfo string, err error)
- func (f *FaceVerify) TenCheckFace(img1path, img2path string) (float64, error)
- func (f *FaceVerify) XunfeiCheckFace(img1path, img2path string) (float64, error)
- type Header
- type HeaderReturn
- type Input
- type Parameter
- type Payload
- type PayloadReturn
- type S67c9c78c
- type Text
Constants ¶
This section is empty.
Variables ¶
View Source
var ( XunfeihostUrl = "" XunfeiapiKey = "" XunfeiapiSecret = "" Xunfeiappid = "" )
科大讯飞必要的配置信息
View Source
var AliKey string = ""
阿里的KET和SERET
View Source
var AliKeySecret string = ""
View Source
var BaiduFaceVerifyKey string = ""
人脸对比
View Source
var BaiduFaceVerifyKeySecret string = ""
View Source
var BaiduImgSplitKey string = ""
人像分割
View Source
var BaiduImgSplitKeySecret string = ""
View Source
var FaceVerifyServerInfo string = ""
定义的服务器错误信息
View Source
var ImgSplitServerErr = ""
定义的服务器错误信息
View Source
var Loopcount int = 0
主程序内记录服务器使用次数
View Source
var TencentKey string = ""
腾讯的KEY和SECRET
View Source
var TencentKeySecret string = ""
Functions ¶
func AliImgSplit ¶
func BaiduImgSplit ¶
func DeCodeBase64 ¶
func HmacWithShaTobase64 ¶
func ImageSplit ¶
分割图片的函数,需要传入服务器优先顺序:firstSplitImage,原始图片路径:urlPath
func Pic2Base64 ¶
func TencentImgSplit ¶
Types ¶
type BaiduRequest ¶
type BaiduRequest struct { Image string `json:"image"` ImageType string `json:"image_type"` FaceType string `json:"face_type"` QualityControl string `json:"quality_control"` LivenessControl string `json:"liveness_control"` }
百度
func GetBaiduBody ¶
func GetBaiduBody(img1path, img2path string) []BaiduRequest
type BodyRequest ¶
type BodyRequest struct { Header Header `json:"header"` Parameter Parameter `json:"parameter"` Payload Payload `json:"payload"` }
func GetXunfeiBody ¶
func GetXunfeiBody(img1path, img2path string) BodyRequest
type BodyReturn ¶
type BodyReturn struct { Header HeaderReturn `json:"header"` Payload PayloadReturn `json:"payload"` }
type FaceCompareResult ¶
type FaceCompareResultReturn ¶
type FaceVerify ¶
func (*FaceVerify) AliCheckFace ¶
func (f *FaceVerify) AliCheckFace(img1path, img2path string) (float64, error)
func (*FaceVerify) BaiduCheckFace ¶
func (f *FaceVerify) BaiduCheckFace(img1path, img2path string) (float64, error)
func (*FaceVerify) CheckFace ¶
func (f *FaceVerify) CheckFace(firstSplitImage int, url1Path, url2Path string) (result float64, serverInfo string, err error)
输入服务器使用优先顺序、对比图片1的原始路径、对比图片2的原始路径,输出结果和错误信息 返回人脸对比结果、各服务器错误信息、函数执行错误信息。
func (*FaceVerify) TenCheckFace ¶
func (f *FaceVerify) TenCheckFace(img1path, img2path string) (float64, error)
func (*FaceVerify) XunfeiCheckFace ¶
func (f *FaceVerify) XunfeiCheckFace(img1path, img2path string) (float64, error)
type HeaderReturn ¶
type Input ¶
type Input struct { EnCoding string `json:"encoding"` Status int `json:"status"` Image string `json:"image"` }
科大讯飞
type PayloadReturn ¶
type PayloadReturn struct {
FaceCompareResultReturn FaceCompareResultReturn `json:"face_compare_result"`
}
type S67c9c78c ¶
type S67c9c78c struct { ServiceKind string `json:"service_kind"` FaceCompareResult FaceCompareResult `json:"face_compare_result"` }
Click to show internal directories.
Click to hide internal directories.