Skip to main content

Python SDK for the Cognitive Face API

Project description

# Microsoft Face API: Python SDK
This repo contains the Python SDK for the Microsoft Face API, an offering within [Microsoft Cognitive Services](https://www.microsoft.com/cognitive-services), formerly known as Project Oxford.

* [Learn about the Face API](https://www.microsoft.com/cognitive-services/en-us/face-api)
* [Read the documentation](https://www.microsoft.com/cognitive-services/en-us/face-api/documentation/overview)
* [Find more SDKs & Samples](https://www.microsoft.com/cognitive-services/en-us/SDK-Sample?api=face)

## Installation

```bash
pip install cognitive_face
```

## Installation from Source Code

```bash
python setup.py install
```

## Unittests

Before running unittests, please refer to the [/cognitive_face/tests/config.sample.py](/cognitive_face/tests/config.sample.py) and set proper configuration with valid [Subscription Key](https://www.microsoft.com/cognitive-services/en-us/sign-up) to make the unittests work.

```bash
python setup.py test
```

## Minimal Usage

```python
import cognitive_face as CF

KEY = 'subscription key' # Replace with a valid Subscription Key here.
CF.Key.set(KEY)

img_url = 'https://raw.githubusercontent.com/Microsoft/Cognitive-Face-Windows/master/Data/detection1.jpg'
result = CF.face.detect(img_url)
print result
```

## Sample

A Python SDK sample built with wxPython is also provided, before execution,
please install all components listed below.

### Sample Prerequisite

- [Python 2.7](https://www.python.org/downloads/) (only Python 2 supported due
to limitation of wxPython)
- [wxPython](https://wxpython.org/)
- [cognitive_face package](https://pypi.python.org/pypi/cognitive_face)

### Sample Execution

```bash
git clone https://github.com/Microsoft/Cognitive-Face-Python.git
cd Cognitive-Face-Python
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](</CONTRIBUTING.md>).

You can reach out to us anytime with questions and suggestions using our communities below:
- **Support questions:** [StackOverflow](<https://stackoverflow.com/questions/tagged/microsoft-cognitive>)
- **Feedback & feature requests:** [Cognitive Services UserVoice Forum](<https://cognitive.uservoice.com>)

This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.

## Updates
* [Face API Release Notes](https://www.microsoft.com/cognitive-services/en-us/face-api/documentation/ReleaseNotes)

## License
All Microsoft Cognitive Services SDKs and samples are licensed with the MIT License. For more details, see
[LICENSE](</LICENSE.md>).

Sample images are licensed separately, please refer to [LICENSE-IMAGE](</LICENSE-IMAGE.md>)

## 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](http://go.microsoft.com/fwlink/?LinkId=698895).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cognitive_face-1.3.0.tar.gz (15.0 kB view details)

Uploaded Source

File details

Details for the file cognitive_face-1.3.0.tar.gz.

File metadata

File hashes

Hashes for cognitive_face-1.3.0.tar.gz
Algorithm Hash digest
SHA256 4fb7f2b6e275dff90344ad74c7eb9d0ac4af1288ea5e911d0678dc62381d6e88
MD5 f8c38d2ff67697bb43085cbc010bdca0
BLAKE2b-256 a57d9981939cf1eb839510d44cd2c05b5a0f53957c74c7cac2f3a2f0d4566daf

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page