# 機器學習圖像辨識 模型訓練

### MakeCode編程

在MakeCode打開專案，點擊擴展一頁。

<figure><img src="https://kittenbothk.readthedocs.io/en/latest/_images/16-1.png" alt=""><figcaption></figcaption></figure>

在搜尋欄輸入koi 2。

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

加載成功後，積木欄會新增koi2的積木。

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

### 編程積木

<figure><img src="https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsN6MlwBFbL3P67FzMMyL%2Fuploads%2Fg8gveE0DC4idrYoORQEx%2Fimage.png?alt=media&#x26;token=97b18306-46f0-43d8-8aba-690e1ac10ca3" alt=""><figcaption></figcaption></figure>

### 參考程式

{% hint style="info" %}
KOI 2已經放寬了40張照片的限制

毋須使用SD卡模型儲存，模型可以直接儲存到KOI的內存裡面
{% endhint %}

{% hint style="info" %}
Armourbit用家請使用初始化Armourbit積木。
{% 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/_FKDPvMhKFiLV>" %}

[參考程式](https://makecode.microbit.org/_FKDPvMhKFiLV)

#### 程式解說

{% hint style="info" %}
訓練時，KOI會顯示該物件的相片數量。

儲存成功的話，KOI會顯示Save Successfully的畫面。
{% endhint %}

1. 按A訓練第一件物件，並將物件分類為A。
2. 按B訓練第一件物件，並將物件分類為B。
3. 按A+B將模型儲存。模型成功儲存後，KOI會顯示Save Successfully的畫面。

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


---

# 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.kittenbot.hk/airelated/koi2/koi2makecode/modeltrain.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.
