-
Notifications
You must be signed in to change notification settings - Fork 5.1k
/
Face.json
5710 lines (5710 loc) · 217 KB
/
Face.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
{
"swagger": "2.0",
"info": {
"version": "1.0-preview",
"title": "Face Client",
"description": "An API for face detection, verification, and identification."
},
"securityDefinitions": {
"apim_key": {
"type": "apiKey",
"name": "Ocp-Apim-Subscription-Key",
"in": "header"
}
},
"security": [
{
"apim_key": []
}
],
"x-ms-parameterized-host": {
"hostTemplate": "{Endpoint}/face/v1.0-preview",
"useSchemePrefix": false,
"parameters": [
{
"$ref": "#/parameters/Endpoint"
}
]
},
"paths": {
"/findsimilars": {
"post": {
"description": "Given query face's faceId, to search the similar-looking faces from a faceId array, a face list or a large face list. faceId array contains the faces created by [Face - Detect With Url](https://docs.microsoft.com/rest/api/faceapi/face/detectwithurl) or [Face - Detect With Stream](https://docs.microsoft.com/rest/api/faceapi/face/detectwithstream), which will expire at the time specified by faceIdTimeToLive after creation. A \"faceListId\" is created by [FaceList - Create](https://docs.microsoft.com/rest/api/faceapi/facelist/create) containing persistedFaceIds that will not expire. And a \"largeFaceListId\" is created by [LargeFaceList - Create](https://docs.microsoft.com/rest/api/faceapi/largefacelist/create) containing persistedFaceIds that will also not expire. Depending on the input the returned similar faces list contains faceIds or persistedFaceIds ranked by similarity.\n<br/>Find similar has two working modes, \"matchPerson\" and \"matchFace\". \"matchPerson\" is the default mode that it tries to find faces of the same person as possible by using internal same-person thresholds. It is useful to find a known person's other photos. Note that an empty list will be returned if no faces pass the internal thresholds. \"matchFace\" mode ignores same-person thresholds and returns ranked similar faces anyway, even the similarity is low. It can be used in the cases like searching celebrity-looking faces.\n<br/>The 'recognitionModel' associated with the query face's faceId should be the same as the 'recognitionModel' used by the target faceId array, face list or large face list.\n",
"operationId": "Face_FindSimilar",
"parameters": [
{
"name": "body",
"in": "body",
"description": "Request body for Find Similar.",
"required": true,
"x-ms-client-flatten": true,
"schema": {
"$ref": "#/definitions/FindSimilarRequest"
}
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"responses": {
"200": {
"description": "A successful call returns an array of the most similar faces represented in faceId if the input parameter is faceIds or persistedFaceId if the input parameter is faceListId.",
"schema": {
"$ref": "#/definitions/SimilarFaces"
}
},
"default": {
"description": "Error response.",
"schema": {
"$ref": "#/definitions/APIError"
}
}
},
"x-ms-examples": {
"Find similar results example": {
"$ref": "./examples/FindSimilar.json"
}
}
}
},
"/group": {
"post": {
"description": "Divide candidate faces into groups based on face similarity.<br />\n* The output is one or more disjointed face groups and a messyGroup. A face group contains faces that have similar looking, often of the same person. Face groups are ranked by group size, i.e. number of faces. Notice that faces belonging to a same person might be split into several groups in the result.\n* MessyGroup is a special face group containing faces that cannot find any similar counterpart face from original faces. The messyGroup will not appear in the result if all faces found their counterparts.\n* Group API needs at least 2 candidate faces and 1000 at most. We suggest to try [Face - Verify](https://docs.microsoft.com/rest/api/faceapi/face/verifyfacetoface) when you only have 2 candidate faces.\n* The 'recognitionModel' associated with the query faces' faceIds should be the same.\n",
"operationId": "Face_Group",
"parameters": [
{
"name": "body",
"description": "Request body for grouping.",
"in": "body",
"required": true,
"x-ms-client-flatten": true,
"schema": {
"$ref": "#/definitions/GroupRequest"
}
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"responses": {
"200": {
"description": "A successful call returns one or more groups of similar faces (rank by group size) and a messyGroup.",
"schema": {
"$ref": "#/definitions/GroupResult"
}
},
"default": {
"description": "Error response.",
"schema": {
"$ref": "#/definitions/APIError"
}
}
},
"x-ms-examples": {
"Group example": {
"$ref": "./examples/Group.json"
}
}
}
},
"/identify": {
"post": {
"description": "1-to-many identification to find the closest matches of the specific query person face from a person group, large person group, person directory dynamic person group or person directory personIds array.\n<br/> For each face in the faceIds array, Face Identify will compute similarities between the query face and all the faces in the person group (given by personGroupId) or large person group (given by largePersonGroupId), and return candidate person(s) for that face ranked by similarity confidence. The person group/large person group should be trained to make it ready for identification. See more in [PersonGroup - Train](https://docs.microsoft.com/rest/api/faceapi/persongroup/train) and [LargePersonGroup - Train](https://docs.microsoft.com/rest/api/faceapi/largepersongroup/train).\n<br/>\n \nRemarks:<br />\n* The algorithm allows more than one face to be identified independently at the same request, but no more than 10 faces.\n* Each person in the person group/large person group could have more than one face, but no more than 248 faces.\n* Higher face image quality means better identification precision. Please consider high-quality faces: frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger.\n* Number of candidates returned is restricted by maxNumOfCandidatesReturned and confidenceThreshold. If no person is identified, the returned candidates will be an empty array.\n* Try [Face - Find Similar](https://docs.microsoft.com/rest/api/faceapi/face/findsimilar) when you need to find similar faces from a face list/large face list instead of a person group/large person group.\n* The 'recognitionModel' associated with the query faces' faceIds should be the same as the 'recognitionModel' used by the target person group or large person group.\n",
"operationId": "Face_Identify",
"parameters": [
{
"name": "body",
"description": "Request body for identify operation.",
"in": "body",
"required": true,
"x-ms-client-flatten": true,
"schema": {
"$ref": "#/definitions/IdentifyRequest"
}
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"responses": {
"200": {
"description": "A successful call returns the identified candidate person(s) for each query face.",
"schema": {
"$ref": "#/definitions/IdentifyResults"
}
},
"default": {
"description": "Error response.",
"schema": {
"$ref": "#/definitions/APIError"
}
}
},
"x-ms-examples": {
"Identify example": {
"$ref": "./examples/Identify.json"
}
}
}
},
"/verify": {
"post": {
"description": "Verify whether two faces belong to a same person or whether one face belongs to a person.\n<br/>\nRemarks:<br />\n* Higher face image quality means better identification precision. Please consider high-quality faces: frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger.\n* For the scenarios that are sensitive to accuracy please make your own judgment.\n* The 'recognitionModel' associated with the query faces' faceIds should be the same as the 'recognitionModel' used by the target face, person group or large person group.\n",
"operationId": "Face_VerifyFaceToFace",
"parameters": [
{
"name": "body",
"description": "Request body for face to face verification.",
"in": "body",
"required": true,
"x-ms-client-flatten": true,
"schema": {
"$ref": "#/definitions/VerifyFaceToFaceRequest"
}
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"responses": {
"200": {
"description": "A successful call returns the verification result.",
"schema": {
"$ref": "#/definitions/VerifyResult"
}
},
"default": {
"description": "Error response.",
"schema": {
"$ref": "#/definitions/APIError"
}
}
},
"x-ms-examples": {
"Verify faces example": {
"$ref": "./examples/VerifyFaceToFace.json"
}
}
}
},
"/persongroups/{personGroupId}/persons": {
"post": {
"description": "Create a new person in a specified person group.",
"operationId": "PersonGroupPerson_Create",
"parameters": [
{
"$ref": "#/parameters/personGroupId"
},
{
"name": "body",
"description": "Request body for creating new person.",
"in": "body",
"required": true,
"x-ms-client-flatten": true,
"schema": {
"$ref": "#/definitions/NameAndUserDataContract"
}
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"responses": {
"200": {
"description": "A successful call returns a new personId created.",
"schema": {
"$ref": "#/definitions/Person"
}
},
"default": {
"description": "Error response.",
"schema": {
"$ref": "#/definitions/APIError"
}
}
},
"x-ms-examples": {
"Create new person for person group example": {
"$ref": "./examples/CreateNewPersonGroupPerson.json"
}
}
},
"get": {
"description": "List all persons in a person group, and retrieve person information (including personId, name, userData and persistedFaceIds of registered faces of the person).",
"operationId": "PersonGroupPerson_List",
"parameters": [
{
"$ref": "#/parameters/personGroupId"
},
{
"name": "start",
"description": "Starting person id to return (used to list a range of persons).",
"in": "query",
"required": false,
"type": "string"
},
{
"name": "top",
"description": "Number of persons to return starting with the person id indicated by the 'start' parameter.",
"in": "query",
"required": false,
"type": "integer",
"minimum": 1,
"maximum": 1000
}
],
"produces": [
"application/json"
],
"responses": {
"200": {
"description": "A successful call returns an array of person information that belong to the person group.",
"schema": {
"$ref": "#/definitions/Persons"
}
},
"default": {
"description": "Error response.",
"schema": {
"$ref": "#/definitions/APIError"
}
}
},
"x-ms-examples": {
"List persons in person group": {
"$ref": "./examples/ListPersonGroupPersons.json"
}
}
}
},
"/persongroups/{personGroupId}/persons/{personId}": {
"delete": {
"description": "Delete an existing person from a person group. The persistedFaceId, userData, person name and face feature in the person entry will all be deleted.",
"operationId": "PersonGroupPerson_Delete",
"parameters": [
{
"$ref": "#/parameters/personGroupId"
},
{
"$ref": "#/parameters/personId"
}
],
"produces": [
"application/json"
],
"responses": {
"200": {
"description": "A successful call returns an empty response body."
},
"default": {
"description": "Error response.",
"schema": {
"$ref": "#/definitions/APIError"
}
}
},
"x-ms-examples": {
"Delete an existing person example": {
"$ref": "./examples/DeletePersonGroupPerson.json"
}
}
},
"get": {
"description": "Retrieve a person's information, including registered persisted faces, name and userData.",
"operationId": "PersonGroupPerson_Get",
"parameters": [
{
"$ref": "#/parameters/personGroupId"
},
{
"$ref": "#/parameters/personId"
}
],
"produces": [
"application/json"
],
"responses": {
"200": {
"description": "A successful call returns the person's information.",
"schema": {
"$ref": "#/definitions/Person"
}
},
"default": {
"description": "Error response.",
"schema": {
"$ref": "#/definitions/APIError"
}
}
},
"x-ms-examples": {
"Get person example": {
"$ref": "./examples/GetPersonGroupPerson.json"
}
}
},
"patch": {
"description": "Update name or userData of a person.",
"operationId": "PersonGroupPerson_Update",
"parameters": [
{
"$ref": "#/parameters/personGroupId"
},
{
"$ref": "#/parameters/personId"
},
{
"name": "body",
"description": "Request body for person update operation.",
"in": "body",
"required": true,
"x-ms-client-flatten": true,
"schema": {
"$ref": "#/definitions/NameAndUserDataContract"
}
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"responses": {
"200": {
"description": "A successful call returns an empty response body."
},
"default": {
"description": "Error response.",
"schema": {
"$ref": "#/definitions/APIError"
}
}
},
"x-ms-examples": {
"Update person example": {
"$ref": "./examples/UpdatePersonGroupPerson.json"
}
}
}
},
"/persongroups/{personGroupId}/persons/{personId}/persistedfaces/{persistedFaceId}": {
"delete": {
"description": "Delete a face from a person in a person group by specified personGroupId, personId and persistedFaceId.\n<br /> Adding/deleting faces to/from a same person will be processed sequentially. Adding/deleting faces to/from different persons are processed in parallel.",
"operationId": "PersonGroupPerson_DeleteFace",
"parameters": [
{
"$ref": "#/parameters/personGroupId"
},
{
"$ref": "#/parameters/personId"
},
{
"$ref": "#/parameters/persistedFaceId"
}
],
"produces": [
"application/json"
],
"responses": {
"200": {
"description": "A successful call returns an empty response body."
},
"default": {
"description": "Error response.",
"schema": {
"$ref": "#/definitions/APIError"
}
}
},
"x-ms-examples": {
"Delete face from person example": {
"$ref": "./examples/DeletePersonGroupPersonFace.json"
}
}
},
"get": {
"description": "Retrieve information about a persisted face (specified by persistedFaceId, personId and its belonging personGroupId).",
"operationId": "PersonGroupPerson_GetFace",
"parameters": [
{
"$ref": "#/parameters/personGroupId"
},
{
"$ref": "#/parameters/personId"
},
{
"$ref": "#/parameters/persistedFaceId"
}
],
"produces": [
"application/json"
],
"responses": {
"200": {
"description": "A successful call returns target persisted face's information (persistedFaceId and userData).",
"schema": {
"$ref": "#/definitions/PersistedFace"
}
},
"default": {
"description": "Error response.",
"schema": {
"$ref": "#/definitions/APIError"
}
}
},
"x-ms-examples": {
"Get persisted face example": {
"$ref": "./examples/GetPersonGroupPersistedFace.json"
}
}
},
"patch": {
"description": "Add a face to a person into a person group for face identification or verification. To deal with an image contains multiple faces, input face can be specified as an image with a targetFace rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted face feature will be stored on server until [PersonGroup PersonFace - Delete](https://docs.microsoft.com/rest/api/faceapi/persongroupperson/deleteface), [PersonGroup Person - Delete](https://docs.microsoft.com/rest/api/faceapi/persongroupperson/delete) or [PersonGroup - Delete](https://docs.microsoft.com/rest/api/faceapi/persongroup/delete) is called.\n<br /> Note persistedFaceId is different from faceId generated by [Face - Detect](https://docs.microsoft.com/rest/api/faceapi/face/detectwithurl).\n* Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger.\n* Each person entry can hold up to 248 faces.\n* JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB.\n* \"targetFace\" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the provided \"targetFace\" rectangle is not returned from [Face - Detect](https://docs.microsoft.com/rest/api/faceapi/face/detectwithurl), there’s no guarantee to detect and add the face successfully.\n* Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause failures.\n* Adding/deleting faces to/from a same person will be processed sequentially. Adding/deleting faces to/from different persons are processed in parallel.",
"operationId": "PersonGroupPerson_UpdateFace",
"parameters": [
{
"$ref": "#/parameters/personGroupId"
},
{
"$ref": "#/parameters/personId"
},
{
"$ref": "#/parameters/persistedFaceId"
},
{
"name": "body",
"description": "Request body for updating persisted face.",
"in": "body",
"required": true,
"x-ms-client-flatten": true,
"schema": {
"$ref": "#/definitions/UpdateFaceRequest"
}
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"responses": {
"200": {
"description": "A successful call returns an empty response body."
},
"default": {
"description": "Error response.",
"schema": {
"$ref": "#/definitions/APIError"
}
}
},
"x-ms-examples": {
"Update person face example": {
"$ref": "./examples/UpdatePersonGroupPersonFace.json"
}
}
}
},
"/persongroups/{personGroupId}": {
"put": {
"description": "Create a new person group with specified personGroupId, name, user-provided userData and recognitionModel.\n<br /> A person group is the container of the uploaded person data, including face recognition features.\n<br /> After creation, use [PersonGroup Person - Create](https://docs.microsoft.com/rest/api/faceapi/persongroupperson/create) to add persons into the group, and then call [PersonGroup - Train](https://docs.microsoft.com/rest/api/faceapi/persongroup/train) to get this group ready for [Face - Identify](https://docs.microsoft.com/rest/api/faceapi/face/identify).\n<br /> No image will be stored. Only the person's extracted face features and userData will be stored on server until [PersonGroup Person - Delete](https://docs.microsoft.com/rest/api/faceapi/persongroupperson/delete) or [PersonGroup - Delete](https://docs.microsoft.com/rest/api/faceapi/persongroup/delete) is called.\n<br/>'recognitionModel' should be specified to associate with this person group. The default value for 'recognitionModel' is 'recognition_01', if the latest model needed, please explicitly specify the model you need in this parameter. New faces that are added to an existing person group will use the recognition model that's already associated with the collection. Existing face features in a person group can't be updated to features extracted by another version of recognition model.\n\nPerson group quota:\n* Free-tier subscription quota: 1,000 person groups. Each holds up to 1,000 persons.\n* S0-tier subscription quota: 1,000,000 person groups. Each holds up to 10,000 persons.\n* to handle larger scale face identification problem, please consider using [LargePersonGroup](https://docs.microsoft.com/rest/api/faceapi/largepersongroup).",
"operationId": "PersonGroup_Create",
"parameters": [
{
"$ref": "#/parameters/personGroupId"
},
{
"name": "body",
"description": "Request body for creating new person group.",
"in": "body",
"required": true,
"x-ms-client-flatten": true,
"schema": {
"$ref": "#/definitions/MetaDataContract"
}
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"responses": {
"200": {
"description": "A successful call returns an empty response body."
},
"default": {
"description": "Error response.",
"schema": {
"$ref": "#/definitions/APIError"
}
}
},
"x-ms-examples": {
"Create new person group example": {
"$ref": "./examples/CreateNewPersonGroup.json"
}
}
},
"delete": {
"description": "Delete an existing person group. Persisted face features of all people in the person group will also be deleted.",
"operationId": "PersonGroup_Delete",
"parameters": [
{
"$ref": "#/parameters/personGroupId"
}
],
"produces": [
"application/json"
],
"responses": {
"200": {
"description": "A successful call returns an empty response body."
},
"default": {
"description": "Error response.",
"schema": {
"$ref": "#/definitions/APIError"
}
}
},
"x-ms-examples": {
"Delete a person group example": {
"$ref": "./examples/DeletePersonGroup.json"
}
}
},
"get": {
"description": "Retrieve person group name, userData and recognitionModel. To get person information under this personGroup, use [PersonGroup Person - List](https://docs.microsoft.com/rest/api/faceapi/persongroupperson/list).",
"operationId": "PersonGroup_Get",
"parameters": [
{
"$ref": "#/parameters/personGroupId"
},
{
"$ref": "#/parameters/returnRecognitionModel"
}
],
"responses": {
"200": {
"description": "A successful call returns the person group's information.",
"schema": {
"$ref": "#/definitions/PersonGroup"
}
},
"default": {
"description": "Error response.",
"schema": {
"$ref": "#/definitions/APIError"
}
}
},
"produces": [
"application/json"
],
"x-ms-examples": {
"Get person group example": {
"$ref": "./examples/GetPersonGroup.json"
}
}
},
"patch": {
"description": "Update an existing person group's display name and userData. The properties which does not appear in request body will not be updated.",
"operationId": "PersonGroup_Update",
"parameters": [
{
"$ref": "#/parameters/personGroupId"
},
{
"name": "body",
"description": "Request body for updating person group.",
"in": "body",
"required": true,
"x-ms-client-flatten": true,
"schema": {
"$ref": "#/definitions/NameAndUserDataContract"
}
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"responses": {
"200": {
"description": "A successful call returns an empty response body."
},
"default": {
"description": "Error response.",
"schema": {
"$ref": "#/definitions/APIError"
}
}
},
"x-ms-examples": {
"Update person group example": {
"$ref": "./examples/UpdatePersonGroup.json"
}
}
}
},
"/persongroups/{personGroupId}/training": {
"get": {
"description": "Retrieve the training status of a person group (completed or ongoing).",
"operationId": "PersonGroup_GetTrainingStatus",
"parameters": [
{
"$ref": "#/parameters/personGroupId"
}
],
"responses": {
"200": {
"description": "A successful call returns the person group's training status.",
"schema": {
"$ref": "#/definitions/TrainingStatus"
}
},
"default": {
"description": "Error response.",
"schema": {
"$ref": "#/definitions/APIError"
}
}
},
"produces": [
"application/json"
],
"x-ms-examples": {
"Get person group's training status example": {
"$ref": "./examples/GetPersonGroupTrainingStatus.json"
}
}
}
},
"/persongroups": {
"get": {
"description": "List person groups’ personGroupId, name, userData and recognitionModel.<br />\n* Person groups are stored in alphabetical order of personGroupId.\n* \"start\" parameter (string, optional) is a user-provided personGroupId value that returned entries have larger ids by string comparison. \"start\" set to empty to indicate return from the first item.\n* \"top\" parameter (int, optional) specifies the number of entries to return. A maximal of 1000 entries can be returned in one call. To fetch more, you can specify \"start\" with the last returned entry’s Id of the current call.\n<br />\nFor example, total 5 person groups: \"group1\", ..., \"group5\".\n<br /> \"start=&top=\" will return all 5 groups.\n<br /> \"start=&top=2\" will return \"group1\", \"group2\".\n<br /> \"start=group2&top=3\" will return \"group3\", \"group4\", \"group5\".\n",
"operationId": "PersonGroup_List",
"parameters": [
{
"name": "start",
"in": "query",
"required": false,
"description": "List person groups from the least personGroupId greater than the \"start\".",
"type": "string",
"maxLength": 64
},
{
"name": "top",
"in": "query",
"required": false,
"description": "The number of person groups to list.",
"type": "integer",
"minimum": 1,
"maximum": 1000,
"default": 1000
},
{
"$ref": "#/parameters/returnRecognitionModel"
}
],
"produces": [
"application/json"
],
"responses": {
"200": {
"description": "A successful call returns an array of person groups and their information.",
"schema": {
"$ref": "#/definitions/PersonGroups"
}
},
"default": {
"description": "Error response.",
"schema": {
"$ref": "#/definitions/APIError"
}
}
},
"x-ms-examples": {
"List person groups example": {
"$ref": "./examples/ListPersonGroups.json"
}
}
}
},
"/persongroups/{personGroupId}/train": {
"post": {
"description": "Queue a person group training task, the training task may not be started immediately.",
"operationId": "PersonGroup_Train",
"parameters": [
{
"$ref": "#/parameters/personGroupId"
}
],
"produces": [
"application/json"
],
"responses": {
"202": {
"description": "The training task was queued successfully."
},
"default": {
"description": "Error response.",
"schema": {
"$ref": "#/definitions/APIError"
}
}
},
"x-ms-examples": {
"Queue person group training": {
"$ref": "./examples/QueuePersonGroupTraining.json"
}
}
}
},
"/facelists/{faceListId}": {
"put": {
"description": "Create an empty face list with user-specified faceListId, name, an optional userData and recognitionModel. Up to 64 face lists are allowed in one subscription.\n<br /> Face list is a list of faces, up to 1,000 faces, and used by [Face - Find Similar](https://docs.microsoft.com/rest/api/faceapi/face/findsimilar).\n<br /> After creation, user should use [FaceList - Add Face](https://docs.microsoft.com/rest/api/faceapi/facelist/addfacefromurl) to import the faces. No image will be stored. Only the extracted face features are stored on server until [FaceList - Delete](https://docs.microsoft.com/rest/api/faceapi/facelist/delete) is called.\n<br /> Find Similar is used for scenario like finding celebrity-like faces, similar face filtering, or as a light way face identification. But if the actual use is to identify person, please use [PersonGroup](https://docs.microsoft.com/rest/api/faceapi/persongroup) / [LargePersonGroup](https://docs.microsoft.com/rest/api/faceapi/largepersongroup) and [Face - Identify](https://docs.microsoft.com/rest/api/faceapi/face/identify).\n<br /> Please consider [LargeFaceList](https://docs.microsoft.com/rest/api/faceapi/largefacelist) when the face number is large. It can support up to 1,000,000 faces.\n<br />'recognitionModel' should be specified to associate with this face list. The default value for 'recognitionModel' is 'recognition_01', if the latest model needed, please explicitly specify the model you need in this parameter. New faces that are added to an existing face list will use the recognition model that's already associated with the collection. Existing face features in a face list can't be updated to features extracted by another version of recognition model.\nPlease Refer to [Specify a face recognition model](https://docs.microsoft.com/azure/cognitive-services/face/face-api-how-to-topics/specify-recognition-model).",
"operationId": "FaceList_Create",
"parameters": [
{
"$ref": "#/parameters/faceListId"
},
{
"name": "body",
"description": "Request body for creating a face list.",
"in": "body",
"required": true,
"x-ms-client-flatten": true,
"schema": {
"$ref": "#/definitions/MetaDataContract"
}
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"responses": {
"200": {
"description": "A successful call returns an empty response body."
},
"default": {
"description": "Error response.",
"schema": {
"$ref": "#/definitions/APIError"
}
}
},
"x-ms-examples": {
"Create new face list example": {
"$ref": "./examples/CreateNewFaceList.json"
}
}
},
"get": {
"description": "Retrieve a face list’s faceListId, name, userData, recognitionModel and faces in the face list.\n",
"operationId": "FaceList_Get",
"parameters": [
{
"$ref": "#/parameters/faceListId"
},
{
"$ref": "#/parameters/returnRecognitionModel"
}
],
"produces": [
"application/json"
],
"responses": {
"200": {
"description": "A successful call returns the face list's information.",
"schema": {
"$ref": "#/definitions/FaceList"
}
},
"default": {
"description": "Error response.",
"schema": {
"$ref": "#/definitions/APIError"
}
}
},
"x-ms-examples": {
"Get Face list example": {
"$ref": "./examples/GetFaceList.json"
}
}
},
"patch": {
"description": "Update information of a face list.",
"operationId": "FaceList_Update",
"parameters": [
{
"$ref": "#/parameters/faceListId"
},
{
"name": "body",
"description": "Request body for updating a face list.",
"in": "body",
"required": true,
"x-ms-client-flatten": true,
"schema": {
"$ref": "#/definitions/NameAndUserDataContract"
}
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"responses": {
"200": {
"description": "A successful call returns an empty response body."
},
"default": {
"description": "Error response.",
"schema": {
"$ref": "#/definitions/APIError"
}
}
},
"x-ms-examples": {
"Update face list example": {
"$ref": "./examples/UpdateFaceList.json"
}
}
},
"delete": {
"description": "Delete a specified face list.",
"operationId": "FaceList_Delete",
"parameters": [
{
"$ref": "#/parameters/faceListId"
}
],
"produces": [
"application/json"
],
"responses": {
"200": {
"description": "A successful call returns an empty response body."
},
"default": {
"description": "Error response.",
"schema": {
"$ref": "#/definitions/APIError"
}
}
},
"x-ms-examples": {
"Delete face list example": {
"$ref": "./examples/DeleteFaceList.json"
}
}
}
},
"/facelists": {
"get": {
"description": "List face lists’ faceListId, name, userData and recognitionModel. <br /> \nTo get face information inside faceList use [FaceList - Get](https://docs.microsoft.com/rest/api/faceapi/facelist/get)\n",
"operationId": "FaceList_List",
"parameters": [
{
"$ref": "#/parameters/returnRecognitionModel"
}
],
"responses": {
"200": {
"description": "A successful call returns an array of faceList.",
"schema": {
"$ref": "#/definitions/FaceLists"
}
},
"default": {
"description": "Error response.",
"schema": {
"$ref": "#/definitions/APIError"
}
}
},
"produces": [
"application/json"
],
"x-ms-examples": {
"List Face lists example": {
"$ref": "./examples/ListFaceLists.json"
}
}
}
},
"/facelists/{faceListId}/persistedfaces/{persistedFaceId}": {
"delete": {
"description": "Delete a face from a face list by specified faceListId and persistedFaceId.\n<br /> Adding/deleting faces to/from a same face list are processed sequentially and to/from different face lists are in parallel.",
"operationId": "FaceList_DeleteFace",
"parameters": [
{
"$ref": "#/parameters/faceListId"
},
{
"$ref": "#/parameters/persistedFaceId"
}
],
"produces": [
"application/json"
],
"responses": {
"200": {
"description": "A successful call returns an empty response body."
},
"default": {
"description": "Error response.",
"schema": {
"$ref": "#/definitions/APIError"
}
}
},
"x-ms-examples": {
"Delete face in face list example": {
"$ref": "./examples/DeleteFaceListFace.json"
}
}
}
},
"/persongroups/{personGroupId}/persons/{personId}/persistedfaces": {
"post": {
"description": "Add a face to a person into a person group for face identification or verification. To deal with an image contains multiple faces, input face can be specified as an image with a targetFace rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted face feature will be stored on server until [PersonGroup PersonFace - Delete](https://docs.microsoft.com/rest/api/faceapi/persongroupperson/deleteface), [PersonGroup Person - Delete](https://docs.microsoft.com/rest/api/faceapi/persongroupperson/delete) or [PersonGroup - Delete](https://docs.microsoft.com/rest/api/faceapi/persongroup/delete) is called.\n<br /> Note persistedFaceId is different from faceId generated by [Face - Detect](https://docs.microsoft.com/rest/api/faceapi/face/detectwithurl).\n* Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger.\n* Each person entry can hold up to 248 faces.\n* JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB.\n* \"targetFace\" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the provided \"targetFace\" rectangle is not returned from [Face - Detect](https://docs.microsoft.com/rest/api/faceapi/face/detectwithurl), there’s no guarantee to detect and add the face successfully.\n* Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause failures.\n* Adding/deleting faces to/from a same person will be processed sequentially. Adding/deleting faces to/from different persons are processed in parallel.\n* The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size.\n* Different 'detectionModel' values can be provided. To use and compare different detection models, please refer to [How to specify a detection model](https://docs.microsoft.com/azure/cognitive-services/face/face-api-how-to-topics/specify-detection-model).",