Open uniquejava opened 5 years ago
Detect, identify, analyze, organize, and tag faces in photos
30,000 transactions, 20 per minute.
Endpoint: https://westcentralus.api.cognitive.microsoft.com/face/v1.0
Key 1:
Key 2:
Quick-start Guide
curl -si -X PUT "https://westcentralus.api.cognitive.microsoft.com/face/v1.0/largepersongroups/<some_group_id>" \
-H "Content-Type: application/json" \
-H "Ocp-Apim-Subscription-Key: <some_key1>" \
-d '{"name":"super group"}'
curl -si -X POST "https://westcentralus.api.cognitive.microsoft.com/face/v1.0/largepersongroups/<some_group_id>/persons" \
-H "Content-Type: application/json" \
-H "Ocp-Apim-Subscription-Key: <some_key1>" \
-d '{"name":"Xxx Yin", "userData":"userId=some_private_id"}'
{"personId":"<some_person_id>"}
curl -si -X POST "https://westcentralus.api.cognitive.microsoft.com/face/v1.0/largepersongroups/<some_group_id>/persons/<some_person_id>/persistedfaces"
-H "Content-Type: application/json"
-H "Ocp-Apim-Subscription-Key: <some_key1>"
必须指定content-type=0
curl -si -X POST "https://westcentralus.api.cognitive.microsoft.com/face/v1.0/largepersongroups/<some_group_id>/train" \
-H "Content-Length: 0" \
-H "Ocp-Apim-Subscription-Key: <some_key1>"
curl -si "https://westcentralus.api.cognitive.microsoft.com/face/v1.0/largepersongroups/<some_group_id>/training" \
-H "Ocp-Apim-Subscription-Key: <some_key1>"
curl -si https://westcentralus.api.cognitive.microsoft.com/face/v1.0/largepersongroups/<some_group_id>/persons?top=1000 \
-H "Ocp-Apim-Subscription-Key: <some_key1>"
[{
"personId": "<some_person_id>",
"persistedFaceIds": ["<some_face_id1>", "<some_face_id2>"],
"name": "xxx yin",
"userData": "userId=some_private_id"
}, {
"personId": "<some_person_id>",
"persistedFaceIds": ["<some_face_id>"],
"name": "nobody noname",
"userData": "userId=some_private_id"
}]
必须加content-type, 必须用--data-binary
参数.
curl -si -X POST https://westcentralus.api.cognitive.microsoft.com/face/v1.0/detect\?returnFaceId\=true\&returnFaceLandmarks\=false \
-H "Ocp-Apim-Subscription-Key: <some_key1>" \
-H "Content-Type: application/octet-stream" \
--data-binary "@/Users/xxx/Pictures/xxxx/IMG_3793.jpg"
[{"faceId":"<some_defected_face_id>","faceRectangle":{"top":1100,"left":580,"width":1122,"height":1122}}]%
curl -si -X POST "https://westcentralus.api.cognitive.microsoft.com/face/v1.0/identify" \
-H "Content-Type: application/json" \
-H "Ocp-Apim-Subscription-Key: <some_key1>" \
-d '{"largePersonGroupId":"<some_group_id>","faceIds":["<some_defected_face_id>"], "maxNumOfCandidatesReturned": 5,"confidenceThreshold": 0.5}'
[{"faceId":"<some_defected_face_id>","candidates":[{"personId":"<some_person_id>","confidence":0.90449},{"personId":"<some_other_person_id>","confidence":0.77416}]}]
https://azure.microsoft.com/en/services/cognitive-services/face/