# 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="https://686851495-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7Bv9xBdKh3R9w6Vp7asd%2Fuploads%2Fl4LAJvAYYE9RTHdxFSja%2FlALPGTO6sYhE8bbNAo7NBVw_1372_654.png?alt=media&#x26;token=fcce3ddf-c398-4075-9248-bba1b14267cd" alt=""><figcaption></figcaption></figure>

The extension will be imported into your project.

### Coding Blocks

<figure><img src="https://686851495-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7Bv9xBdKh3R9w6Vp7asd%2Fuploads%2FTh6cdY5T5c9FnTcqHeWe%2Fimage.png?alt=media&#x26;token=8d03bc36-99b5-4993-a990-0651ade196d4" 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.
