face

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 11, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AccessTokenURL 鉴权认证 token 获取接口地址
	AccessTokenURL = "https://aip.baidubce.com/oauth/2.0/token"
	// VideoVerifyURL 视频活体检测接口地址
	VideoVerifyURL = "https://aip.baidubce.com/rest/2.0/face/v1/faceliveness/verify"
	// PersonVerifyURL 人脸实名认证接口地址
	PersonVerifyURL = "https://aip.baidubce.com/rest/2.0/face/v3/person/verify"
)

Variables

View Source
var (
	// PersonVerifyThreshold 与公民身份证小图相似度可能性阈值,超过即判断为同一人
	PersonVerifyThreshold = 80.0

	// ErrFaceVideoAuth 视频活体检测失败错误
	ErrFaceVideoAuth = bizerr.ErrFaceVideoAuth
	// ErrFacePersonAuth 人脸实名认证失败错误
	ErrFacePersonAuth = bizerr.ErrFacePersonAuth
)

Functions

This section is empty.

Types

type AuthenticateRequest

type AuthenticateRequest struct {
	Name        string `validate:"required" label:"姓名"`          // 姓名
	IDCard      string `validate:"required,idcard" label:"身份证号"` // 身份证号
	VideoBase64 string `validate:"required,base64" label:"视频数据"` // base64 编码的视频数据(建议视频大小控制在 10MB/1min 以内)
}

AuthenticateRequest 人脸识别认证请求

type AuthenticateResponse

type AuthenticateResponse struct {
	LogID int64 // 日志ID
}

AuthenticateResponse 人脸识别认证响应

type Config

type Config struct {
	IsMock    bool   `json:",optional"` // 是否模拟通过
	APIKey    string `json:",optional"` // 接口Key
	SecretKey string `json:",optional"` // 接口密钥
}

Config 人脸识别认证配置

type Face

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

Face 人脸识别认证器

func MustNewFace

func MustNewFace(c Config) *Face

MustNewFace 新建人脸识别认证器

func NewFace

func NewFace(c Config) (*Face, error)

NewFace 新建人脸识别认证器

func (*Face) Authenticate

func (f *Face) Authenticate(ctx context.Context, req *AuthenticateRequest) (*AuthenticateResponse, error)

Authenticate 人脸识别认证

Jump to

Keyboard shortcuts

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