> For the complete documentation index, see [llms.txt](https://docs.saas.haut.ai/haut.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.saas.haut.ai/haut.ai/developers/saas-api-overview/api-for-hair-metrics-2.0/hair-segmentation.md).

# Hair Segmentation

Haut.AI provides an AI algorithm that returns a hair mask and segmented hair images.

## **Description**

The algorithm segments hair on the provided restored image. It returns not only a binary mask of the segmented hair but a masked image with a predicted hair region.

Image results can be retrieved via aux.

## `id`

The algorithm returns a sequence in the form of `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx` , which is a unique image id for each particular output (mask or masked image).

Images can be downloaded through the relevant link, such as:

**URL:** <https://saas.haut.ai/images/\\><id>.jpg

## `aux_image_type`

Indicates the parameters for each output of the segmentation algorithm.

```python
"aux_image_type":[
                  {
                  "id": 43,
                  "name": "Hair Segmentation Mask",
                  "tech_name": "hair_image.front_face.hair_segmentation_mask"
                  },
                  {
                  "id": 42,
                  "name": "Masked Hair RGB",
                  "tech_name": "hair_image.front_face.masked_hair_rgb"
                  },
                 ]
```

* **`Hair Segmentation Mask`** stores information about the binary segmentation mask
  * `"id": "43"` - tech output id
  * `"name": "Hair Segmentation Mask"`
  * `"tech_name": "hair_image.front_face.hair_segmentation_mask"`
* **`Masked Hair RGB`** stores information about the segmented hair from an image
  * `"id": "42"` - tech output id
  * `"name": "Masked Hair RGB"`
  * `"tech_name": "hair_image.front_face.masked_hair_rgb"`

***

{% hint style="warning" %}
Not a Haut.AI client yet?
{% endhint %}

<a href="https://haut.ai/book-a-demo?utm_source=referral&#x26;utm_medium=saas_docs&#x26;utm_campaign=Docs_SaaS_HautAI" class="button primary" data-icon="user-vneck">Book a demo</a> <a href="https://haut.ai/product/ai-skin-analysis?utm_source=referral&#x26;utm_medium=saas_docs&#x26;utm_campaign=Docs_SaaS_HautAI" class="button secondary" data-icon="external-link">Platform overview on haut.ai</a>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.saas.haut.ai/haut.ai/developers/saas-api-overview/api-for-hair-metrics-2.0/hair-segmentation.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
