### GET /GetRealPersonVerificationResult Source: https://context7.com/alibabacloud-go/facebody-20191230/llms.txt Retrieves the result of a real person verification process using a verification token. ```APIDOC ## GET /GetRealPersonVerificationResult ### Description Retrieves the result of a real person verification. ### Method GET ### Endpoint /GetRealPersonVerificationResult ### Parameters #### Request Body - **VerificationToken** (string) - Required - The unique token associated with the verification session. ### Request Example { "VerificationToken": "verification-token-123" } ### Response #### Success Response (200) - **Passed** (boolean) - Indicates whether the verification was successful. #### Response Example { "Body": { "Data": { "Passed": true } } } ``` -------------------------------- ### Initialize Facebody Client Source: https://context7.com/alibabacloud-go/facebody-20191230/llms.txt Configures the client with AccessKey credentials and region settings. Required before executing any API requests. ```go package main import ( "fmt" openapi "github.com/alibabacloud-go/darabonba-openapi/v2/client" facebody "github.com/alibabacloud-go/facebody-20191230/v6/client" "github.com/alibabacloud-go/tea/dara" ) func main() { config := &openapi.Config{ AccessKeyId: dara.String("your-access-key-id"), AccessKeySecret: dara.String("your-access-key-secret"), RegionId: dara.String("cn-shanghai"), Endpoint: dara.String("facebody.cn-shanghai.aliyuncs.com"), } client, err := facebody.NewClient(config) if err != nil { panic(err) } fmt.Println("Facebody client initialized successfully") } ``` -------------------------------- ### Create Face Database Source: https://context7.com/alibabacloud-go/facebody-20191230/llms.txt Initializes a new database for storing face data. ```go request := &facebody.CreateFaceDbRequest{ Name: dara.String("employees_db"), } response, err := client.CreateFaceDb(request) if err != nil { panic(err) } fmt.Printf("Face database created. RequestId: %s\n", *response.Body.RequestId) ``` -------------------------------- ### BodyPosture - Body Posture Detection Source: https://context7.com/alibabacloud-go/facebody-20191230/llms.txt Detects human body keypoints and posture. ```APIDOC ## BodyPosture - Body Posture Detection ### Description Detects human body keypoints and posture. ### Method POST ### Endpoint /body_posture ### Parameters #### Query Parameters - **ImageURL** (string) - Required - URL of the image to process. ### Request Example ```json { "ImageURL": "https://example.com/pose.jpg" } ``` ### Response #### Success Response (200) - **Outputs** (array) - List of detected body postures. - **Results** (array) - List of keypoints detected for each body. #### Response Example ```json { "Body": { "Data": { "Outputs": [ { "Results": [ {"Point": [100, 200]}, {"Point": [120, 220]} ] } ] } } } ``` ``` -------------------------------- ### QueryFaceImageTemplate - Query Face Fusion Templates Source: https://context7.com/alibabacloud-go/facebody-20191230/llms.txt Lists available face fusion templates. ```go request := &facebody.QueryFaceImageTemplateRequest{ PageNo: dara.Int64(1), PageSize: dara.Int64(10), } response, err := client.QueryFaceImageTemplate(request) if err != nil { panic(err) } for _, template := range response.Body.Data.Elements { fmt.Printf("Template: ID=%s\n", *template.TemplateId) } ``` -------------------------------- ### Detect Body Posture Source: https://context7.com/alibabacloud-go/facebody-20191230/llms.txt Analyzes human body keypoints to determine posture. ```go request := &facebody.BodyPostureRequest{ ImageURL: dara.String("https://example.com/pose.jpg"), } response, err := client.BodyPosture(request) if err != nil { panic(err) } for _, body := range response.Body.Data.Outputs { fmt.Printf("Body posture detected with %d keypoints\n", len(body.Results)) } ``` -------------------------------- ### POST CreateFaceDb Source: https://context7.com/alibabacloud-go/facebody-20191230/llms.txt Creates a new face database for storing and searching face data. ```APIDOC ## POST CreateFaceDb ### Description Creates a new face database for storing and searching face data. ### Request Body - **Name** (string) - Required - Name of the database to create ### Response #### Success Response (200) - **RequestId** (string) - Unique identifier for the request ``` -------------------------------- ### RecognizeAction - Action Recognition Source: https://context7.com/alibabacloud-go/facebody-20191230/llms.txt Recognizes human actions from images or video. ```go urlList := []*facebody.RecognizeActionRequestURLList{ {URL: dara.String("https://example.com/action_frame.jpg")}, } request := &facebody.RecognizeActionRequest{ Type: dara.Int32(0), // 0: image input, 1: video input URLList: urlList, } response, err := client.RecognizeAction(request) if err != nil { panic(err) } for _, element := range response.Body.Data.Elements { fmt.Printf("Action detected with %d results\n", len(element.Boxes)) } ``` -------------------------------- ### Add Face Entity to Database Source: https://context7.com/alibabacloud-go/facebody-20191230/llms.txt Registers a new person (entity) within a specific face database. ```go request := &facebody.AddFaceEntityRequest{ DbName: dara.String("employees_db"), EntityId: dara.String("employee_001"), Labels: dara.String("department:engineering,role:developer"), } response, err := client.AddFaceEntity(request) if err != nil { panic(err) } fmt.Printf("Entity added. RequestId: %s\n", *response.Body.RequestId) ``` -------------------------------- ### GenRealPersonVerificationToken - Generate Verification Token Source: https://context7.com/alibabacloud-go/facebody-20191230/llms.txt Generates a token for real person verification workflow. ```go request := &facebody.GenRealPersonVerificationTokenRequest{ CertificateName: dara.String("John Doe"), CertificateNumber: dara.String("123456789012345678"), MetaInfo: dara.String("{}"), } response, err := client.GenRealPersonVerificationToken(request) if err != nil { panic(err) } fmt.Printf("Verification token: %s\n", *response.Body.Data.VerificationToken) ``` -------------------------------- ### Search Face in Database Source: https://context7.com/alibabacloud-go/facebody-20191230/llms.txt Performs a 1:N search for matching faces across one or more databases. ```go request := &facebody.SearchFaceRequest{ DbName: dara.String("employees_db"), ImageUrl: dara.String("https://example.com/query_face.jpg"), Limit: dara.Int32(5), // Return top 5 matches MaxFaceNum: dara.Int64(1), // Max faces to detect in query image QualityScoreThreshold: dara.Float32(50.0), } response, err := client.SearchFace(request) if err != nil { panic(err) } // Iterate through matched faces for _, matchList := range response.Body.Data.MatchList { for _, faceItem := range matchList.FaceItems { fmt.Printf("Match: EntityId=%s, Score=%.2f%%\n", *faceItem.EntityId, *faceItem.Score) } } ``` -------------------------------- ### Recognize Face Attributes Source: https://context7.com/alibabacloud-go/facebody-20191230/llms.txt Configures and executes a request to identify multiple facial attributes such as age, gender, and expression. ```go request := &facebody.RecognizeFaceRequest{ ImageURL: dara.String("https://example.com/portrait.jpg"), Age: dara.Bool(true), Gender: dara.Bool(true), Expression: dara.Bool(true), Glass: dara.Bool(true), Hat: dara.Bool(true), Mask: dara.Bool(true), Beauty: dara.Bool(true), Quality: dara.Bool(true), MaxFaceNumber: dara.Int64(5), } response, err := client.RecognizeFace(request) if err != nil { panic(err) } // Response includes arrays of attributes for each detected face fmt.Printf("Age estimates: %v\n", response.Body.Data.AgeList) fmt.Printf("Gender predictions: %v\n", response.Body.Data.GenderList) ``` -------------------------------- ### Batch Add Multiple Faces Source: https://context7.com/alibabacloud-go/facebody-20191230/llms.txt Adds multiple face images to an entity in a single API request. ```go faces := []*facebody.BatchAddFacesRequestFaces{ {ImageURL: dara.String("https://example.com/photo1.jpg")}, {ImageURL: dara.String("https://example.com/photo2.jpg")}, {ImageURL: dara.String("https://example.com/photo3.jpg")}, } request := &facebody.BatchAddFacesRequest{ DbName: dara.String("employees_db"), EntityId: dara.String("employee_001"), Faces: faces, QualityScoreThreshold: dara.Float32(70.0), } response, err := client.BatchAddFaces(request) if err != nil { panic(err) } fmt.Printf("Batch add completed. RequestId: %s\n", *response.Body.RequestId) ``` -------------------------------- ### GenerateHumanSketchStyle - Sketch Style Generation Source: https://context7.com/alibabacloud-go/facebody-20191230/llms.txt Converts a portrait to pencil sketch style. ```go request := &facebody.GenerateHumanSketchStyleRequest{ ImageURL: dara.String("https://example.com/portrait.jpg"), ReturnType: dara.String("url"), } response, err := client.GenerateHumanSketchStyle(request) if err != nil { panic(err) } fmt.Printf("Sketch image URL: %s\n", *response.Body.Data.ImageURL) ``` -------------------------------- ### POST DetectFace Source: https://context7.com/alibabacloud-go/facebody-20191230/llms.txt Detects faces in an image and returns face rectangles, landmarks, pose angles, and quality scores. ```APIDOC ## POST DetectFace ### Description Detects faces in an image and returns face rectangles, landmarks, pose angles, and quality scores. ### Request Body - **ImageURL** (string) - Required - URL of the image to process - **Landmark** (boolean) - Optional - Whether to return 105 facial landmark points - **Pose** (boolean) - Optional - Whether to return face pose angles (pitch, roll, yaw) - **Quality** (boolean) - Optional - Whether to return face quality scores - **MaxFaceNumber** (int64) - Optional - Maximum faces to detect ### Response #### Success Response (200) - **FaceCount** (int) - Number of faces detected - **FaceRectangles** (array) - [x, y, width, height] for each face - **Landmarks** (array) - 105 landmark points per face - **PoseList** (array) - [pitch, roll, yaw] angles per face - **Qualities** (object) - Blur, noise, illumination, mask scores ``` -------------------------------- ### AddFaceImageTemplate - Add Face Fusion Template Source: https://context7.com/alibabacloud-go/facebody-20191230/llms.txt Adds a new template for face fusion operations. ```go request := &facebody.AddFaceImageTemplateRequest{ ImageURL: dara.String("https://example.com/template.jpg"), } response, err := client.AddFaceImageTemplate(request) if err != nil { panic(err) } fmt.Printf("Template ID: %s\n", *response.Body.Data.TemplateId) ``` -------------------------------- ### MergeImageFace - Face Fusion Source: https://context7.com/alibabacloud-go/facebody-20191230/llms.txt Merges a face into a template image for face swapping. ```go mergeInfos := []*facebody.MergeImageFaceRequestMergeInfos{ { ImageURL: dara.String("https://example.com/source_face.jpg"), TemplateFaceID: dara.String("1"), }, } request := &facebody.MergeImageFaceRequest{ TemplateId: dara.String("template-id-123"), MergeInfos: mergeInfos, AddWatermark: dara.Bool(true), WatermarkType: dara.String("text"), ModelVersion: dara.String("1.0"), } response, err := client.MergeImageFace(request) if err != nil { panic(err) } fmt.Printf("Merged image URL: %s\n", *response.Body.Data.ImageURL) ``` -------------------------------- ### Add Face Image to Entity Source: https://context7.com/alibabacloud-go/facebody-20191230/llms.txt Adds a single face image to a specified entity within a database. Requires defining quality and similarity thresholds for duplicate detection. ```go request := &facebody.AddFaceRequest{ DbName: dara.String("employees_db"), EntityId: dara.String("employee_001"), ImageUrl: dara.String("https://example.com/employee_photo.jpg"), QualityScoreThreshold: dara.Float32(70.0), SimilarityScoreThresholdInEntity: dara.Float32(80.0), // Threshold for duplicate detection within entity SimilarityScoreThresholdBetweenEntity: dara.Float32(70.0), // Threshold for duplicate detection across entities } response, err := client.AddFace(request) if err != nil { panic(err) } fmt.Printf("Face added with ID: %s\n", *response.Body.Data.FaceId) ``` -------------------------------- ### POST CompareFaceWithMask Source: https://context7.com/alibabacloud-go/facebody-20191230/llms.txt Performs face comparison optimized for faces wearing masks. ```APIDOC ## POST CompareFaceWithMask ### Description Performs face comparison optimized for faces wearing masks. ### Request Body - **ImageURLA** (string) - Required - URL of the first masked face image - **ImageURLB** (string) - Required - URL of the second masked face image - **QualityScoreThreshold** (float32) - Optional - Minimum face quality threshold ### Response #### Success Response (200) - **Confidence** (float32) - Similarity confidence score (0-100) ``` -------------------------------- ### POST CompareFace Source: https://context7.com/alibabacloud-go/facebody-20191230/llms.txt Compares two face images and returns a similarity score to determine if they belong to the same person. ```APIDOC ## POST CompareFace ### Description Compares two face images and returns a similarity score to determine if they belong to the same person. ### Request Body - **ImageURLA** (string) - Required - URL of the first image - **ImageURLB** (string) - Required - URL of the second image - **QualityScoreThreshold** (float32) - Optional - Minimum face quality threshold ### Response #### Success Response (200) - **Confidence** (float32) - Similarity confidence score (0-100) ``` -------------------------------- ### Detect Faces in Image Source: https://context7.com/alibabacloud-go/facebody-20191230/llms.txt Detects faces and optionally returns landmarks, pose angles, and quality scores. The request allows specifying the maximum number of faces to detect. ```go request := &facebody.DetectFaceRequest{ ImageURL: dara.String("https://example.com/photo.jpg"), Landmark: dara.Bool(true), // Return 105 facial landmark points Pose: dara.Bool(true), // Return face pose angles (pitch, roll, yaw) Quality: dara.Bool(true), // Return face quality scores MaxFaceNumber: dara.Int64(10), // Maximum faces to detect } response, err := client.DetectFace(request) if err != nil { panic(err) } // Response contains: // - FaceCount: number of faces detected // - FaceRectangles: [x, y, width, height] for each face // - Landmarks: 105 landmark points per face // - PoseList: [pitch, roll, yaw] angles per face // - Qualities: blur, noise, illumination, mask scores fmt.Printf("Detected %d faces\n", *response.Body.Data.FaceCount) ``` -------------------------------- ### Search Face in Database (1:N) Source: https://context7.com/alibabacloud-go/facebody-20191230/llms.txt Searches for matching faces in one or more face databases. Returns a list of potential matches with confidence scores. ```APIDOC ## SearchFace - Search Face in Database (1:N) ### Description Searches for matching faces in one or more face databases. ### Method POST ### Endpoint /api/facebody/SearchFace ### Parameters #### Request Body - **DbName** (string) - Required - The name of the face database to search within. - **ImageUrl** (string) - Required - The URL of the image containing the face to search for. - **Limit** (int32) - Optional - The maximum number of matches to return. - **MaxFaceNum** (int64) - Optional - The maximum number of faces to detect in the query image. - **QualityScoreThreshold** (float32) - Optional - The minimum quality score for detected faces. ### Request Example ```json { "DbName": "employees_db", "ImageUrl": "https://example.com/query_face.jpg", "Limit": 5, "MaxFaceNum": 1, "QualityScoreThreshold": 50.0 } ``` ### Response #### Success Response (200) - **MatchList** (array) - A list of matches found. - **FaceItems** (array) - Details of each matched face. - **EntityId** (string) - The ID of the entity the face belongs to. - **Score** (float32) - The confidence score of the match. #### Response Example ```json { "Body": { "Data": { "MatchList": [ { "FaceItems": [ { "EntityId": "employee_001", "Score": 95.5 } ] } ] }, "RequestId": "search_request_11223" } } ``` ``` -------------------------------- ### Compare Two Faces Source: https://context7.com/alibabacloud-go/facebody-20191230/llms.txt Compares two images to determine if they belong to the same person. A similarity confidence score is returned. ```go request := &facebody.CompareFaceRequest{ ImageURLA: dara.String("https://example.com/person1.jpg"), ImageURLB: dara.String("https://example.com/person2.jpg"), QualityScoreThreshold: dara.Float32(75.0), // Minimum face quality threshold } response, err := client.CompareFace(request) if err != nil { panic(err) } // Response contains similarity confidence score (0-100) // Scores above 70 typically indicate same person fmt.Printf("Similarity confidence: %.2f%%\n", *response.Body.Data.Confidence) ``` -------------------------------- ### LiquifyFace - Face Slimming Source: https://context7.com/alibabacloud-go/facebody-20191230/llms.txt Applies intelligent face slimming effect. ```APIDOC ## LiquifyFace - Face Slimming ### Description Applies intelligent face slimming effect. ### Method POST ### Endpoint /liquify_face ### Parameters #### Query Parameters - **ImageURL** (string) - Required - URL of the image to process. - **SlimDegree** (float) - Optional - Slimming degree (0-100). ### Request Example ```json { "ImageURL": "https://example.com/face.jpg", "SlimDegree": 50.0 } ``` ### Response #### Success Response (200) - **ImageURL** (string) - URL of the slimmed face image. #### Response Example ```json { "Body": { "Data": { "ImageURL": "https://example.com/slimmed_face.jpg" } } } ``` ``` -------------------------------- ### Apply Face Slimming Source: https://context7.com/alibabacloud-go/facebody-20191230/llms.txt Applies a slimming effect to faces based on a specified degree. ```go request := &facebody.LiquifyFaceRequest{ ImageURL: dara.String("https://example.com/face.jpg"), SlimDegree: dara.Float32(50.0), // Slimming degree (0-100) } response, err := client.LiquifyFace(request) if err != nil { panic(err) } fmt.Printf("Slimmed face image URL: %s\n", *response.Body.Data.ImageURL) ``` -------------------------------- ### RetouchSkin - Skin Retouching Source: https://context7.com/alibabacloud-go/facebody-20191230/llms.txt Applies skin retouching and whitening effects to an image. ```go request := &facebody.RetouchSkinRequest{ ImageURL: dara.String("https://example.com/portrait.jpg"), RetouchDegree: dara.Float32(0.6), // Skin retouching level (0-1) WhiteningDegree: dara.Float32(0.4), // Whitening level (0-1) } response, err := client.RetouchSkin(request) if err != nil { panic(err) } fmt.Printf("Retouched image URL: %s\n", *response.Body.Data.ImageURL) ``` -------------------------------- ### Detect Video Living Face Source: https://context7.com/alibabacloud-go/facebody-20191230/llms.txt Performs liveness detection on video content. ```go request := &facebody.DetectVideoLivingFaceRequest{ VideoUrl: dara.String("https://example.com/liveness_video.mp4"), } response, err := client.DetectVideoLivingFace(request) if err != nil { panic(err) } fmt.Printf("Video liveness result. RequestId: %s\n", *response.Body.RequestId) ``` -------------------------------- ### Apply Face Beautification Source: https://context7.com/alibabacloud-go/facebody-20191230/llms.txt Applies skin smoothing, sharpening, and whitening effects to faces. ```go request := &facebody.FaceBeautyRequest{ ImageURL: dara.String("https://example.com/portrait.jpg"), Smooth: dara.Float32(0.5), // Skin smoothing (0-1) Sharp: dara.Float32(0.3), // Face sharpening (0-1) White: dara.Float32(0.4), // Skin whitening (0-1) } response, err := client.FaceBeauty(request) if err != nil { panic(err) } fmt.Printf("Beautified image URL: %s\n", *response.Body.Data.ImageURL) ``` -------------------------------- ### Batch Add Multiple Faces Source: https://context7.com/alibabacloud-go/facebody-20191230/llms.txt Adds multiple face images to an entity in a single request. Useful for onboarding multiple images of the same person. ```APIDOC ## BatchAddFaces - Batch Add Multiple Faces ### Description Adds multiple face images to an entity in a single request. ### Method POST ### Endpoint /api/facebody/BatchAddFaces ### Parameters #### Request Body - **DbName** (string) - Required - The name of the face database. - **EntityId** (string) - Required - The ID of the entity to add the faces to. - **Faces** (array) - Required - A list of faces to add. Each face object should contain an ImageURL. - **ImageURL** (string) - Required - The URL of the face image. - **QualityScoreThreshold** (float32) - Optional - The minimum quality score for the face images. ### Request Example ```json { "DbName": "employees_db", "EntityId": "employee_001", "Faces": [ {"ImageURL": "https://example.com/photo1.jpg"}, {"ImageURL": "https://example.com/photo2.jpg"}, {"ImageURL": "https://example.com/photo3.jpg"} ], "QualityScoreThreshold": 70.0 } ``` ### Response #### Success Response (200) - **RequestId** (string) - The unique identifier for the batch request. #### Response Example ```json { "Body": { "RequestId": "batch_request_67890" } } ``` ``` -------------------------------- ### Infrared Liveness Detection Source: https://context7.com/alibabacloud-go/facebody-20191230/llms.txt Performs liveness detection using infrared camera images, which can be more robust against certain spoofing methods. ```APIDOC ## DetectInfraredLivingFace - Infrared Liveness Detection ### Description Performs liveness detection using infrared camera images. ### Method POST ### Endpoint /api/facebody/DetectInfraredLivingFace ### Parameters #### Request Body - **Tasks** (array) - Required - A list of tasks, where each task contains an infrared image to analyze. - **ImageURL** (string) - Required - The URL of the infrared face image for liveness detection. ### Request Example ```json { "Tasks": [ {"ImageURL": "https://example.com/infrared_face.jpg"} ] } ``` ### Response #### Success Response (200) - **Elements** (array) - Results for each analyzed infrared image. - **Results** (object) - Liveness detection results for the image. #### Response Example ```json { "Body": { "Data": { "Elements": [ { "Results": { "label": "REAL", "rate": 99.1 } } ] }, "RequestId": "infrared_liveness_77889" } } ``` ``` -------------------------------- ### POST AddFaceEntity Source: https://context7.com/alibabacloud-go/facebody-20191230/llms.txt Adds a new face entity (person) to a face database. ```APIDOC ## POST AddFaceEntity ### Description Adds a new face entity (person) to a face database. ### Request Body - **DbName** (string) - Required - Name of the target database - **EntityId** (string) - Required - Unique identifier for the entity - **Labels** (string) - Optional - Metadata labels for the entity ### Response #### Success Response (200) - **RequestId** (string) - Unique identifier for the request ``` -------------------------------- ### Retrieve Real Person Verification Result in Go Source: https://context7.com/alibabacloud-go/facebody-20191230/llms.txt Uses the GetRealPersonVerificationResultRequest to fetch verification status based on a provided token. ```go request := &facebody.GetRealPersonVerificationResultRequest{ VerificationToken: dara.String("verification-token-123"), } response, err := client.GetRealPersonVerificationResult(request) if err != nil { panic(err) } fmt.Printf("Verification passed: %v\n", *response.Body.Data.Passed) ``` -------------------------------- ### Enhance Face Quality Source: https://context7.com/alibabacloud-go/facebody-20191230/llms.txt Improves the visual quality of detected faces in an image. ```go request := &facebody.EnhanceFaceRequest{ ImageURL: dara.String("https://example.com/low_quality_face.jpg"), } response, err := client.EnhanceFace(request) if err != nil { panic(err) } fmt.Printf("Enhanced image URL: %s\n", *response.Body.Data.ImageURL) ``` -------------------------------- ### Detect Pedestrians Source: https://context7.com/alibabacloud-go/facebody-20191230/llms.txt Locates pedestrians in an image and retrieves their bounding box coordinates and confidence scores. ```go request := &facebody.DetectPedestrianRequest{ ImageURL: dara.String("https://example.com/street_scene.jpg"), } response, err := client.DetectPedestrian(request) if err != nil { panic(err) } for _, element := range response.Body.Data.Elements { fmt.Printf("Pedestrian at: [%d, %d, %d, %d] Score: %.2f\n", element.Boxes[0], element.Boxes[1], element.Boxes[2], element.Boxes[3], *element.Score) } ``` -------------------------------- ### MonitorExamination - Online Examination Monitoring Source: https://context7.com/alibabacloud-go/facebody-20191230/llms.txt Monitors examinees during online examinations for cheating detection. ```go request := &facebody.MonitorExaminationRequest{ ImageURL: dara.String("https://example.com/exam_frame.jpg"), Type: dara.Int64(1), // Monitoring type } response, err := client.MonitorExamination(request) if err != nil { panic(err) } fmt.Printf("Examination monitoring result. RequestId: %s\n", *response.Body.RequestId) ``` -------------------------------- ### ExtractFingerPrint - Fingerprint Extraction Source: https://context7.com/alibabacloud-go/facebody-20191230/llms.txt Extracts fingerprint features from an image. ```go request := &facebody.ExtractFingerPrintRequest{ ImageURL: dara.String("https://example.com/fingerprint.jpg"), } response, err := client.ExtractFingerPrint(request) if err != nil { panic(err) } fmt.Printf("Fingerprint extracted. RequestId: %s\n", *response.Body.RequestId) ``` -------------------------------- ### Detect Infrared Living Face Source: https://context7.com/alibabacloud-go/facebody-20191230/llms.txt Performs liveness detection specifically using infrared camera imagery. ```go tasks := []*facebody.DetectInfraredLivingFaceRequestTasks{ {ImageURL: dara.String("https://example.com/infrared_face.jpg")}, } request := &facebody.DetectInfraredLivingFaceRequest{ Tasks: tasks, } response, err := client.DetectInfraredLivingFace(request) if err != nil { panic(err) } for _, element := range response.Body.Data.Elements { fmt.Printf("Infrared liveness result: %v\n", element.Results) } ``` -------------------------------- ### FaceBeauty - Face Beautification Source: https://context7.com/alibabacloud-go/facebody-20191230/llms.txt Applies beautification effects to faces including skin smoothing, sharpening, and whitening. ```APIDOC ## FaceBeauty - Face Beautification ### Description Applies beautification effects to faces including skin smoothing, sharpening, and whitening. ### Method POST ### Endpoint /face_beauty ### Parameters #### Query Parameters - **ImageURL** (string) - Required - URL of the image to process. - **Smooth** (float) - Optional - Skin smoothing effect (0-1). - **Sharp** (float) - Optional - Face sharpening effect (0-1). - **White** (float) - Optional - Skin whitening effect (0-1). ### Request Example ```json { "ImageURL": "https://example.com/portrait.jpg", "Smooth": 0.5, "Sharp": 0.3, "White": 0.4 } ``` ### Response #### Success Response (200) - **ImageURL** (string) - URL of the beautified image. #### Response Example ```json { "Body": { "Data": { "ImageURL": "https://example.com/beautified_portrait.jpg" } } } ``` ``` -------------------------------- ### Detect Deepfake Face Source: https://context7.com/alibabacloud-go/facebody-20191230/llms.txt Analyzes images to determine if they have been manipulated or generated by AI. ```go tasks := []*facebody.DeepfakeFaceRequestTasks{ {ImageURL: dara.String("https://example.com/suspect_image.jpg")}, } request := &facebody.DeepfakeFaceRequest{ Tasks: tasks, } response, err := client.DeepfakeFace(request) if err != nil { panic(err) for _, element := range response.Body.Data.Elements { fmt.Printf("Deepfake detection result: %v\n", element.Results) } ``` -------------------------------- ### Video Liveness Detection Source: https://context7.com/alibabacloud-go/facebody-20191230/llms.txt Performs liveness detection on video content, analyzing motion and other cues to determine if the video is from a live person. ```APIDOC ## DetectVideoLivingFace - Video Liveness Detection ### Description Performs liveness detection on video content. ### Method POST ### Endpoint /api/facebody/DetectVideoLivingFace ### Parameters #### Request Body - **VideoUrl** (string) - Required - The URL of the video file for liveness detection. ### Request Example ```json { "VideoUrl": "https://example.com/liveness_video.mp4" } ``` ### Response #### Success Response (200) - **RequestId** (string) - The unique identifier for the video liveness detection request. #### Response Example ```json { "Body": { "RequestId": "video_liveness_12345" } } ``` ``` -------------------------------- ### GenerateHumanAnimeStyle - Anime Style Generation Source: https://context7.com/alibabacloud-go/facebody-20191230/llms.txt Converts a portrait to anime or cartoon style. ```go request := &facebody.GenerateHumanAnimeStyleRequest{ ImageURL: dara.String("https://example.com/portrait.jpg"), AlgoType: dara.String("anime"), } response, err := client.GenerateHumanAnimeStyle(request) if err != nil { panic(err) } fmt.Printf("Anime style image URL: %s\n", *response.Body.Data.ImageURL) ``` -------------------------------- ### Detect Pedestrian Attributes Source: https://context7.com/alibabacloud-go/facebody-20191230/llms.txt Identifies pedestrians and extracts specific attributes like gender and age. ```go request := &facebody.PedestrianDetectAttributeRequest{ ImageURL: dara.String("https://example.com/pedestrian.jpg"), } response, err := client.PedestrianDetectAttribute(request) if err != nil { panic(err) } for _, attr := range response.Body.Data.Attributes { fmt.Printf("Pedestrian attributes: Gender=%s, Age=%s\n", *attr.Gender.Name, *attr.Age.Name) } ``` -------------------------------- ### Detect Celebrity Source: https://context7.com/alibabacloud-go/facebody-20191230/llms.txt Identifies known celebrities within an image. ```go request := &facebody.DetectCelebrityRequest{ ImageURL: dara.String("https://example.com/celebrity_photo.jpg"), } response, err := client.DetectCelebrity(request) if err != nil { panic(err) } for _, celebrity := range response.Body.Data.FaceRecognizeResults { fmt.Printf("Celebrity: %s\n", *celebrity.Name) } ``` -------------------------------- ### Recognize Facial Expressions Source: https://context7.com/alibabacloud-go/facebody-20191230/llms.txt Performs expression analysis on an image and iterates through detected elements. ```go request := &facebody.RecognizeExpressionRequest{ ImageURL: dara.String("https://example.com/expression.jpg"), } response, err := client.RecognizeExpression(request) if err != nil { panic(err) } for _, element := range response.Body.Data.Elements { fmt.Printf("Expression: %s (Probability: %.2f)\n", *element.Expression, *element.FaceProbability) } ``` -------------------------------- ### Add Face Image to Entity Source: https://context7.com/alibabacloud-go/facebody-20191230/llms.txt Adds a face image to an existing entity in the face database. It allows specifying thresholds for quality and similarity. ```APIDOC ## AddFace - Add Face Image to Entity ### Description Adds a face image to an existing entity in the face database. ### Method POST ### Endpoint /api/facebody/AddFace ### Parameters #### Request Body - **DbName** (string) - Required - The name of the face database. - **EntityId** (string) - Required - The ID of the entity to add the face to. - **ImageUrl** (string) - Required - The URL of the face image. - **QualityScoreThreshold** (float32) - Optional - The minimum quality score for the face image. - **SimilarityScoreThresholdInEntity** (float32) - Optional - The threshold for detecting duplicate faces within the same entity. - **SimilarityScoreThresholdBetweenEntity** (float32) - Optional - The threshold for detecting duplicate faces across different entities. ### Request Example ```json { "DbName": "employees_db", "EntityId": "employee_001", "ImageUrl": "https://example.com/employee_photo.jpg", "QualityScoreThreshold": 70.0, "SimilarityScoreThresholdInEntity": 80.0, "SimilarityScoreThresholdBetweenEntity": 70.0 } ``` ### Response #### Success Response (200) - **FaceId** (string) - The unique identifier of the added face. #### Response Example ```json { "Body": { "Data": { "FaceId": "face_12345" }, "RequestId": "request_abcde" } } ``` ``` -------------------------------- ### Compare Masked Faces Source: https://context7.com/alibabacloud-go/facebody-20191230/llms.txt Performs face comparison specifically optimized for individuals wearing masks. ```go request := &facebody.CompareFaceWithMaskRequest{ ImageURLA: dara.String("https://example.com/masked_face1.jpg"), ImageURLB: dara.String("https://example.com/masked_face2.jpg"), QualityScoreThreshold: dara.Float32(50.0), } response, err := client.CompareFaceWithMask(request) if err != nil { panic(err) } fmt.Printf("Masked face similarity: %.2f%%\n", *response.Body.Data.Confidence) ``` -------------------------------- ### Face Liveness Detection Source: https://context7.com/alibabacloud-go/facebody-20191230/llms.txt Detects whether face images are from a live person or a spoofed attack. Useful for security and verification purposes. ```APIDOC ## DetectLivingFace - Face Liveness Detection ### Description Detects whether face images are from a live person or a spoofed attack (photo/video replay). ### Method POST ### Endpoint /api/facebody/DetectLivingFace ### Parameters #### Request Body - **Tasks** (array) - Required - A list of tasks, where each task contains an image to analyze. - **ImageURL** (string) - Required - The URL of the face image for liveness detection. ### Request Example ```json { "Tasks": [ {"ImageURL": "https://example.com/live_test.jpg"} ] } ``` ### Response #### Success Response (200) - **Elements** (array) - Results for each analyzed image. - **Results** (array) - Liveness detection results for the image. - **Label** (string) - The liveness detection label (e.g., "REAL", "SPOOF"). - **Rate** (float32) - The confidence rate for the label. #### Response Example ```json { "Body": { "Data": { "Elements": [ { "Results": [ { "Label": "REAL", "Rate": 98.7 } ] } ] }, "RequestId": "liveness_request_44556" } } ``` ``` -------------------------------- ### Count Human Bodies Source: https://context7.com/alibabacloud-go/facebody-20191230/llms.txt Counts the total number of human bodies detected in an image. ```go request := &facebody.DetectBodyCountRequest{ ImageURL: dara.String("https://example.com/crowd.jpg"), } response, err := client.DetectBodyCount(request) if err != nil { panic(err) } fmt.Printf("Body count: %d\n", *response.Body.Data.PersonNumber) ``` -------------------------------- ### DetectBodyCount - Body Count Detection Source: https://context7.com/alibabacloud-go/facebody-20191230/llms.txt Counts the number of human bodies in an image. ```APIDOC ## DetectBodyCount - Body Count Detection ### Description Counts the number of human bodies in an image. ### Method POST ### Endpoint /detect_body_count ### Parameters #### Query Parameters - **ImageURL** (string) - Required - URL of the image to process. ### Request Example ```json { "ImageURL": "https://example.com/crowd.jpg" } ``` ### Response #### Success Response (200) - **PersonNumber** (integer) - The total number of people detected in the image. #### Response Example ```json { "Body": { "Data": { "PersonNumber": 15 } } } ``` ``` -------------------------------- ### RecognizeExpression - Expression Recognition Source: https://context7.com/alibabacloud-go/facebody-20191230/llms.txt Recognizes facial expressions in an image. ```APIDOC ## RecognizeExpression - Expression Recognition ### Description Recognizes facial expressions in an image. ### Method POST ### Endpoint /recognize_expression ### Parameters #### Query Parameters - **ImageURL** (string) - Required - URL of the image to process. ### Request Example ```json { "ImageURL": "https://example.com/expression.jpg" } ``` ### Response #### Success Response (200) - **Elements** (array) - List of detected expressions and their probabilities. - **Expression** (string) - The recognized facial expression. - **FaceProbability** (float) - The probability of the expression. #### Response Example ```json { "Body": { "Data": { "Elements": [ { "Expression": "Happy", "FaceProbability": 0.95 } ] } } } ``` ``` -------------------------------- ### DetectPedestrian - Pedestrian Detection Source: https://context7.com/alibabacloud-go/facebody-20191230/llms.txt Detects and locates pedestrians in an image. ```APIDOC ## DetectPedestrian - Pedestrian Detection ### Description Detects and locates pedestrians in an image. ### Method POST ### Endpoint /detect_pedestrian ### Parameters #### Query Parameters - **ImageURL** (string) - Required - URL of the image to process. ### Request Example ```json { "ImageURL": "https://example.com/street_scene.jpg" } ``` ### Response #### Success Response (200) - **Elements** (array) - List of detected pedestrians. - **Boxes** (array of integers) - Bounding box coordinates [x1, y1, x2, y2] of the pedestrian. - **Score** (float) - Confidence score of the detection. #### Response Example ```json { "Body": { "Data": { "Elements": [ { "Boxes": [100, 150, 200, 300], "Score": 0.85 } ] } } } ``` ``` -------------------------------- ### EnhanceFace - Face Enhancement Source: https://context7.com/alibabacloud-go/facebody-20191230/llms.txt Enhances and improves the quality of face images. ```APIDOC ## EnhanceFace - Face Enhancement ### Description Enhances and improves the quality of face images. ### Method POST ### Endpoint /enhance_face ### Parameters #### Query Parameters - **ImageURL** (string) - Required - URL of the image to process. ### Request Example ```json { "ImageURL": "https://example.com/low_quality_face.jpg" } ``` ### Response #### Success Response (200) - **ImageURL** (string) - URL of the enhanced image. #### Response Example ```json { "Body": { "Data": { "ImageURL": "https://example.com/enhanced_face.jpg" } } } ``` ``` -------------------------------- ### Blur Faces Source: https://context7.com/alibabacloud-go/facebody-20191230/llms.txt Applies a blurring effect to all detected faces for privacy. ```go request := &facebody.BlurFaceRequest{ ImageURL: dara.String("https://example.com/photo.jpg"), } response, err := client.BlurFace(request) if err != nil { panic(err) } fmt.Printf("Blurred image URL: %s\n", *response.Body.Data.ImageURL) ``` -------------------------------- ### Detect Living Face Source: https://context7.com/alibabacloud-go/facebody-20191230/llms.txt Checks if the provided image contains a live person to prevent spoofing attacks. ```go tasks := []*facebody.DetectLivingFaceRequestTasks{ {ImageURL: dara.String("https://example.com/live_test.jpg")}, } request := &facebody.DetectLivingFaceRequest{ Tasks: tasks, } response, err := client.DetectLivingFace(request) if err != nil { panic(err) } for _, element := range response.Body.Data.Elements { for _, result := range element.Results { fmt.Printf("Liveness: %s (Rate: %.2f%%)\n", *result.Label, *result.Rate) } } ``` -------------------------------- ### PedestrianDetectAttribute - Pedestrian Attribute Detection Source: https://context7.com/alibabacloud-go/facebody-20191230/llms.txt Detects pedestrians and their attributes (clothing, accessories, etc.). ```APIDOC ## PedestrianDetectAttribute - Pedestrian Attribute Detection ### Description Detects pedestrians and their attributes (clothing, accessories, etc.). ### Method POST ### Endpoint /pedestrian_detect_attribute ### Parameters #### Query Parameters - **ImageURL** (string) - Required - URL of the image to process. ### Request Example ```json { "ImageURL": "https://example.com/pedestrian.jpg" } ``` ### Response #### Success Response (200) - **Attributes** (array) - List of detected pedestrian attributes. - **Gender** (object) - Detected gender attributes. - **Name** (string) - The name of the gender attribute. - **Age** (object) - Detected age attributes. - **Name** (string) - The name of the age attribute. #### Response Example ```json { "Body": { "Data": { "Attributes": [ { "Gender": {"Name": "Male"}, "Age": {"Name": "Adult"} } ] } } } ``` ``` -------------------------------- ### BlurFace - Face Blurring Source: https://context7.com/alibabacloud-go/facebody-20191230/llms.txt Blurs all detected faces in an image for privacy protection. ```APIDOC ## BlurFace - Face Blurring ### Description Blurs all detected faces in an image for privacy protection. ### Method POST ### Endpoint /blur_face ### Parameters #### Query Parameters - **ImageURL** (string) - Required - URL of the image to process. ### Request Example ```json { "ImageURL": "https://example.com/photo.jpg" } ``` ### Response #### Success Response (200) - **ImageURL** (string) - URL of the image with blurred faces. #### Response Example ```json { "Body": { "Data": { "ImageURL": "https://example.com/blurred_photo.jpg" } } } ``` ``` -------------------------------- ### RecognizeFace - Face Attribute Recognition Source: https://context7.com/alibabacloud-go/facebody-20191230/llms.txt Recognizes multiple face attributes including age, gender, expression, glasses, hat, and mask. ```APIDOC ## RecognizeFace - Face Attribute Recognition ### Description Recognizes multiple face attributes including age, gender, expression, glasses, hat, and mask. ### Method POST ### Endpoint /recognize_face ### Parameters #### Query Parameters - **ImageURL** (string) - Required - URL of the image to process. - **Age** (boolean) - Optional - Whether to detect age. - **Gender** (boolean) - Optional - Whether to detect gender. - **Expression** (boolean) - Optional - Whether to detect expression. - **Glass** (boolean) - Optional - Whether to detect glasses. - **Hat** (boolean) - Optional - Whether to detect hat. - **Mask** (boolean) - Optional - Whether to detect mask. - **Beauty** (boolean) - Optional - Whether to calculate beauty score. - **Quality** (boolean) - Optional - Whether to assess image quality. - **MaxFaceNumber** (integer) - Optional - Maximum number of faces to detect. ### Request Example ```json { "ImageURL": "https://example.com/portrait.jpg", "Age": true, "Gender": true, "Expression": true, "Glass": true, "Hat": true, "Mask": true, "Beauty": true, "Quality": true, "MaxFaceNumber": 5 } ``` ### Response #### Success Response (200) - **AgeList** (array) - List of age estimates for each detected face. - **GenderList** (array) - List of gender predictions for each detected face. - **ExpressionList** (array) - List of expression recognitions for each detected face. - **GlassList** (array) - List of glass detections for each detected face. - **HatList** (array) - List of hat detections for each detected face. - **MaskList** (array) - List of mask detections for each detected face. - **BeautyList** (array) - List of beauty scores for each detected face. - **QualityList** (array) - List of image quality assessments for each detected face. #### Response Example ```json { "Body": { "Data": { "AgeList": [{"Value": 30}], "GenderList": [{"Value": "Male"}], "ExpressionList": [{"Value": "Happy"}], "GlassList": [{"Value": "None"}], "HatList": [{"Value": "None"}], "MaskList": [{"Value": "None"}], "BeautyList": [{"Value": 80.5}], "QualityList": [{"Value": 0.9}] } } } ``` ```