Baidu cloud face recognition online API call simple test

1.0: Create face recognition application
1.1: Find face recognition from product category

 

 

1.2: Click to use now

 

 

1.3: Click to create an application

 

 

1.4: Enter the application name, application type, application description (custom fill), and create immediately

 

 

1.5: Successfully created and view the application

2.0: get access token

2.1: View API Key and Secret Key to exchange for access token

 

2.3: Copy the link with the access token to the browser to open, find the access token and copy and save it to use when calling the excuse

 3.0: Download the interface calling tool—Postman


The download address is as follows:
        Mac address: https://app.getpostman.com/app/download/osx64?utm_source=site&utm_medium=apps&utm_campaign=macapp
       Windows address: https://www.getpostman.com/downloads/

 3.1: postman installation tutorial


(1) Double-click the installation package
(2) If you log in for the first time without an account, you can click the blue font part at the bottom of the icon to directly enter the postman main interface

 


4.0: Make interface calls


4.1: Interface call


     Quickly make interface requests on postman.
     The details are as follows:
    (1) Switch the request format to "post"
    (2) Enter the request address (take face search as an example):
          https://aip.baidubce.com/rest/2.0/face/v3/search?access_token =【acquired access-token】


4.2: Add the value of the copied access-token Example:


 https://aip.baidubce.com/rest/2.0/face/v3/search?access_token=24.2f5fb2774197ed080ac3616b4c84edfa.2592000.1574389183.282335-17597900


4.3: Change the request format to post input address


 4.4: Modify the request header (header)


         Key column input: Content-Type
         Value column input: application/x-www-form-urlencoded

 4.5: Click body,


         Select "x-www-form-urlencoded", and enter a request parameter in key and value respectively.
        They are:
                the result of base64 transcoding of image and picture
Use: http://imgbase64.duoshitong.com, remove "data:image/*;base64," after transcoding)

 Upload a photo of the face to be recognized

We copy the key and VALUE of the image and the converted image respectively

 5.0: Face database creation


5.1: We also need to enter a set of values ​​in the body, which is the name of the face database we want to choose for comparison. At this time, we have not created a face database. Go back to our application and click on the face database management on the left

 

5.2: Enter our application and click create

 

 

5.3: Create a group name and confirm

 

 

5.4: Enter the user group and create

 

 5.5: You can define your own by entering the user ID, or use a mobile phone number. Click to add a picture. We'd better add different photos of the same person who just uploaded the picture, so that we can compare and see the recognition results

 

 


Click to confirm, then the first face in our face database is almost created

 


6.0: Excuse the call request


6.1: Go back to the body just now and add input parameters image_type and BASE64  
group_id_list and user group id in KEY and VALUE respectively. The user group is the group ID we created, not the personal face ID.
For example, image_type and BASE64
       group_id_list and test_3

 6.2: Then our call is successful. I uploaded the face pictures of the same person in different situations, and the results will be returned below. Normally, if the score is above 80, it will be considered the same person.

Guess you like

Origin blog.csdn.net/m0_38124502/article/details/102698836