# 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="/files/Sw7BOOSrTSX5zHmVemsd" alt=""><figcaption></figcaption></figure>

The extension will be imported into your project.

### Coding Blocks

<figure><img src="/files/AVRYTbQFK5NMPZp69xbk" 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.


---

# 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/image-classifier-running-and-load.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.
