Documentation
¶
Index ¶
- func GetCenterFace(detFaces []*tensor.Dense, h, w *int, center *DimensionPair[int]) (*tensor.Dense, int, error)
- type DimensionPair
- type FaceAntiSpoofingClient
- type FaceDetectionClient
- type FaceHelperClient
- func (c *FaceHelperClient) AlignFASFace(img gocv.Mat, landmark *tensor.Dense, borderMode *gocv.BorderType) (gocv.Mat, gocv.Mat, error)
- func (c *FaceHelperClient) AlignFASFaces(inputImgs []gocv.Mat, landmarks []*tensor.Dense, borderMode *gocv.BorderType) ([]gocv.Mat, []gocv.Mat, error)
- func (c *FaceHelperClient) AlignFaceIDCard(img gocv.Mat, lmk, bbox *tensor.Dense, borderMode *gocv.BorderType) (gocv.Mat, gocv.Mat, error)
- func (c *FaceHelperClient) AlignWarpFace(img gocv.Mat, landmark *tensor.Dense, borderMode *gocv.BorderType) (gocv.Mat, gocv.Mat, error)
- func (c *FaceHelperClient) AlignWarpFaces(inputImgs []gocv.Mat, landmarks []*tensor.Dense, borderMode *gocv.BorderType) ([]gocv.Mat, []gocv.Mat, error)
- func (c *FaceHelperClient) GetFaceLandmarks5(batchImages []gocv.Mat, keepLargest, keepCenter *bool, ...) ([]*tensor.Dense, []*tensor.Dense, error)
- func (c *FaceHelperClient) SwapRGB(srcMat gocv.Mat) gocv.Mat
- func (c *FaceHelperClient) SwapRGBs(batchImages []gocv.Mat) []gocv.Mat
- type FaceIDClient
- type FaceQualityClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DimensionPair ¶
type FaceAntiSpoofingClient ¶
type FaceAntiSpoofingClient struct { ModelParams *config.FaceAntiSpoofingParams ModelConfig *triton_proto.ModelConfigResponse // contains filtered or unexported fields }
func NewFaceAntiSpoofingClient ¶
func NewFaceAntiSpoofingClient(triton *gotritonclient.TritonGRPCClient, cfg *config.FaceAntiSpoofingParams) (*FaceAntiSpoofingClient, error)
func (*FaceAntiSpoofingClient) InferSingle ¶
func (c *FaceAntiSpoofingClient) InferSingle(imgFar, imgMid, imgNear gocv.Mat) (float32, error)
type FaceDetectionClient ¶
type FaceDetectionClient struct { ModelConfig *triton_proto.ModelConfigResponse ModelParams *config.FaceDetectionParams // contains filtered or unexported fields }
func NewFaceDetectionClient ¶
func NewFaceDetectionClient(triton *gotritonclient.TritonGRPCClient, cfg *config.FaceDetectionParams) (*FaceDetectionClient, error)
func (*FaceDetectionClient) InferBatch ¶
func (c *FaceDetectionClient) InferBatch(rawInputTensors [][]gocv.Mat) ([][]config.FaceDetectionOutput, error)
func (*FaceDetectionClient) InferSingle ¶
func (c *FaceDetectionClient) InferSingle(rawInputTensors []gocv.Mat) ([]config.FaceDetectionOutput, error)
type FaceHelperClient ¶
type FaceHelperClient struct {
// contains filtered or unexported fields
}
func NewFaceHelperClient ¶
func NewFaceHelperClient( tritonClient *gotritonclient.TritonGRPCClient, faceSize, fasSize, faSize int, faceTemplate, fasTemplate, faTemplate *tensor.Dense, ) (*FaceHelperClient, error)
NewFaceHelperClient initializes a new FaceHelperClient.
func (*FaceHelperClient) AlignFASFace ¶
func (c *FaceHelperClient) AlignFASFace(img gocv.Mat, landmark *tensor.Dense, borderMode *gocv.BorderType) (gocv.Mat, gocv.Mat, error)
AlignFASFace aligns input image using input landmark and face anti-spoofing template.
Inputs:
- inputImgs (gocv.Mat): face image.
- landmarks (*tensor.Dense): face landmark.
Outputs:
- croppedFace (gocv.Mat): cropped face.
- affineMatrix (gocv.Mat): affine matrix.
func (*FaceHelperClient) AlignFASFaces ¶
func (c *FaceHelperClient) AlignFASFaces(inputImgs []gocv.Mat, landmarks []*tensor.Dense, borderMode *gocv.BorderType) ([]gocv.Mat, []gocv.Mat, error)
AlignFASFaces aligns input images using input landmarks and face anti-spoofing template.
Inputs:
- inputImgs ([]gocv.Mat): list of face images.
- landmarks ([]*tensor.Dense): list of face landmarks.
Outputs:
- croppedFaces ([]gocv.Mat): list of cropped faces.
- affineMatrices ([]gocv.Mat): list of affine matrices.
func (*FaceHelperClient) AlignFaceIDCard ¶
func (c *FaceHelperClient) AlignFaceIDCard(img gocv.Mat, lmk, bbox *tensor.Dense, borderMode *gocv.BorderType) (gocv.Mat, gocv.Mat, error)
AlignFaceIDCard crops and aligns the face roi in the input image.
Inputs:
- img (gocv.Mat): face image.
- lmk (*tensor.Dense): face landmark.
- lmk (*tensor.Dense): face bounding box.
Outputs:
- croppedFace (gocv.Mat): cropped face.
- affineMatrix (gocv.Mat): affine matrix.
func (*FaceHelperClient) AlignWarpFace ¶
func (c *FaceHelperClient) AlignWarpFace(img gocv.Mat, landmark *tensor.Dense, borderMode *gocv.BorderType) (gocv.Mat, gocv.Mat, error)
AlignWarpFace aligns input image using input landmark and face template.
Inputs:
- inputImgs (gocv.Mat): face image.
- landmarks (*tensor.Dense): face landmark.
Outputs:
- croppedFace (gocv.Mat): cropped face.
- affineMatrix (gocv.Mat): affine matrix.
func (*FaceHelperClient) AlignWarpFaces ¶
func (c *FaceHelperClient) AlignWarpFaces(inputImgs []gocv.Mat, landmarks []*tensor.Dense, borderMode *gocv.BorderType) ([]gocv.Mat, []gocv.Mat, error)
AlignWarpFaces aligns input images using input landmarks and face template.
Inputs:
- inputImgs ([]gocv.Mat): list of face images.
- landmarks ([]*tensor.Dense): list of face landmarks.
Outputs:
- croppedFaces ([]gocv.Mat): list of cropped faces.
- affineMatrices ([]gocv.Mat): list of affine matrices.
func (*FaceHelperClient) GetFaceLandmarks5 ¶
func (c *FaceHelperClient) GetFaceLandmarks5( batchImages []gocv.Mat, keepLargest, keepCenter *bool, scoreThreshold, eyeDistanceThreshold *float32, tryPadding *bool, ) ([]*tensor.Dense, []*tensor.Dense, error)
GetFaceLandmarks5 processes the input images and return the (5,2) Matrix of facial landmarks.
type FaceIDClient ¶
type FaceIDClient struct { ModelParams *config.FaceIDParams ModelConfig *triton_proto.ModelConfigResponse // contains filtered or unexported fields }
func NewFaceIDClient ¶
func NewFaceIDClient(triton *gotritonclient.TritonGRPCClient, cfg *config.FaceIDParams) (*FaceIDClient, error)
func (*FaceIDClient) InferBatch ¶
type FaceQualityClient ¶
type FaceQualityClient struct { ModelParams *config.FaceQualityParams ModelConfig *triton_proto.ModelConfigResponse // contains filtered or unexported fields }
func NewFaceQualityClient ¶
func NewFaceQualityClient(triton *gotritonclient.TritonGRPCClient, cfg *config.FaceQualityParams) (*FaceQualityClient, error)
func (*FaceQualityClient) InferBatch ¶
func (*FaceQualityClient) InferSingle ¶
Click to show internal directories.
Click to hide internal directories.