Skip to content

Instantly share code, notes, and snippets.

@joseph-sch
Created December 16, 2018 07:45
Show Gist options
  • Save joseph-sch/a936d1f62926b2f44aa8ae27dfd0c7eb to your computer and use it in GitHub Desktop.
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
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