🟡API for Masks

This page contains description how to get images with applied masks via API.

Masks are additional results of image analysis, representing the spatial information about detected skin/hair health returned by the selected set of Algorithms.

Check the Masks description for more details.

What can you do?

You can find more details on these actions in the Rasterisation section of Swagger.


Apply masks to image with API

Apply Mask V4 Http

post
Authorizations
Query parameters
company_idstring · uuidRequired
Body
image_idstring · uuid4Required
image_typestring · enumRequiredPossible values:
Responses
200

Successful Response

application/json
post
POST /service/rasterisation/v4/masks/?company_id=123e4567-e89b-12d3-a456-426614174000 HTTP/1.1
Host: saas.haut.ai/
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 198

{
  "image_id": "text",
  "image_type": "original",
  "masks": [
    {
      "algorithm_tech_name": "text",
      "fill_override": [],
      "polyline_line_thickness": 0.001,
      "main_metric": true,
      "sub_metrics": true,
      "concentric_lines": false
    }
  ]
}
[
  {
    "algorithm_tech_name": "text",
    "masked_image_url": "text",
    "error": "text",
    "main_metric": {
      "name": "text",
      "tech_name": "text",
      "value": 1,
      "widget_type": "text"
    },
    "sub_metrics": [
      {
        "name": "text",
        "tech_name": "text",
        "value": 1,
        "widget_type": "text"
      }
    ],
    "feedback": {
      "ANY_ADDITIONAL_PROPERTY": "anything"
    }
  }
]

Required arguments are company_id and image_id.

It's important which image you want to visualize masks on: original or restored.

Then you need to compile a masks list:

  • algorithm_tech_name - it's internal ML algorithm tech_name (e.g. age or pores). We know that this is an incosistency, because we have 2 types of tech names throughout API. It will be changed in future.

  • optional fill_override - override mask color.

  • optional polyline_line_thickness - override mask line thickness.

  • optional main_metric - if API response should contain the metric for this algorithm.

  • optional sub_metrics - if API response should contain submetrics for this algorithm.

  • optional deprecated concentric_lines - if masks should be visualised as concentric lines. (Supported only for a few algorithms). Will be deleted in future.

This method returns signed URLs with images with applied masks.

Note We return 1 image per 1 mask, so if you request to apply 5 masks, you will receive 5 images, not 1 in response.

Last updated

Was this helpful?