This tutorial helps in the detection of human faces in base64 images, using the Halisi-Cow Face Detection API.
To get started, first ensure that you are Signed Up/In on the RapidAPI platform. You may also need to subscribe to Halisi-Animal Face Detection API. Upon successfully signing-up/in and subscribing, you gain automatic access to the API-key, which is essential to unlock more Halisi features! Your RapidAPI key will be automatically displayed in the Keypoints tab, under the X-RapidAPI-Key parameter in the Header Parameters section.
Pre-requisite:
Once the pre-requisites are checked, we now proceed to test this API using the following steps:
Input:
Output:
import requests
url = “https://halisi-animal-face-detection.p.rapidapi.com/DetectCow”
querystring = {“Confidence”:“0.60”,“IoU”:“0.40”}
payload = {“image”: “base64 image pasted here”}
headers = {
“content-type”: “application/json”,
“X-RapidAPI-Key”: “----your RapidAPI key----”,
“X-RapidAPI-Host”: “halisi-animal-face-detection.p.rapidapi.com”
}
response = requests.request(“POST”, url, json=payload, headers=headers, params=querystring)
print(response.text)
bbox: "[69, 10, 520, 461]"
detection_score: "0.8890097"
elapsed_time: 552
message: “Face successfully detected”