Background supergraphic

Deepfake Detection

A Deep Fake Detection API is specifically designed to identify counterfeit or fraudulent profiles during the onboarding process, primarily by detecting fake faces generated using deep fake technologies. As of the current state, this API exclusively supports video input requests.

Deepfake Detection Object

  • Name
    status
    Type
    string
    Description

    Enum code indicating the status of the reading result.

    1. SUCCESS
    2. NO_FILE
    3. FILE_INVALID_FORMAT
    4. FAILED
  • Name
    reason
    Type
    string
    Description

    A human-readable message providing more details about the reading result.

  • Name
    read
    Type
    object
    Description

    The result of deepfake detection.

    • Name
      deepfake
      Type
      object
      Description
      • Name
        confidence
        Type
        number
        Description

        Confidence score of the model producing the output (in percentage).

      • Name
        value
        Type
        object
        Description

        Enum code indicating the deepfake status. See Responses below for details.

        1. real
        2. fake

POST/face/v1/deepfake

Deepfake Detection (video)

Detect fake faces generated using deep fake technologies from a video or list of frame. Use form-data if you want to request with video file.

Parameter

  • Name
    video
    Type
    file (.mp4)
    Description

    The video file to be detected. The maximum video size is 6MB.

Sample Request

POST
/face/v1/deepfake
1
2
3
4
curl -v -L -X POST 'https://api.vision.glair.ai/face/v1/deepfake' \ -H "Authorization: Basic $(printf "%s" "USERNAME:PASSWORD" | base64)" \ -H 'x-api-key: API_KEY' \ -F 'video=@"/path/to/video.mp4"'

Sample Response

1
2
3
4
5
6
7
8
9
10
{ "read": { "deepfake": { "confidence": 0.99768, "value": "fake" } }, "reason": "File Successfully Read", "status": "SUCCESS" }

POST/face/v1/deepfake/images

Deepfake Detection (frames)

This endpoint for input list of frame rather video. Use raw json body if you want to request with list of base 64 encoded frame.

Parameter

  • Name
    frames
    Type
    list of string base64 encoded
    Description

    The list of frames to be detected. The maximum total size is 6MB.

Sample Request

POST
/face/v1/deepfake
1
2
3
4
curl -v -L -X POST 'https://api.vision.glair.ai/face/v1/deepfake/images' \ -H "Authorization: Basic $(printf "%s" "USERNAME:PASSWORD" | base64)" \ -H 'x-api-key: API_KEY' \ --data-raw '{ "frames": ["base64_1", "base64_2", ...] }'

Sample Response

1
2
3
4
5
6
7
8
9
10
{ "read": { "deepfake": { "confidence": 0.06789, "value": "real" } }, "reason": "File Successfully Read", "status": "SUCCESS" }

Request ID

An associated request identifier is generated for every request made to this endpoint. This value can be found in the response headers under Request-Id


Responses

Various responses for this endpoint, in addition to general responses specified in Errors.

200 - OK

Success, detect deepfake in the video input.

Response

1
2
3
4
5
6
7
8
9
10
{ "read": { "deepfake": { "confidence": 0.99768, "value": "fake" } }, "reason": "File Successfully Read", "status": "SUCCESS" }

200 - OK

Success, no deepfake in the video input.

Response

1
2
3
4
5
6
7
8
9
10
{ "read": { "deepfake": { "confidence": 0.06415167450904846, "value": "real" } }, "reason": "File Successfully Read", "status": "SUCCESS" }

400 - Bad Request

Input video not found.

Response

1
2
3
4
{ "reason": "No file in request body", "status": "ERROR" }