# Face Mask Detection

### MakeCode Programming Tutorial

#### Extension link: [**https://github.com/KittenBot/pxt-koi2**](https://github.com/KittenBot/pxt-koi2)

Search for KOI2 in the search bar, select KOI 2.(KOI 2 has been approved by Microsoft)

<figure><img src="/files/Sw7BOOSrTSX5zHmVemsd" alt=""><figcaption></figcaption></figure>

The extension will be imported into your project.

### Coding Blocks

<figure><img src="/files/5FJYe3gZrme93baVCFJF" alt=""><figcaption></figcaption></figure>

### Sample Program

{% hint style="info" %}
Armourbit users need to use the corresponding initialization block
{% endhint %}

<figure><img src="https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6uJvpXC43onNIIwhMlWo%2Fuploads%2FPGyECwlPd2M3JqUBLDfO%2Fimage.png?alt=media&#x26;token=662ace3f-a8eb-4fbf-8a10-1d9643c88b1e" alt=""><figcaption></figcaption></figure>

{% embed url="<https://makecode.microbit.org/_6sq8RRCpE1zk>" %}

[Sample Program](https://makecode.microbit.org/_6sq8RRCpE1zk)

#### Sample Program Operations

1. KOI automatically detects faces.
2. If the detected face is wearing a mask, a tick icon is shown on the Micro:bit.
3. If the detected face is not wearing a mask, a cross icon is shown on the Micro:bit.


---

# Agent Instructions: 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:

```
GET https://sharinghub-eng.kittenbot.hk/airelated/ai-camera-koi-2/makecode-programming/face-mask-detection.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
