Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FaceAPI 0.4.1 #12199

Merged
merged 2 commits into from
Jun 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Release History

## 0.4.1 (2020-06-24)

**Features**

- Add recognition_03 support

## 0.4.0 (2019-06-27)

**Features**
Expand Down
23 changes: 11 additions & 12 deletions sdk/cognitiveservices/azure-cognitiveservices-vision-face/README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
## Microsoft Azure SDK for Python
# Microsoft Azure SDK for Python

This is the Microsoft Azure Cognitive Services Face Client Library.
This package has been tested with Python 2.7, 3.5, 3.6, 3.7 and 3.8.
For a more complete view of Azure libraries, see the [Github repo](https://github.com/Azure/azure-sdk-for-python/)

This package has been tested with Python 2.7, 3.5, 3.6 and 3.7.

For a more complete set of Azure libraries, see the
[azure](https://pypi.python.org/pypi/azure) bundle package.
# Usage

## Usage

For code examples, see [Cognitive Services
Face](https://docs.microsoft.com/python/api/overview/azure/cognitive-services)
For code examples, see [Cognitive Services Face](https://docs.microsoft.com/python/api/overview/azure/cognitive-services)
on docs.microsoft.com.

## Provide Feedback

If you encounter any bugs or have suggestions, please file an issue in
the [Issues](https://github.com/Azure/azure-sdk-for-python/issues)
# Provide Feedback

If you encounter any bugs or have suggestions, please file an issue in the
[Issues](https://github.com/Azure/azure-sdk-for-python/issues)
section of the project.

![image](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-cognitiveservices-vision-face%2FREADME.png)

![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-cognitiveservices-vision-face%2FREADME.png)
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class RecognitionModel(str, Enum):

recognition_01 = "recognition_01"
recognition_02 = "recognition_02"
recognition_03 = "recognition_03"


class Gender(str, Enum):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ class DetectedFace(Model):
:param face_id:
:type face_id: str
:param recognition_model: Possible values include: 'recognition_01',
'recognition_02'. Default value: "recognition_01" .
'recognition_02', 'recognition_03'. Default value: "recognition_01" .
:type recognition_model: str or
~azure.cognitiveservices.vision.face.models.RecognitionModel
:param face_rectangle: Required.
Expand Down Expand Up @@ -527,7 +527,7 @@ class MetaDataContract(NameAndUserDataContract):
:param user_data: User specified data. Length should not exceed 16KB.
:type user_data: str
:param recognition_model: Possible values include: 'recognition_01',
'recognition_02'. Default value: "recognition_01" .
'recognition_02', 'recognition_03'. Default value: "recognition_01" .
:type recognition_model: str or
~azure.cognitiveservices.vision.face.models.RecognitionModel
"""
Expand Down Expand Up @@ -558,7 +558,7 @@ class FaceList(MetaDataContract):
:param user_data: User specified data. Length should not exceed 16KB.
:type user_data: str
:param recognition_model: Possible values include: 'recognition_01',
'recognition_02'. Default value: "recognition_01" .
'recognition_02', 'recognition_03'. Default value: "recognition_01" .
:type recognition_model: str or
~azure.cognitiveservices.vision.face.models.RecognitionModel
:param face_list_id: Required. FaceListId of the target face list.
Expand Down Expand Up @@ -983,7 +983,7 @@ class LargeFaceList(MetaDataContract):
:param user_data: User specified data. Length should not exceed 16KB.
:type user_data: str
:param recognition_model: Possible values include: 'recognition_01',
'recognition_02'. Default value: "recognition_01" .
'recognition_02', 'recognition_03'. Default value: "recognition_01" .
:type recognition_model: str or
~azure.cognitiveservices.vision.face.models.RecognitionModel
:param large_face_list_id: Required. LargeFaceListId of the target large
Expand Down Expand Up @@ -1019,7 +1019,7 @@ class LargePersonGroup(MetaDataContract):
:param user_data: User specified data. Length should not exceed 16KB.
:type user_data: str
:param recognition_model: Possible values include: 'recognition_01',
'recognition_02'. Default value: "recognition_01" .
'recognition_02', 'recognition_03'. Default value: "recognition_01" .
:type recognition_model: str or
~azure.cognitiveservices.vision.face.models.RecognitionModel
:param large_person_group_id: Required. LargePersonGroupId of the target
Expand Down Expand Up @@ -1256,7 +1256,7 @@ class PersonGroup(MetaDataContract):
:param user_data: User specified data. Length should not exceed 16KB.
:type user_data: str
:param recognition_model: Possible values include: 'recognition_01',
'recognition_02'. Default value: "recognition_01" .
'recognition_02', 'recognition_03'. Default value: "recognition_01" .
:type recognition_model: str or
~azure.cognitiveservices.vision.face.models.RecognitionModel
:param person_group_id: Required. PersonGroupId of the target person
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ class DetectedFace(Model):
:param face_id:
:type face_id: str
:param recognition_model: Possible values include: 'recognition_01',
'recognition_02'. Default value: "recognition_01" .
'recognition_02', 'recognition_03'. Default value: "recognition_01" .
:type recognition_model: str or
~azure.cognitiveservices.vision.face.models.RecognitionModel
:param face_rectangle: Required.
Expand Down Expand Up @@ -527,7 +527,7 @@ class MetaDataContract(NameAndUserDataContract):
:param user_data: User specified data. Length should not exceed 16KB.
:type user_data: str
:param recognition_model: Possible values include: 'recognition_01',
'recognition_02'. Default value: "recognition_01" .
'recognition_02', 'recognition_03'. Default value: "recognition_01" .
:type recognition_model: str or
~azure.cognitiveservices.vision.face.models.RecognitionModel
"""
Expand Down Expand Up @@ -558,7 +558,7 @@ class FaceList(MetaDataContract):
:param user_data: User specified data. Length should not exceed 16KB.
:type user_data: str
:param recognition_model: Possible values include: 'recognition_01',
'recognition_02'. Default value: "recognition_01" .
'recognition_02', 'recognition_03'. Default value: "recognition_01" .
:type recognition_model: str or
~azure.cognitiveservices.vision.face.models.RecognitionModel
:param face_list_id: Required. FaceListId of the target face list.
Expand Down Expand Up @@ -983,7 +983,7 @@ class LargeFaceList(MetaDataContract):
:param user_data: User specified data. Length should not exceed 16KB.
:type user_data: str
:param recognition_model: Possible values include: 'recognition_01',
'recognition_02'. Default value: "recognition_01" .
'recognition_02', 'recognition_03'. Default value: "recognition_01" .
:type recognition_model: str or
~azure.cognitiveservices.vision.face.models.RecognitionModel
:param large_face_list_id: Required. LargeFaceListId of the target large
Expand Down Expand Up @@ -1019,7 +1019,7 @@ class LargePersonGroup(MetaDataContract):
:param user_data: User specified data. Length should not exceed 16KB.
:type user_data: str
:param recognition_model: Possible values include: 'recognition_01',
'recognition_02'. Default value: "recognition_01" .
'recognition_02', 'recognition_03'. Default value: "recognition_01" .
:type recognition_model: str or
~azure.cognitiveservices.vision.face.models.RecognitionModel
:param large_person_group_id: Required. LargePersonGroupId of the target
Expand Down Expand Up @@ -1256,7 +1256,7 @@ class PersonGroup(MetaDataContract):
:param user_data: User specified data. Length should not exceed 16KB.
:type user_data: str
:param recognition_model: Possible values include: 'recognition_01',
'recognition_02'. Default value: "recognition_01" .
'recognition_02', 'recognition_03'. Default value: "recognition_01" .
:type recognition_model: str or
~azure.cognitiveservices.vision.face.models.RecognitionModel
:param person_group_id: Required. PersonGroupId of the target person
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,23 +42,23 @@ def create(
in one subscription.
<br /> Face list is a list of faces, up to 1,000 faces, and used by
[Face - Find
Similar](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395237).
Similar](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/findsimilar).
<br /> After creation, user should use [FaceList - Add
Face](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395250)
Face](https://docs.microsoft.com/rest/api/cognitiveservices/face/facelist/addfacefromurl)
to import the faces. No image will be stored. Only the extracted face
features are stored on server until [FaceList -
Delete](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039524f)
Delete](https://docs.microsoft.com/rest/api/cognitiveservices/face/facelist/delete)
is called.
<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](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395244)
[PersonGroup](https://docs.microsoft.com/rest/api/cognitiveservices/face/persongroup)
/
[LargePersonGroup](/docs/services/563879b61984550e40cbbe8d/operations/599acdee6ac60f11b48b5a9d)
[LargePersonGroup](https://docs.microsoft.com/rest/api/cognitiveservices/face/largepersongroup)
and [Face -
Identify](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395239).
Identify](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/identify).
<br /> Please consider
[LargeFaceList](/docs/services/563879b61984550e40cbbe8d/operations/5a157b68d2de3616c086f2cc)
[LargeFaceList](https://docs.microsoft.com/rest/api/cognitiveservices/face/largefacelist)
when the face number is large. It can support up to 1,000,000 faces.
<br />'recognitionModel' should be specified to associate with this
face list. The default value for 'recognitionModel' is
Expand All @@ -69,12 +69,13 @@ def create(
can't be updated to features extracted by another version of
recognition model.
* 'recognition_01': The default recognition model for [FaceList-
Create](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039524b).
Create](https://docs.microsoft.com/rest/api/cognitiveservices/face/facelist/create).
All those face lists created before 2019 March are bonded with this
recognition model.
* 'recognition_02': Recognition model released in 2019 March.
'recognition_02' is recommended since its overall accuracy is improved
compared with 'recognition_01'.
* 'recognition_03': Recognition model released in 2020 May.
'recognition_03' is recommended since its overall accuracy is improved
compared with 'recognition_01' and 'recognition_02'.

:param face_list_id: Id referencing a particular face list.
:type face_list_id: str
Expand All @@ -83,7 +84,7 @@ def create(
:param user_data: User specified data. Length should not exceed 16KB.
:type user_data: str
:param recognition_model: Possible values include: 'recognition_01',
'recognition_02'
'recognition_02', 'recognition_03'
:type recognition_model: str or
~azure.cognitiveservices.vision.face.models.RecognitionModel
:param dict custom_headers: headers that will be added to the request
Expand Down Expand Up @@ -292,7 +293,7 @@ def list(
"""List face lists’ faceListId, name, userData and recognitionModel. <br
/>
To get face information inside faceList use [FaceList -
Get](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039524c)
Get](https://docs.microsoft.com/rest/api/cognitiveservices/face/facelist/get)
.

:param return_recognition_model: A value indicating whether the
Expand Down Expand Up @@ -404,13 +405,13 @@ def add_face_from_url(
persistedFaceId representing the added face. No image will be stored.
Only the extracted face feature will be stored on server until
[FaceList - Delete
Face](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395251)
Face](https://docs.microsoft.com/rest/api/cognitiveservices/face/facelist/deleteface)
or [FaceList -
Delete](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039524f)
Delete](https://docs.microsoft.com/rest/api/cognitiveservices/face/facelist/delete)
is called.
<br /> Note persistedFaceId is different from faceId generated by [Face
-
Detect](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236).
Detect](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/detectwithurl).
* Higher face image quality means better detection and recognition
precision. Please consider high-quality faces: frontal, clear, and face
size is 200x200 pixels (100 pixels between eyes) or bigger.
Expand All @@ -419,7 +420,7 @@ def add_face_from_url(
* "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](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236),
Detect](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/detectwithurl),
there’s no guarantee to detect and add the face successfully.
* Out of detectable face size (36x36 - 4096x4096 pixels), large
head-pose, or large occlusions will cause failures.
Expand All @@ -430,11 +431,11 @@ def add_face_from_url(
1920x1080 pixels will need a proportionally larger minimum face size.
* 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/en-us/azure/cognitive-services/face/face-api-how-to-topics/specify-detection-model)
model](https://docs.microsoft.com/azure/cognitive-services/face/face-api-how-to-topics/specify-detection-model)
| Model | Recommended use-case(s) |
| ---------- | -------- |
| 'detection_01': | The default detection model for [FaceList - Add
Face](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395250).
Face](https://docs.microsoft.com/rest/api/cognitiveservices/face/facelist/addfacefromurl).
Recommend for near frontal face detection. For scenarios with
exceptionally large angle (head-pose) faces, occluded faces or wrong
image orientation, the faces in such cases may not be detected. |
Expand Down Expand Up @@ -528,13 +529,13 @@ def add_face_from_stream(
persistedFaceId representing the added face. No image will be stored.
Only the extracted face feature will be stored on server until
[FaceList - Delete
Face](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395251)
Face](https://docs.microsoft.com/rest/api/cognitiveservices/face/facelist/deleteface)
or [FaceList -
Delete](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039524f)
Delete](https://docs.microsoft.com/rest/api/cognitiveservices/face/facelist/delete)
is called.
<br /> Note persistedFaceId is different from faceId generated by [Face
-
Detect](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236).
Detect](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/detectwithurl).
* Higher face image quality means better detection and recognition
precision. Please consider high-quality faces: frontal, clear, and face
size is 200x200 pixels (100 pixels between eyes) or bigger.
Expand All @@ -543,7 +544,7 @@ def add_face_from_stream(
* "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](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236),
Detect](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/detectwithurl),
there’s no guarantee to detect and add the face successfully.
* Out of detectable face size (36x36 - 4096x4096 pixels), large
head-pose, or large occlusions will cause failures.
Expand All @@ -554,11 +555,11 @@ def add_face_from_stream(
1920x1080 pixels will need a proportionally larger minimum face size.
* 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/en-us/azure/cognitive-services/face/face-api-how-to-topics/specify-detection-model)
model](https://docs.microsoft.com/azure/cognitive-services/face/face-api-how-to-topics/specify-detection-model)
| Model | Recommended use-case(s) |
| ---------- | -------- |
| 'detection_01': | The default detection model for [FaceList - Add
Face](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395250).
Face](https://docs.microsoft.com/rest/api/cognitiveservices/face/facelist/addfacefromurl).
Recommend for near frontal face detection. For scenarios with
exceptionally large angle (head-pose) faces, occluded faces or wrong
image orientation, the faces in such cases may not be detected. |
Expand Down
Loading