go_ekyc_pipeline

package module
v0.0.0-...-c4818f5 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2024 License: MIT Imports: 9 Imported by: 0

README

go-ekyc-pipeline

ASSUME_NO_MOVING_GC_UNSAFE_RISK_IT_WITH=go1.23

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EKYCPipeline

type EKYCPipeline struct {
	FaceID      *modules.FaceIDClient
	FaceQuality *modules.FaceQualityClient
	FaceHelper  *modules.FaceHelperClient
	FaceASFull  *modules.FaceAntiSpoofingClient
	FaceASCrop  *modules.FaceAntiSpoofingClient
}

EKYCPipeline defines the structure of the EKYC pipeline

func NewEKYCPipeline

func NewEKYCPipeline(tritonClient *gotritonclient.TritonGRPCClient) (*EKYCPipeline, error)

NewEKYCPipeline initializes new pipelines.

func (*EKYCPipeline) CropFaceIDCard

func (c *EKYCPipeline) CropFaceIDCard(img gocv.Mat) (*gocv.Mat, error)

CropFaceIDCard extracts face roi from input id card image.

Inputs:

  • img (gocv.Mat): Capture face image.

Outputs:

  • img (*gocv.Mat): ROI of the face.

func (*EKYCPipeline) CropSelfie

func (c *EKYCPipeline) CropSelfie(img gocv.Mat) (*gocv.Mat, error)

CropSelfie extracts face roi from input image.

Inputs:

  • img (gocv.Mat): Capture face image.

Outputs:

  • img (*gocv.Mat): ROI of the face.

func (*EKYCPipeline) ExtractFaceVector

func (c *EKYCPipeline) ExtractFaceVector(img gocv.Mat, lmk *tensor.Dense) ([]float32, error)

ExtractFaceVector extracts face from inputs image as slice of float32.

Inputs:

  • img (gocv.Mat): Capture face image.
  • lmk (*tensor.Dense): img landmarks.

Outputs:

  • vector ([]float32): Vector representations of input face image.

func (*EKYCPipeline) FaceAntiSpoofingActiveVerify

func (c *EKYCPipeline) FaceAntiSpoofingActiveVerify(imgFar, imgMid, imgNear gocv.Mat, lmkFar, lmkMid, lmkNear *tensor.Dense) (*config.FaceAntiSpoofingVerify, error)

FaceAntiSpoofingActiveVerify verifies face from input face images and landmarks.

Inputs:

  • imgFar (gocv.Mat): Capture far-distance face image.
  • imgMid (gocv.Mat): Capture mid-distance face image.
  • imgNear (gocv.Mat): Capture near-distance face image.
  • lmkFar (*tensor.Dense): imgFar landmarks.
  • lmkMid (*tensor.Dense): imgMid landmarks.
  • lmkNear (*tensor.Dense): imgNear landmarks.

Outputs:

  • scoreFM (*FaceAntiSpoofingVerify): face anti-spoofing result.

func (*EKYCPipeline) FaceAntiSpoofingPassiveVerify

func (c *EKYCPipeline) FaceAntiSpoofingPassiveVerify(fImgFar, fImgMid, fImgNear gocv.Mat) (*config.FaceAntiSpoofingVerify, error)

FaceAntiSpoofingPassiveVerify verifies face from input face images.

Inputs:

  • fImgFar (gocv.Mat): Capture far-distance face image.
  • fImgMid (gocv.Mat): Capture mid-distance face image.
  • fImgNear (gocv.Mat): Capture near-distance face image.

Outputs:

  • scoreFM (*FaceAntiSpoofingVerify): face anti-spoofing result.

func (*EKYCPipeline) FaceQualityVerify

func (c *EKYCPipeline) FaceQualityVerify(imgFar, imgMid, imgNear gocv.Mat, lmkFar, lmkMid, lmkNear *tensor.Dense) (float32, bool, error)

FaceQualityVerify checks for face obstructions

Inputs:

  • imgFar (gocv.Mat): Capture far-distance face image.
  • imgMid (gocv.Mat): Capture mid-distance face image.
  • imgNear (gocv.Mat): Capture near-distance face image.
  • lmkFar (*tensor.Dense): imgFar landmarks.
  • lmkMid (*tensor.Dense): imgMid landmarks.
  • lmkNear (*tensor.Dense): imgNear landmarks.

Outputs:

  • maskScore (float32): Face mask score from model.
  • isFaceMask (float32): Face mask decision.

func (*EKYCPipeline) GetFaceLandmarks5

func (c *EKYCPipeline) GetFaceLandmarks5(batchImages []gocv.Mat) ([]*tensor.Dense, error)

GetFaceLandmarks5 returns the facial alndmarks of the input images. Inputs:

  • images ([]gocv.Mat): input face images.

Outputs:

  • batchLandmarks: ([]*tensor.Dense): Facial landmarks from the input images.

func (*EKYCPipeline) PersonIDCardVerify

func (c *EKYCPipeline) PersonIDCardVerify(cardImg, ImgFar gocv.Mat, lmkFar *tensor.Dense) (float32, bool, error)

PersonIDCardVerify checks if the face on the id card matches with input face image

Inputs:

  • cardImg (gocv.Mat): ID card with face.
  • imgFar (gocv.Mat): Capture far-distance face image.
  • lmkFar (*tensor.Dense): imgFar landmarks.

Outputs:

  • scoreFM (*FaceAntiSpoofingVerify): face anti-spoofing result.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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