Overview


Anyone, anywhere around the world can shoot images at any given time. With the rise of Mobile Photography, you are able to instantly share your images. This has resulted in the rise of many photo editor application. But all the photo editor applications normally offer the same features and people start to shift from one application to another in search to find something different and complete. Smart Camera, is an app that not only acts as a photo editor but launches a whole new set of features where in you not only detect faces but edit and add new features.

Face detection is an application that helps you to detect and locate human faces within an image. With Smart Camera you can detect the number of people present in a photo and you can change particular face features as well.


Our Approach


To solve the problem, we use IntelliHub . Lets see how IntelliHub works:

  • Smart Camera app uses Phoenix Vision for face detection and providing all the features.
  • The phoenix vision interacts with the storage and performs the ML operations and directly gives us the output.
  • User directly interacts with Phoenix Vision through SDK , API and using IntelliHub interface.


App Creation

First we need to create an App from console and enable API for Vision.

In Studio, we can build model in two ways:

  • Using SDK (For Developer)
  • Using Interface (For Non-Developer)


Using SDK


If you want to develop a model using SDK, just copy API key from IntelliHub Console.




Connect To Studio

Description

You can access the services provided by enabling API for Phoenix Vision. IntelliHub provides StudioClient where you have to pass your APP KEY as an argument. We can detect the faces in an image by passing the image path in face_detection_image where image path is the argument.

Code


import studio

c = studio.StudioClient("YOUR API KEY")

 

import com.spotflock.StudioClient;

StudioClient c = new StudioClient("YOUR API KEY");

 

Face Detection

Description

The phoenix vision's face detection APIs identifies the faces and returns the image with detected faces.

Code


response = c.face_detection_image('path/to/image')
print(response)
 

String response = c.faceDetection("path/to/image");
System.out.println(response);
 

Face Detection Json

Description

The phoenix vision's face detection APIs also gives exact co-ordinates of all detected faces as a json format.

Code


response = c.face_detection_json('path/to/image')
print(response)
 

response


{
  'x': 230,
  'y': 290,
  'width': 90,
  'height': 90,
  'ratio': 0
}

String response = c.faceDetectionJson("path/to/image");
JSONObject responseJson = new JSONObject(response);
System.out.println(responseJson.toString());
 

responseJson


{
  "x": 230,
  "y": 290,
  "width": 90,
  "height": 90,
   'ratio': 0
} 

Using Interface (Non-Developer)


  1. Once we have created an App and Phoenix Vision enabled we need to go to the API Explorer.

  2. Once we are at the API Explorer tab we need to call the API for Phoenix Vision. It can be done in two ways:

    • Using image.
    • Using JSON.

    Using Image

    Description

        This API would enable you to detect face from an image and retrieve the response in terms of an image.

    URI

        POST /api/v1/vision-service/phoenix-vision/face-detection/image

    Headers

        We need to mention our API Key in the headers

    Body

        We need to select the file we want to run the face detection algorithm on.

    Using JSON

    Description

        This API would enable you to detect face from an image and retrieve the response in terms of an json.

    URI

        POST /api/v1/vision-service/phoenix-vision/face-detection/json

    Headers

        We need to mention our API Key in the headers

    Body

        We need to select the file we want to run the face detection algorithm on.

    Response

    Once we get the response we can see the x and y coordinate along with width and height of the face detected.



Summary


  • Smart Camera is just a small application of phoenix vision. We can extend the use case by using it for finding the number of people in a particular store or area. We can always use this to get the footfall in stores and malls along with the time it is the maximum.
  • We can also use it in marketing and advertising by finding which is the best way to market or advertise a product as we willing be having the knowledge were we can find large crowds and at what time.

Helpdesk