> For the complete documentation index, see [llms.txt](https://sharinghub-eng.kittenbot.hk/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sharinghub-eng.kittenbot.hk/programming-platforms/kittenblock/kittenblock-functions-and-features/kittenbot-extensions/machine-learning/machine-learning-5-faceapi.md).

# Machine Learning 5 FaceAPI

Machine Learning 5’s FaceAPI is a face detection tool.

### Loading the extension for Machine Learning 5

```
The Video Sensing extension is also used in this tutorial.
```

Open up the extension page.

![](https://kittenbothk-eng.readthedocs.io/en/latest/_images/add.png)

Select Video Sensing, Machine Learning 5 and the Pen extension.

![](https://kittenbothk-eng.readthedocs.io/en/latest/_images/add2.png)

![](https://kittenbothk-eng.readthedocs.io/en/latest/_images/ml28.png)

New programming blocks will be added.

![](https://kittenbothk-eng.readthedocs.io/en/latest/_images/ml6.png)

If your computer has a low specification(e.g. lacks a discrete GPU), its performance maybe enhanced by using CPU mode.

![](https://kittenbothk-eng.readthedocs.io/en/latest/_images/ml14.png)

### Detecting Faces

The Face model must be initialized before any faces can be detected.

![](https://kittenbothk-eng.readthedocs.io/en/latest/_images/ml29.png)

Example 1: Detecting a face.

![](https://kittenbothk-eng.readthedocs.io/en/latest/_images/ml30.png)

![](https://kittenbothk-eng.readthedocs.io/en/latest/_images/ml31.png)

Example 2: Tracking facial features.

![](https://kittenbothk-eng.readthedocs.io/en/latest/_images/ml32.png)

![](https://kittenbothk-eng.readthedocs.io/en/latest/_images/ml33.png)
