Tutorials
FPT.AI Reader - Face Search
This Facesearch system is connected to FPT Gateways. Therefore, to use this API (default usage level for a new API key is only 1000 requests), developers must have an account on Console
The API key must be placed at all request headers as follows:
api_key: generated_API_key
Create user on the system (to add index images)
Using Python
import requests
url = "https://api.fpt.ai/dmp/facesearch/v2/create"
payload = {
'collection': 'test2',
'id': '1234',
'name': 'Nam'
}
headers = {
'api_key': 'xxxxxxxxxx'
}
response = requests.request("POST", url, headers=headers, data = payload)
Using Shell
curl --location --request POST 'https://api.fpt.ai/dmp/facesearch/v2/create' \\
\--header 'api_key: xxxxxxxxxx' \\
\--form 'collection=test2' \\
\--form 'id=1234' \\
\--form 'name=Nam'
Using Postman
Headers
Body
Index user images
Using Python
import requests
url = "https://api.fpt.ai/dmp/facesearch/v2/add"
payload = {
'collection': 'test2',
'id': '1234'
}
files = [
('file', open('/path/to/photo.jpg', 'rb'))
]
headers = {
'api_key': 'xxxxxxxxxx'
}
response = requests.request("POST", url, headers=headers, data = payload, files
= files)
Using Shell
curl --location --request POST 'https://api.fpt.ai/dmp/facesearch/v2/add' \\
\--header 'api_key: xxxxxxxxxx' \\
\--form 'file=\@/path/to/photo.jpg' \\
\--form 'collection=test2' \\
\--form 'id=1234'
Using Postman
Headers
Body
Facesearch
Using Python
import requests
url = "https://api.fpt.ai/dmp/facesearch/v2/search"
payload = {
'collection': 'test2',
'threshold': '0.9'
}
files = [
('file', open('/path/to/photo.jpg','rb'))
]
headers = {
'api_key': 'xxxxxxxxxx'
}
response = requests.request("POST", url, headers=headers, data = payload, files
= files)
Using Shell
curl --location --request POST 'https://api.fpt.ai/dmp/facesearch/v2/search' \\
\--header 'api_key: xxxxxxxxxx' \\
\--form 'file=\@/path/to/photo.jpg' \\
\--form 'collection=test2' \\
\--form 'threshold=0.9'
Using Postman
Headers
Body