# Image Classifier: Running and Load

### 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%2FNDiauLjWKDzpb6d1zvHQ%2Fimage.png?alt=media&#x26;token=a336748f-5351-4756-adbc-d301a72b6de3" 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/_8Am6cMfY2YR6>" %}

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

#### Sample Program Operations

{% hint style="info" %}
KOI 2 will continously run the image classifier after model has been loaded.

A text message should appear when the model has been successfully loaded.
{% endhint %}

1. Press Button A on the Micro:bit to load the model.
2. Press Button B on the Micro:bit to show the classfied results and its similarity value on the Micro:bit.

### Advanced Usage

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

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

#### Sample Program Operations

{% hint style="info" %}
KOI 2 will continously run the image classifier after model has been loaded.

A text message should appear when the model has been successfully loaded.
{% endhint %}

1. Press Button A on the Micro:bit to load the model.
2. Press Button B on the Micro:bit to show the classfied results and its similarity value on the Micro:bit.
3. If the classified result is A, a heart icon is displayed on the Micro:bit. If the classified result is B, a smile icon is displayed on the Micro:bit.
