Face Detection

Interested to know more? Do you have a potential use case? Fill the below form to contact us.






Congratulations. Your message has been sent successfully.
Error, please retry. Your message has not been sent.

Instructions
Input - Click on the “+” button in the video player and upload a decent resolution video with less than 40mb.
Output - Provides an image or a video with the faces of the people localized. Can detect multiple faces present in the image or video with face location (XY coordinates) in a JSON format.
Note: Upload the appropriate video for optimal performance. Video that doesn't relate to the model might provide you unexpected results.

Face detection is a computer vision task to detect the faces in an image or video and return the location of the face. The application localizes the faces by drawing a bounding box around the individual faces. Detecting faces in an image or a video is not easy for humans at every single frame, It gets complex as the requirement for identification and other details are demanded, given the dynamic nature of faces. For example, faces must be detected regardless of orientation or angle they are facing, light levels, clothing, accessories, hair color, facial hair, makeup, age, and so on.

During this Covid 19 pandemic, life has its own challenges. The ability to detect a person’s face and maintain discipline is absolutely challenging. The Face detection system can be used as a backbone for a face recognition system to detect and identify the person. It is used to detect faces in real time for surveillance and tracking of persons or objects. It is widely used in cameras to identify multiple appearances in the frame. Not only this can be extended to even search for a person in a crowd with location, date and time. This detection is a key factor for doing any further facial analysis when combined with other algorithms.

Use Cases

Face Recognition, Security System, Finding Missing Person, Protecting Law Enforcements, Track Attendance, Count People Paying Attention, Biometrics, and so on.

API Request and Response

TensorGo Platform provides you with a one stop solution to customize the our API offerings as per your use case by mixing and matching the existing APIs or requesting for a new custom model. This accelerates the development of use cases with minimal or no code towards deep learning applications.

Specification

API Endpoints

#For Getting the API KEY
#(Registration Not Required)
#Enter the email ID to get the api key.
#The api key will be valid for 2 hours only.#
Request:
post/
[URL]
	body:{ 
      		“email”:”xxxxxxx@xxxx.com”
             }
Response:
	 {“msg”:”Key has been sent to your email”}

#For Uploading
#Enter the api key which you have received in
#the email to access any of the below API. The api key should be
#added in the header with name “key”

#For uploading video or image.
Request:
post/
[URL]
	body:{ 
	        ‘app': ”Name of the app”
             	“file”:”Attached File”
             },
	Headers:{
		“Key”:”xxxxxxxxx”
		}
Response:
	{“ID”:”ID”}

#You have to enter the above ID in order to download
#the video or file in the download api. If it’s a image file
#then you will directly receive the infrared image link

#For uploading video link
Request:
post/
[URL]
	body:{
             “app”:”faceDetect”
              “link”:”video Link” -> 
             },
	Headers:{
		“Key”:”xxxxxxxxx”
}
Response:
	{“id”:”ID”}

#For uploading video rtsp link
Request:
post/
[URL]
body:{
“app”:”faceDetect”
“link”:”video Link” ->
},
Headers:{
“Key”:”xxxxxxxxx”
}
Response:
{“id”:”ID”}

#For Downloading
#Enter the ID which you have received in response
#to use any of the below API. It should be added in the query
#with the name “id”. Enter the app name which you
#have selected while uploading the video,
#to use any of the below api and It should be added
#in the query with the name “app”.

#Download the inferred video:
get/
[URL]?app=”app name”&ID=”ID received”
Headers:{
“Key”:”xxxxxxxxx”
}

#Download the csv file:
get/
[URL]?app=”app name”&ID=”ID received”
Headers:{
“Key”:”xxxxxxxxx”
}
#File Upload
import requests
with open(“File Location”, 'rb') as f:
     response=requests.post({URL},
     data={“app”:'faceDetect'},
     files={'file':f},
     headers = {“key”: “*******”})
#Response →  {“msg”:”Key has been sent to your email”}

#Video Link
#Enter the key that you have received in mail
response=requests.post({URL/videolink},
data={'app':'faceDetect',”link”:”Video Link”},
headers = {“key”: “xxxxxxx”})
#Response→ {“msg”:”Some Random ID”}

#Video RTSP Link
#Enter the key that you have received in mail
response=requests.post({URL/link},
data={'app':'faceDetect',”link”:”Video RTSP Link”},
headers = {“key”: “xxxxxxx”})
#Response→ {“msg”:”Some Random ID”}

#Video Link for Download
#Enter the key that you have received in mail
#Enter the id that you have received in response while uploading
response=requests.get({URL/downloadLink/video},
params={“id”:{ID Received},”app”:'faceDetect'},
headers = {“key”: “xxxxxxx”})
#Response→ {“videoLink”:”Video Link for downloading”}

#CSV Link for Download
#Enter the key that you have received in mail
#Enter the id that you have received in response while uploading
response=requests.get({URL/downloadLink/output},
params={“id”:{ID Received},”app”:'faceDetect'},
headers = {“key”: “xxxxxxx”})
#Response→ {“fileLink”:”CSV Link for downloading”}
//File Upload
var form = new FormData();
form.append('app', 'faceDetect');
form.append('file', files[0]);
fetch({URL}, {
  method: 'POST',
  body: form,
  headers: {
     “key”: “xxxxxxx”
    }})
//Response →  {“msg”:”Key has been sent to your email”}
//You’ll receive a key in in your mail

//Video Link
//Enter the key that you have received in mail
fetch(
  {URL/videolink},{
method:”POST”,
body: {“app”:'faceDetect'},
headers: {
      “key”: “xxxxxxx”
    }})
//Response→ {“msg”:”Some Random ID”}

//Video RTSP Link
//Enter the key that you have received in mail
fetch(
  {URL/link},{
method:”POST”,
body: {“app”:'faceDetect'},
    headers: {
    “key”: “xxxxxxx”
    }})
//Response→ {“msg”:”Some Random ID”}

//Video Link for Download
//Enter the key that you have received in mail
//Enter the id that you have received in response while uploading
fetch(
  {URL/downloadLink/video+”?
  id={ID Received}&app=faceDetect”},{
    headers: {
     “key”: “xxxxxxx”
    }})
//Response→ {“videoLink”:”Video Link for downloading”}

//CSV Link for Download
//Enter the key that you have received in mail
//Enter the id that you have received in response while uploading
fetch(
  {URL/downloadLink/output+”?
  id={ID Received}&app=faceDetect'},{
    headers: {
    “key”: “xxxxxxx”    }}
//Response→ {“fileLink”:”CSV Link for downloading”}

#File Upload
curl -X 'POST' \
  '{URL}' \
  -H 'accept: application/json' \
  -H 'Content-Type: multipart/form-data' \
  -F 'file={File Attached}' \
  -F 'app=faceDetect’
#Response →  {“msg”:”Key has been sent to your email”}
#You’ll receive a key in in your mail

#Video RTSP Link
#Enter the key that you have received in mail
curl -X 'POST' \
  '{URL/link}' \
  -H 'accept: application/json' \
  -H 'Content-Type: multipart/form-data' \
  -H 'key: xxxxxxxx' \
  -F 'url={Video RTSP Link},' \
  -F 'app=faceDetect'
#Response→ {“msg”:”Some Random ID”}

#Video Link
#Enter the key that you have received in mail
curl -X 'POST' \
  '{URL/videolink}' \
  -H 'accept: application/json' \
  -H 'Content-Type: multipart/form-data' \
  -H 'key: xxxxxxxx' \
  -F 'url={Video Link},' \
  -F 'app=faceDetect'
#Response→ {“msg”:”Some Random ID”}

#Video Link for Download
#Enter the key that you have received in mail
#Enter the id that you have received in response while uploading
curl -X 'GET' \
  '{URL/downloadLink/video/ + ”?
   id={ID Received}&app=faceDetect”}' \
  -H 'accept: application/json'\
  -H 'key: xxxxxxxx' 
#Response→ {“videoLink”:”Video Link for downloading”}

#CSV Link for Download
#Enter the key that you have received in mail
#Enter the id that you have received in response while uploading
curl -X 'GET' \
  '{URL/downloadLink/output/ + ”?
   id={ID Received}&app=faceDetect”}' \
  -H 'accept: application/json'\
  -H 'key: xxxxxxxx' 
#Response→ {“videoLink”:”Video Link for downloading”} 
//File Upload
$cf = new CURLFile($files);
$curl = curl_init(URL);
curl_setopt($curl, CURLOPT_URL, URL);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, ['upload' => $cf]);
curl_setopt($curl, CURLOPT_HTTPHEADER, array('key': '********'));
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);

$data =
{
  'app': 'faceDetect'
}
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
//Response →  {'msg':'Key has been sent to your email'}
//You'll receive a key in in your mail

//Video Link
//Enter the key that you have received in mail
$curl = curl_init(URL/videolink);
curl_setopt($curl, CURLOPT_URL,URL/videolink);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, array('key': '********'));
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);

$data =
{
  'app': 'faceDetect'
}
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);

$resp = curl_exec($curl);
//Response→ {'msg':'Some Random ID'}

//Video RTSP Link
//Enter the key that you have received in mail
$curl = curl_init(URL/link);
curl_setopt($curl, CURLOPT_URL,URL/link);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, array('key': '********'));
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);

$data =
{
  'app': 'faceDetect'
}
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);

$resp = curl_exec($curl);
//Response→ {'msg':'Some Random ID'}

//Video Link for Download
//Enter the key that you have received in mail
//Enter the id that you have received in response while uploading
$curl = curl_init(URL/downloadLink/video);
curl_setopt($curl, CURLOPT_URL,URL/downloadLink/output);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, array('key': '********'));
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);

$data =
{
  'app': 'faceDetect',
  'id': '{ID Received}'
}
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);

$resp = curl_exec($curl);
//Response→ {'videoLink':'Video Link for downloading'}

//CSV Link for Download
//Enter the key that you have received in mail
//Enter the id that you have received in response while uploading
$curl = curl_init(URL/downloadLink/output);
curl_setopt($curl, CURLOPT_URL,URL/downloadLink/output);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, array('key': '********'));
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);

$data =
{
  'app': 'faceDetect',
  'id': '{ID Received}'
}
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);

$resp = curl_exec($curl);
//Response→ {'fileLink':'CSV Link for downloading'}