Python SDK for the Microsoft Face API, part of Cognitive Services
Перейти к файлу
María Inés Parnisari c9048b6887 Updated readme (#42)
* Update the readme. Added a screenshot of the sample app.

* Fixed path to test config file

* Applied feedback received

* Applied feedback on readme

* Applied feedback on readme

Removed "questions" header
2017-09-24 13:44:10 +08:00
Assets Updated readme (#42) 2017-09-24 13:44:10 +08:00
cognitive_face Code format. (#38) 2017-09-19 16:58:02 +08:00
sample Endpoint support (#36) 2017-05-26 19:11:17 +08:00
.gitignore Endpoint support (#36) 2017-05-26 19:11:17 +08:00
.pylintrc Initial version for Python SDK v0.1. 2016-08-21 14:51:16 +08:00
CONTRIBUTING.md Updated ReadMe & Contributing (#1) 2016-07-06 11:14:58 -07:00
LICENSE-IMAGE.md Add contributing & license files 2016-06-15 13:46:12 -07:00
LICENSE.md Add contributing & license files 2016-06-15 13:46:12 -07:00
MANIFEST.in Bump version to 1.2.1. (#4) 2016-09-12 15:10:05 +08:00
Makefile Initial version for sample. (#6) 2016-09-26 16:40:15 +08:00
README.md Updated readme (#42) 2017-09-24 13:44:10 +08:00
ThirdPartyNotices.txt Add ThirdPartyNotices.txt 2016-07-06 17:57:40 -07:00
requirements.txt Python SDK update for BUILD 2017 release. (#23) 2017-05-08 20:57:44 +08:00
setup.cfg Initial version for Python SDK v0.1. 2016-08-21 14:51:16 +08:00
setup.py Code format. (#38) 2017-09-19 16:58:02 +08:00

README.md

Microsoft Face API: Python 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.

  1. Copy cognitive_face/tests/config.sample.py into cognitive_face/tests/config.py.
  2. Change the KEY and BASE_URL parameters to your own subscription's API key and endpoint.
  3. Run the following:
python setup.py test

Running the sample

A sample desktop application is also provided.

To run it, install the following prerequisites:

  • Python 2.7 (version 3 is not currently supported, you can vote for this feature here)
  • wxPython 3.0.2 (version 4 is not currently supported)

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

Sample app

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:

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.