FaceAPI Developer

GET Face Embedding

API Endpoint

https://api.datawow.io/api/v1/face_recognitions/embeddings/:id
MethodDescription
GETGet face embedding record from id or custom_id

Example in various programming languages

You can copy the sample code here, and test it on your client.
https://documenter.getpostman.com/view/7277799/SWTK4uBD?version=latest

Postman collection, you can import the sample code and test it with Postman:
https://www.getpostman.com/collections/6ce13f0c8f76f1fece30

Request

All requests must be authenticated for access to API. Authentication is done via HTTP headers.

ParameterTypeValueDescription
AuthorizationheaderProject authorization token
custom_idformDataStringrequired id or custom_id
image_urlformDataURL StringA photo’s URL which contains faces

Example request


curl --location --request GET 'https://api-staging.datawow.io/api/v1/face_recognitions/embeddings/SAMPLE_CUSTOM_ID' \
  --header 'Authorization: YOUR_API_KEY'
                

Response

Successful response will return a JSON file.

KeyTypeDescription
embeddingfloat[128]128 dimensional feature vector describing a face for recognition and identification purpose. Similar faces have a closer cosine similarity. To calculate cosine similarity between two faces, use scikit-learn’s cosine similarity function.
bounding_boxx1: float
y1: float
x2: float
y2: float
confidence: float
Bounding box of the detected faces, where x1, y1, x2, y2 describe location of the bounding box in ratio compared to the image width and height, while “confidence” score indicates confidence level of the bounding box which range from 0 to 1.
landmarks[ { "x": float, "y": float },
{ "x": float, "y": float }, ... ]
Facial landmark coordinates in ratio compared to the image width and height, such as the location of eyes, nose, and mouth. The values are in range of 0 to 1

Example response


{
  "data": {
    "id": "5e425f9cf721f5270bfd6122",
    "type": "face_embedding",
    "attributes": {
      "custom_id": "SAMPLE_CUSTOM_ID",
      "image_url": "https://datawow-shared.s3-ap-southeast-1.amazonaws.com/api-documentation/face1.jpeg",
      "processed_at": "2020-02-11T08:02:35.609+07:00",
      "result": {
        "faces": [
          {
            "embedding": [
              -0.05626901984214783,
              -0.05672397464513779,
              0.12936484813690186,
              -0.14403554797172546,
              0.06726998835802078,
              -0.152568981051445,
              -0.07449209690093994,
              0.14378103613853455,
              -0.12572771310806274,
              -0.14259065687656403,
              -0.05337947979569435,
              -0.06607994437217712,
              0.08996101468801498,
              0.02739890292286873,
              0.048537727445364,
              0.008774123154580593,
              0.13402564823627472,
              0.10593212395906448,
              0.02045777067542076,
              0.09934501349925995,
              -0.05329378694295883,
              0.11723744124174118,
              0.03812405467033386,
              -0.02240668050944805,
              -0.048408158123493195,
              -0.06729859858751297,
              0.013426617719233036,
              -0.03476662561297417,
              0.09346663951873779,
              0.1194949820637703,
              0.0730987936258316,
              -0.1308656632900238,
              -0.013376356102526188,
              0.03625820577144623,
              -0.03789087012410164,
              -0.13555853068828583,
              0.008877329528331757,
              0.1010306254029274,
              -0.16916199028491974,
              0.05660427734255791,
              -0.06235330179333687,
              -0.038343802094459534,
              0.13938535749912262,
              0.04563714563846588,
              0.1685364842414856,
              0.03779059275984764,
              -0.1517595648765564,
              -0.10030027478933334,
              0.1636981964111328,
              -0.011647910811007023,
              -0.08388443291187286,
              0.09146786481142044,
              0.060228269547224045,
              0.08903750777244568,
              0.09348813444375992,
              0.18360263109207153,
              -0.21019022166728973,
              -0.009447194635868073,
              0.05624719336628914,
              0.12343904376029968,
              0.0942593663930893,
              0.1528918743133545,
              -0.057855866849422455,
              -0.032143253833055496,
              -0.024042626842856407,
              0.09094922989606857,
              0.025492843240499496,
              0.054996609687805176,
              0.04483809694647789,
              -0.09078394621610641,
              -0.06560888141393661,
              0.060884326696395874,
              -0.12488756328821182,
              0.06559187173843384,
              -0.06664332747459412,
              -0.00979633443057537,
              -0.0650448128581047,
              0.06652478873729706,
              -0.01897045597434044,
              0.02052086405456066,
              -0.09919523447751999,
              -0.03142041712999344,
              0.17993582785129547,
              0.04971704259514809,
              0.037286195904016495,
              -0.0234651118516922,
              0.051689621061086655,
              0.029123373329639435,
              -0.059805624186992645,
              -0.06437887251377106,
              0.14870606362819672,
              0.04497890546917915,
              -0.09540089219808578,
              -0.06290940940380096,
              -0.039707861840724945,
              0.05521481856703758,
              -0.05132077634334564,
              -0.018242795020341873,
              -0.07401632517576218,
              -0.14708326756954193,
              -0.044998615980148315,
              -0.12411375343799591,
              -0.04823433980345726,
              -0.00017755334556568414,
              0.015836350619792938,
              0.10239080339670181,
              0.007835936732590199,
              -0.13593408465385437,
              0.03758365288376808,
              0.020830292254686356,
              -0.14396806061267853,
              -0.013506557792425156,
              0.08469146490097046,
              -0.1342952698469162,
              -0.047054190188646317,
              -0.04069197550415993,
              -0.037976525723934174,
              -0.11774890869855881,
              -0.10955174267292023,
              -0.0432678684592247,
              -0.1707155406475067,
              -0.018082808703184128,
              0.08144769817590714,
              0.01601140946149826,
              -0.14871801435947418,
              -0.008755014277994633,
              -0.02852483280003071,
              -0.04507478326559067
            ],
            "bounding_box": {
              "x1": 0.4588259105991302,
              "y1": 0.5019370149407618,
              "x2": 0.6310872591106779,
              "y2": 0.6524178074541341,
              "confidence": 0.9993817806243896
            },
            "landmarks": [
              {
                "x": 0.5415363460511022,
                "y": 0.564819262709958
              },
              {
                "x": 0.6088369240214457,
                "y": 0.5697440101823386
              },
              {
                "x": 0.5869447814538655,
                "y": 0.5996306598055389
              },
              {
                "x": 0.5360882535406981,
                "y": 0.6194940211176515
              },
              {
                "x": 0.5828543641857566,
                "y": 0.6240365696391972
              }
            ]
          }
        ]
      },
      "id": "5e425f9cf721f5270bfd6122",
      "project_id": 2
    }
  },
  "meta": {
    "code": 200,
    "message": "OK"
  }
}
                

Response errors

Status CodeMessageDescription
400Cannot download image from URL: XXXOne of the image URLs cannot be downloaded. Please make sure the image exists and has public access.
400The browser (or proxy) sent a request that this server could not understand.The request is in a wrong format.
400image_url1 is missing, image_url2 is missingMissing required fields in the requests.
401UnauthorizedAuthorization header is missing, incorrect, expired, or disabled.
500Internal Server ErrorSomething went wrong on Data Wow’s application server. The incident will be logged and reported to our team.
504Gateway TimeoutThe request has been in queue for processing longer than a time limit (60 seconds) Thus, returned with the Gateway Timeout error.