Python SDK for the Cognitive Face API
Project description
Microsoft Face API: Python SDK & Sample
This SDK has been deprecated and been replaced by Microsoft.Azure.CognitiveServices.Vision.Face which is a part of Azure SDK.
This repo contains the Python SDK for the Microsoft Face API, an offering within Microsoft Cognitive Services, formerly known as Project Oxford.
Getting started
Install the module using pip:
pip install cognitive_face
Use it:
import cognitive_face as CF
KEY = 'subscription key' # Replace with a valid Subscription Key here.
CF.Key.set(KEY)
BASE_URL = 'https://westus.api.cognitive.microsoft.com/face/v1.0/' # Replace with your regional Base URL
CF.BaseUrl.set(BASE_URL)
img_url = 'https://raw.githubusercontent.com/Microsoft/Cognitive-Face-Windows/master/Data/detection1.jpg'
result = CF.face.detect(img_url)
print result
Installing from the source code
python setup.py install
Running the unit tests
To run the tests you will need a valid subscription. You can get one here.
- Copy
cognitive_face/tests/config.sample.py
intocognitive_face/tests/config.py
. - Change the
KEY
andBASE_URL
parameters to your own subscription's API key and endpoint. - Run the following:
python setup.py test
Running the sample
A sample desktop application is also provided.
Currently it support the following combination of prerequisites:
- Python 3 + wxPython 4 [Recommended]
- Python 2 + wxPython 4
- Python 2 + wxPython 3
P.S. WxPython 3 does not support Python 3 by design.
Then run the following:
git clone https://github.com/Microsoft/Cognitive-Face-Python.git
cd Cognitive-Face-Python
pip install -r requirements.txt
python sample
Contributing
We welcome contributions. Feel free to file issues and pull requests on the repo and we'll address them as we can. Learn more about how you can help on our Contribution Rules & Guidelines.
You can reach out to us anytime with questions and suggestions using our communities below:
- Support questions: StackOverflow
- Feedback & feature requests: Cognitive Services UserVoice Forum
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.
Updates
License
All Microsoft Cognitive Services SDKs and samples are licensed with the MIT License. For more details, see LICENSE.
Sample images are licensed separately, please refer to LICENSE-IMAGE.
Developer Code of Conduct
Developers using Cognitive Services, including this sample, are expected to follow the “Developer Code of Conduct for Microsoft Cognitive Services”, found at http://go.microsoft.com/fwlink/?LinkId=698895.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file cognitive_face-1.5.0.tar.gz
.
File metadata
- Download URL: cognitive_face-1.5.0.tar.gz
- Upload date:
- Size: 18.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.20.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ef4fd24cdfa21ba24320a80dedfa8bbe283350b51db36aa9fbb924d69595bb73 |
|
MD5 | af62affc257a4f2e51d361e5d6ce221c |
|
BLAKE2b-256 | 844224f0f6a3a93095911fd1444370ce66dc7cc76e4737a9e2bf51d092b8bea9 |
File details
Details for the file cognitive_face-1.5.0-py3-none-any.whl
.
File metadata
- Download URL: cognitive_face-1.5.0-py3-none-any.whl
- Upload date:
- Size: 30.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.20.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e486e78000288fbb00c2ccd42e0d1e09ba1a63fe9c78497d7b1d88b49d41828a |
|
MD5 | 8275125937cf89fc418382bba222a36e |
|
BLAKE2b-256 | 5916d332bf7de96d651e9f83dfe15c2b7e2bf47beea73b72f9aa1d35884e3fcb |