Created
December 16, 2018 07:45
-
-
Save joseph-sch/a936d1f62926b2f44aa8ae27dfd0c7eb to your computer and use it in GitHub Desktop.
Minimal standalone API call to Face++ in Python 3 with US API server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
http_url = 'https://api-us.faceplusplus.com/facepp/v3/detect' | |
key = "foo" | |
secret = "bar" | |
# Build http request | |
res = requests.post(url=http_url, data={'api_key': key, 'api_secret': secret, | |
'image_url': 'http://bj-mc-prod-asset.oss-cn-beijing.aliyuncs.com/mc-official/images/face/demo-pic11.jpg', | |
'return_landmark': 1, | |
'return_attributes': 'beauty'}) | |
if res.status_code == 200: | |
print(res.text) | |
else: | |
print(res.status_code) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment