Skip to main content
POST
/
api
/
portrait
/
analysis
/
skin-analysis-advanced
Skin analyze Advanced
curl --request POST \
  --url https://www.ailabapi.com/api/portrait/analysis/skin-analysis-advanced \
  --header 'Content-Type: multipart/form-data' \
  --header 'ailabapi-api-key: <api-key>' \
  --form 'face_quality_control=<string>' \
  --form 'return_rect_confidence=<string>' \
  --form 'return_maps=<string>' \
  --form image=@example-file
{
  "request_id": "",
  "log_id": "",
  "error_code": 0,
  "error_code_str": "",
  "error_msg": "",
  "error_detail": {
    "status_code": 200,
    "code": "",
    "code_message": "",
    "message": ""
  },
  "warning": [],
  "face_rectangle": {
    "top": 0,
    "left": 0,
    "width": 0,
    "height": 0
  },
  "result": {
    "skin_color": {
      "value": 0,
      "confidence": 0.89
    },
    "skin_age": {
      "value": 9
    },
    "left_eyelids": {
      "value": 0,
      "confidence": 0.89
    },
    "right_eyelids": {
      "value": 0,
      "confidence": 0.89
    },
    "eye_pouch": {
      "value": 0,
      "confidence": 0.89
    },
    "dark_circle": {
      "value": 0,
      "confidence": 0.89
    },
    "forehead_wrinkle": {
      "value": 0,
      "confidence": 0.89
    },
    "crows_feet": {
      "value": 0,
      "confidence": 0.89
    },
    "eye_finelines": {
      "value": 0,
      "confidence": 0.89
    },
    "glabella_wrinkle": {
      "value": 0,
      "confidence": 0.89
    },
    "nasolabial_fold": {
      "value": 0,
      "confidence": 0.89
    },
    "skin_type": {
      "skin_type": 0,
      "details": {
        "0": {
          "value": 1,
          "confidence": 0.89
        },
        "1": {
          "value": 1,
          "confidence": 0.89
        },
        "2": {
          "value": 0,
          "confidence": 0.01
        },
        "3": {
          "value": 0,
          "confidence": 0.01
        }
      }
    },
    "pores_forehead": {
      "value": 0,
      "confidence": 1
    },
    "pores_left_cheek": {
      "value": 0,
      "confidence": 1
    },
    "pores_right_cheek": {
      "value": 0,
      "confidence": 1
    },
    "pores_jaw": {
      "value": 0,
      "confidence": 1
    },
    "blackhead": {
      "value": 0,
      "confidence": 1
    },
    "acne": {
      "rectangle": [
        {
          "width": 3,
          "top": 17,
          "height": 1,
          "left": 35
        },
        {
          "width": 4,
          "top": 20,
          "height": 1,
          "left": 35
        }
      ]
    },
    "closed_comedones": {
      "rectangle": [
        {
          "width": 3,
          "top": 17,
          "height": 1,
          "left": 35
        },
        {
          "width": 4,
          "top": 20,
          "height": 1,
          "left": 35
        }
      ]
    },
    "mole": {
      "rectangle": [
        {
          "width": 3,
          "top": 17,
          "height": 1,
          "left": 35
        },
        {
          "width": 4,
          "top": 20,
          "height": 1,
          "left": 35
        }
      ]
    },
    "skin_spot": {
      "rectangle": [
        {
          "width": 3,
          "top": 17,
          "height": 1,
          "left": 35
        },
        {
          "width": 4,
          "top": 20,
          "height": 1,
          "left": 35
        }
      ]
    }
  }
}

Request

  • URL: https://www.ailabapi.com/api/portrait/analysis/skin-analysis-advanced
  • Method: POST
  • Content-Type: multipart/form-data

Image requirements

  • Image format: JPG JPEG
  • Image size: No more than 5 MB.
  • Image resolution: Larger than 200x200px, smaller than 4096x4096px.
  • Minimum face pixel size: To ensure the effect, the minimum value of the face frame (square) in the image should be higher than 400 pixels (which can be verified by passing a reference through the interface).
  • Face quality: The higher the face quality, the more accurate the skin analysis. Factors affecting face quality include: occlusion of the five facial features, blurred images, improper lighting (bright, dark, backlight), excessive face angle (recommended yaw ≤ ±30°, pitch ≤ ±40°), etc.

Headers

FieldRequiredTypeDescription
ailabapi-api-keyYESstringApplication API KEY. Get API KEY

Body

FieldRequiredTypeScopeDescription
imageYESfile
face_quality_controlNOinteger0, 1Whether to restrict the quality of faces in incoming images. 0`: No face quality control is performed, and skin measurement results are returned as long as the face can be detected.` 1: Perform face quality control, if the face quality does not pass it will prompt an error.
return_rect_confidenceNOinteger0, 1The confidence level of the area whether to return acne, occlusion, blemishes and moles. 0`: No regional confidence is returned.` 1: Returns the regional confidence.
return_mapsNOstringred_areaEnter a comma-separated string containing the type of skin chromatography image to be returned. (#return_maps)

return_maps

  • Request Example red_area
  • Field Parsing
FieldDescriptionReturn image information
red_areaA red zone map that shows areas of redness caused by facial sensitivity and inflammation.

Response

Response Field Handling Flow
  1. Handle Public Response Fields Parse and validate the Public Response Fields, checking the status code or response message to ensure the request is successful and error-free.
  2. Handle Business Response Fields If the Public Response Fields are valid and error-free, proceed with processing the business logic in the Business Response Fields.

Public Response Fields

Viewing Public Response Fields and Error Codes

Business Response Fields

FieldTypeScopeDescription
warningarrayimporper_headposeInterference factors affecting the calculation results. “imporper_headpose: Improper head angle (Judgment condition roll,yaw,pitch exceeds [-45,45]).
face_rectangleobjectThe position of the face rectangle box.
+topfloatThe vertical coordinate of the pixel point in the upper-left corner of the rectangle box.
+leftfloatThe horizontal coordinate of the pixel point in the upper-left corner of the rectangle.
+widthfloatThe width of the rectangle box.
+heightfloatThe height of the rectangle box.
resultobjectResults of face skin analysis.
+skin_colorobjectSkin color test results.
++valueinteger0, 1, 2, 3, 4Skin color. 0`: Transparent white.` 1: White. 2`: Naturally.` 3: Wheat. “4: Dark.
++confidencefloat[0, 1]Confidence.
+skintone_itaobjectReturns skin color classification information based on the ITA (Individual Typology Angle) standard. NOTE
++ITAfloat[-90, 90]Angle value.
++skintoneinteger0, 1, 2, 3, 4, 5, 6Classified according to the skin tone of ITA. 0`: Very light.` 1: Light. 2`: Intermediate.` 3: Tan. 4`: Brown.` 5: Dark. “6: Abnormal color values that may be caused by weak lighting conditions or overexposure.
+skin_hue_haobjectReturns skin tone classification information based on HA (Hue Angle). NOTE
++HAfloat[0, 90]HA angle value.
++skintoneinteger0, 1, 2, 3Classified according to HA’s skin tone hue. 0`: Yellowish.` 1: Neutral. 2`: Reddish.` 3: Abnormal hue values may be caused by abnormal ambient light tones or weak light environment or overexposure.
+skin_ageobjectSkin age test results.
++valueinteger[0, 100)Face skin age value.
+left_eyelidsobjectResults of the double eyelid test on the left eye.
++valueinteger0, 1, 2Type. 0`: Single eyelids` 1: Parallel Double Eyelids “2: Scalloped Double Eyelids
++confidencefloat[0, 1]Confidence.
+right_eyelidsobjectResults of the double eyelid test on the right eye.
++valueinteger0, 1, 2Type. 0`: Single eyelids` 1: Parallel Double Eyelids “2: Scalloped Double Eyelids
++confidencefloat[0, 1]Confidence.
+eye_pouchobjectEye bag test results.
++valueinteger0, 1With or without eye bags. 0`: No` 1: Yes
++confidencefloat[0, 1]Confidence.
+eye_pouch_severityobjectSeverity of puffiness under the eyes (return when puffiness test result is 1)
++valueinteger0, 1, 2Severity. 0`: Mild.` 1: Moderate. “2: Severe.
++confidencefloat[0, 1]Confidence.
+dark_circleobjectDark circles test results.
++valueinteger0, 1, 2, 3Type of dark circles under the eyes. 0`: No dark circles under the eyes.` 1: Pigmented dark circles. 2`: Vascular type dark circles under the eyes.` 3: Shadow-type dark circles under the eyes.
++confidencefloat[0, 1]Confidence.
+forehead_wrinkleobjectResults of the head-lift test.
++valueinteger0, 1With or without headlines. 0`: No` 1: Yes
++confidencefloat[0, 1]Confidence.
+crows_feetobjectFishtail test results.
++valueinteger0, 1With or without crow’s feet. 0`: No` 1: Yes
++confidencefloat[0, 1]Confidence.
+eye_finelinesobjectResults of the eye fine lines test.
++valueinteger0, 1The presence or absence of fine lines under the eyes. 0`: No` 1: Yes
++confidencefloat[0, 1]Confidence.
+glabella_wrinkleobjectResults of the interbrow line test.
++valueinteger0, 1With or without interbrow lines. 0`: No` 1: Yes
++confidencefloat[0, 1]Confidence.
+nasolabial_foldobjectResults of the forehead line test.
++valueinteger0, 1With or without lines. 0`: No` 1: Yes
++confidencefloat[0, 1]Confidence.
+nasolabial_fold_severityobjectSeverity of the forehead lines (returned when the result of the forehead line test is 1)
++valueinteger0, 1, 2Severity. 0`: Mild.` 1: Moderate. “1: Severe.
++confidencefloat[0, 1]Confidence.
+skin_typeobjectSkin texture test results.
++skin_typeinteger0, 1, 2, 3Type. 0`: Oily skin.` 1: Dry skin. 2`: Neutral skin.` 3: Combination skin.
++detailsobjectThe confidence level of each classification.
+++0objectOily skin information.
++++valueinteger0, 1Oily skin. 0`: No.` 1: Yes.
++++confidencefloatConfidence.
+++1objectDry skin information.
++++valueinteger0, 1Dry skin. 0`: No.` 1: Yes.
++++confidencefloatConfidence.
+++2objectNeutral skin information.
++++valueinteger0, 1Neutral skin. 0`: No.` 1: Yes.
++++confidencefloatConfidence.
+++3objectCombination skin information.
++++valueinteger0, 1Combination skin. 0`: No.` 1: Yes.
++++confidencefloatConfidence.
+pores_foreheadobjectForehead pore test results.
++valueinteger0, 1With or without enlarged pores. 0`: No` 1: Yes
++confidencefloat[0, 1]Confidence.
+pores_left_cheekobjectResults of the left cheek pore test.
++valueinteger0, 1With or without enlarged pores. 0`: No` 1: Yes
++confidencefloat[0, 1]Confidence.
+pores_right_cheekobjectResults of the right cheek pore test.
++valueinteger0, 1With or without enlarged pores. 0`: No` 1: Yes
++confidencefloat[0, 1]Confidence.
+pores_jawobjectChin pore test results.
++valueinteger0, 1With or without enlarged pores. 0`: No` 1: Yes
++confidencefloat[0, 1]Confidence.
+blackheadobjectBlackhead test results.
++valueinteger0, 1, 2, 3Severity. 0`: No blackheads.` 1: Mild. 2`: Moderate.` 3: Severe.
++confidencefloat[0, 1]Confidence.
+acneObjectAcne test results.
++rectanglearrayThe location of each pimple box.
+++widthfloatWidth.
+++heightfloatHeight.
+++leftfloatThe distance from the leftmost part of the picture.
+++topfloatThe distance from the topmost edge of the image.
++confidencearrayIf return_rect_confidence is 1, the confidence that each rectangular region is discriminated as a positive case is returned.
+moleObjectMole test results.
++rectanglearrayThe position of each mole frame.
+++widthfloatWidth.
+++heightfloatHeight.
+++leftfloatThe distance from the leftmost part of the picture.
+++topfloatThe distance from the topmost edge of the image.
++confidencearrayIf return_rect_confidence is 1, the confidence that each rectangular region is discriminated as a positive case is returned.
+closed_comedonesObjectClosure returns the result.
++rectanglearrayThe position of each closure frame.
+++widthfloatWidth.
+++heightfloatHeight.
+++leftfloatThe distance from the leftmost part of the picture.
+++topfloatThe distance from the topmost edge of the image.
++confidencearrayIf return_rect_confidence is 1, the confidence that each rectangular region is discriminated as a positive case is returned.
+skin_spotObjectSpot detection results.
++rectanglearrayThe position of each spot box.
+++widthfloatWidth.
+++heightfloatHeight.
+++leftfloatThe distance from the leftmost part of the picture.
+++topfloatThe distance from the topmost edge of the image.
++confidencearrayIf return_rect_confidence is 1, the confidence that each rectangular region is discriminated as a positive case is returned.
+face_mapsObjectReturns the skin chromatography visualization image set in the entry (return_maps).
++red_areabase64Red zone map. jpeg images for base64.
+sensitivityObjectThe sensitivity of the human face within the photo. This return value must be used with the red area map, you need to set the return red area map (“red_area”) in the input parameter return_maps first.
++sensitivity_areafloat[0, 1]Sensitive redness areas account for the proportion of cheeks and T-zone.
++sensitivity_intensityfloat[0, 100]The intensity of redness in sensitive areas.

skintone_ita

ITA (Individual Typology Angle) is an international standard for skin color, which is a method to classify skin color by measuring the color attributes of skin color Lab space. The method is strongly dependent on ambient light, we recommend using flash to take HD face photos for uploading and processing, the ITA angle value measured in natural light or dark environment may not be allowed or abnormal. According to the data taken by the rear flash of the phone, the current skin color classification reference.
skintoneScopeDescription
056 < ITA < 90Very light.
143 < ITA <= 56Light.
236 < ITA <= 43Intermediate.
320 < ITA <= 36Tan.
410 < ITA <= 20Brown.
5-90 < ITA <= 10Dark.
6OtherAbnormal color values that may be caused by weak lighting conditions or overexposure.
You can also use the returned ITA value to define your classification based on the returned ITA angle at the time of access.

skin_hue_ha

HA (Hue Angle) is an international standard for skin color, which is a method to classify skin color by measuring the color attributes of skin color Lab space. The method is strongly dependent on ambient light, we recommend using flash to take HD face photos for uploading and processing, the HA angle value measured in natural light or dark light environment may not be allowed or abnormal. According to the data taken by the rear flash of the phone, the current skin tone classification reference.
skintoneScopeDescription
049 < HA <= 90Yellowish.
146 <= HA < 49Neutral.
210 <= HA < 46Reddish.
3OtherAbnormal hue values may be caused by abnormal ambient light tones or weak light environment or overexposure.
You can also use the returned HA value to define your classification based on the returned HA angle at the time of access.

Response Example

{
  "request_id":     "",
  "log_id":         "",
  "error_code":     0,
  "error_msg":      "",
  "error_detail":   {
    "status_code":  200,
    "code":         "",
    "code_message": "",
    "message":      ""
  },
  "warning":        [],
  "face_rectangle": {
    "top":    0,
    "left":   0,
    "width":  0,
    "height": 0
  },
  "result":         {
    "skin_color":        {
      "value":      0,
      "confidence": 0.89
    },
    "skin_age":          {
      "value": 9
    },
    "left_eyelids":      {
      "value":      0,
      "confidence": 0.89
    },
    "right_eyelids":     {
      "value":      0,
      "confidence": 0.89
    },
    "eye_pouch":         {
      "value":      0,
      "confidence": 0.89
    },
    "dark_circle":       {
      "value":      0,
      "confidence": 0.89
    },
    "forehead_wrinkle":  {
      "value":      0,
      "confidence": 0.89
    },
    "crows_feet":        {
      "value":      0,
      "confidence": 0.89
    },
    "eye_finelines":     {
      "value":      0,
      "confidence": 0.89
    },
    "glabella_wrinkle":  {
      "value":      0,
      "confidence": 0.89
    },
    "nasolabial_fold":   {
      "value":      0,
      "confidence": 0.89
    },
    "skin_type":         {
      "skin_type": 0,
      "details":   {
        "0": {
          "value":      1,
          "confidence": 0.89
        },
        "1": {
          "value":      1,
          "confidence": 0.89
        },
        "2": {
          "value":      0,
          "confidence": 0.01
        },
        "3": {
          "value":      0,
          "confidence": 0.01
        }
      }
    },
    "pores_forehead":    {
      "value":      0,
      "confidence": 1
    },
    "pores_left_cheek":  {
      "value":      0,
      "confidence": 1
    },
    "pores_right_cheek": {
      "value":      0,
      "confidence": 1
    },
    "pores_jaw":         {
      "value":      0,
      "confidence": 1
    },
    "blackhead":         {
      "value":      0,
      "confidence": 1
    },
    "acne":              {
      "rectangle": [
        {
          "width":  3,
          "top":    17,
          "height": 1,
          "left":   35
        },
        {
          "width":  4,
          "top":    20,
          "height": 1,
          "left":   35
        }
      ]
    },
    "closed_comedones":  {
      "rectangle": [
        {
          "width":  3,
          "top":    17,
          "height": 1,
          "left":   35
        },
        {
          "width":  4,
          "top":    20,
          "height": 1,
          "left":   35
        }
      ]
    },
    "mole":              {
      "rectangle": [
        {
          "width":  3,
          "top":    17,
          "height": 1,
          "left":   35
        },
        {
          "width":  4,
          "top":    20,
          "height": 1,
          "left":   35
        }
      ]
    },
    "skin_spot":         {
      "rectangle": [
        {
          "width":  3,
          "top":    17,
          "height": 1,
          "left":   35
        },
        {
          "width":  4,
          "top":    20,
          "height": 1,
          "left":   35
        }
      ]
    }
  }
}

Sample Code

Authorizations

ailabapi-api-key
string
header
required

API Key for authentication

Body

multipart/form-data
image
file

Main Image.

face_quality_control
string

Whether to restrict the quality of faces in incoming images. <li>0: No face quality control is performed, and skin measurement results are returned as long as the face can be detected.</li> <li>1: Perform face quality control, if the face quality does not pass it will prompt an error.</li>

return_rect_confidence
string

The confidence level of the area whether to return acne, occlusion, blemishes and moles. <li>0: No regional confidence is returned.</li> <li>1: Returns the regional confidence.</li>

return_maps
string

Enter a comma-separated string containing the type of skin chromatography image to be returned.

Response

200 - application/json

Success

The response is of type object.