Skip to content

Commit

Permalink
update model docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Neutree committed Dec 20, 2024
1 parent a512f1a commit 3a7c496
Show file tree
Hide file tree
Showing 8 changed files with 64 additions and 19 deletions.
12 changes: 12 additions & 0 deletions docs/doc/en/pro/customize_model.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,18 @@ Besides the built-in AI algorithms and models, MaixPy is highly extensible, allo

Due to the prevalence of visual applications, this guide will be divided into sections for visual applications and other applications.


## If MaixPy Already Supports the Framework but the Dataset is Different

For instance, if MaixPy already supports YOLO11 detection, but your dataset is different, you only need to prepare your dataset, train the model, and export it.

Another quick and lazy method is to first search online to see if someone has already trained or open-sourced a model. If you find one, simply download it and convert the format for use, or continue training based on it.

For example:
If you want to detect fire, a quick search online might lead you to the project [Abonia1/YOLOv8-Fire-and-Smoke-Detection](https://github.com/Abonia1/YOLOv8-Fire-and-Smoke-Detection), which shares a fire and smoke detection model based on YOLOv8. You can download it, export it to the ONNX format, and then convert it to a format supported by MaixPy.

You can also upload your model to the [MaixHub Model Library](https://maixhub.com/model/zoo) to share it with more people, or find models shared by others there.

## Adding Visual AI Models and Algorithms in Python

For visual applications, the usual task is image recognition, specifically:
Expand Down
32 changes: 20 additions & 12 deletions docs/doc/en/pro/datasets.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,33 @@
---
title: MaixCAM MaixP Where to Find Datasets for Training Models
title: MaixCAM MaixP Where to Find Models and Datasets
---

---

## Where to Find Ready-to-Use Models for MaixPy MaixCAM

Visit the [MaixHub Model Library](https://maixhub.com/model/zoo) and filter by the corresponding hardware platform to find suitable models.

## What Are Datasets Used For?

Datasets are essential for training machine learning models. They provide the labeled data that models use to learn patterns and features, enabling them to perform specific tasks such as object detection, image classification, or keypoint detection.
First, check the [MaixHub Model Library](https://maixhub.com/model/zoo) to see if there’s a model you need. If not, you can train your own model. Training a model requires a dataset, which provides the data needed for training.

## Converting Existing Models for Use with MaixCAM MaixPy

## Is It Possible Not to Use a Dataset?
MaixPy natively supports several model frameworks, such as YOLOv8/YOLO11/Mobilenet, etc. Models trained with these frameworks can be exported to ONNX format and then converted to a format supported by MaixCAM for use with MaixPy MaixCAM.

Yes, it is possible!
If you don’t want to train your own models, you can find open-source pre-trained models online. For instance, YOLO11/YOLOv8/YOLOv5 have many shared models. For example, from [this link](https://github.com/Eric-Canas/qrdet/releases), you can download YOLOv8 models for QR code detection (`qrdet-*.pt`). Simply export the model to ONNX format and convert it to [MaixCAM’s supported format](https://maixhub.com/model/zoo/480).

Instead of training your own model, you can use open-source pre-trained models. For example, there are many pre-trained models available for YOLO11, YOLOv8, and YOLOv5. One such source is [this repository](https://github.com/Eric-Canas/qrdet/releases), where you can download YOLOv8 models for QR code detection (`qrdet-*.pt`) then can be convert [model for MaixCAM](https://maixhub.com/model/zoo/480). These models can be exported to ONNX format and then converted to a format supported by MaixCAM.
Refer to the [MaixCAM Model Conversion Documentation](../ai_model_converter/maixcam.md) for details on the conversion process.

## Where to Find Datasets
## Where to Find Datasets?

### Option 1: Use Official Datasets from Algorithm Providers
For models like YOLO11 or YOLOv8, you can find many open-source datasets in the [YOLO Official Documentation - Datasets](https://docs.ultralytics.com/datasets/). These datasets are ready to use, and training can be done with a single command as per the documentation. After training, you can export the model to ONNX format and convert it to work with MaixCAM.
1. **Method 1: Check Official Documentation for Algorithms**
For example, for YOLO11/YOLOv8, the [YOLO Official Documentation - Datasets](https://docs.ultralytics.com/datasets/) provides a variety of open-source datasets. You can use a single command to train models following the documentation. Afterward, export the model to ONNX format and convert it for MaixCAM.

### Option 2: Use Dataset Platforms
Platforms such as [Kaggle](https://www.kaggle.com/datasets/riondsilva21/hand-keypoint-dataset-26k) and [Roboflow](https://universe.roboflow.com/) provide extensive collections of datasets for various tasks. You can search for and download datasets that fit your needs.
2. **Method 2: Visit Dataset Websites**
Platforms like [Kaggle](https://www.kaggle.com/datasets/riondsilva21/hand-keypoint-dataset-26k) or [Roboflow](https://universe.roboflow.com/) host numerous datasets for different applications.

### Option 3: Create Your Own Dataset in YOLO Format
If you have access to open-source datasets, you can reformat them to make them compatible with YOLO and use them for training. This option provides flexibility and allows you to tailor datasets to your specific application.
3. **Method 3: Use Open-Source Datasets and Prepare Training Scripts**
Search for open-source datasets and format them into scripts compatible with training frameworks like YOLO.

2 changes: 1 addition & 1 deletion docs/doc/en/sidebar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ items:
- file: ai_model_converter/maixcam.md
label: ONNX model to MaixCAM's
- file: pro/datasets.md
label: Where to find datasets
label: Where to find models & datasets
- file: pro/customize_model.md
label: Customize new AI model

Expand Down
4 changes: 4 additions & 0 deletions docs/doc/en/vision/detect_obb.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ plane, ship, storage tank, baseball diamond, tennis court, basketball court, gro

The model file can be found at `/root/models/yolo11n_obb.mud`.

## More Input Resolutions

The default input image resolution is `320x224`. For higher resolutions, download from the [MaixHub Model Zoo](https://maixhub.com/model/zoo/869) or customize your own model as described below.

## Customizing Your Own OBB Model for MaixPy MaixCAM

### Using the Model on a Computer
Expand Down
10 changes: 10 additions & 0 deletions docs/doc/zh/pro/customize_model.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@ update:
因为视觉应用比较多,以下将分为视觉应用和其它应用进行讲解。


## 如果 MaixPy 已经支持的框架,只是数据集不同

比如 MaixPy 已经支持了 YOLO11 检测,但是你的数据集不同,这种情况下,你只需要准备好数据集,然后训练模型,导出模型即可。

还有一个偷懒的最快的方式,就是先去网上找找有没有人已经训练好了模型或者开源了模型,下载转一下格式就能用了,或者基于其继续训练。
举个例子:
比如要识别火焰,在网上一搜,找到[Abonia1/YOLOv8-Fire-and-Smoke-Detection](https://github.com/Abonia1/YOLOv8-Fire-and-Smoke-Detection) 这个项目分享了基于 YOLOv8 的火焰和烟雾检测模型,下载下来,导出成 ONNX 格式再转换为 MaixPy 支持的格式即可。

可以上传到[MaixHub 模型库](https://maixhub.com/model/zoo)分享给更多人使用,也可以找其他人分享的模型。

## 在 Python 层面添加视觉 AI 模型和算法

对于视觉,一般来说是对图像进行时别,即:
Expand Down
18 changes: 13 additions & 5 deletions docs/doc/zh/pro/datasets.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,30 @@
---
title: MaixCAM MaixPy 训练模型哪里能找到数据集
title: MaixCAM MaixPy 训练模型哪里能找到模型和数据集
---

## 哪里找 MaixPy MaixCAM 直接能使用的模型

[MaixHub 模型库](https://maixhub.com/model/zoo) 筛选对应的硬件平台即可找到。

## 数据集有什么用

## 不找数据集行不行
可以先到[MaixHub 模型库](https://maixhub.com/model/zoo)看看有没有你需要的模型,如果没有,你可以自己训练模型,训练模型需要数据集,数据集就是用来训练模型的。

## 转换已有的模型给 MaixCAM MaixPy 使用

MaixPy 默认支持了一些模型框架,比如 YOLOv8/YOLO11/Mobilenet 等等,所以只要是这些框架训练的模型,只需要导出成 ONNX 格式再转换为 MaixCAM 支持的格式后 MaixPy MaixCAM 就可以使用了。

一些常见的数据,不自己训练,网上可以找到开源分享的训练好的预训练模型,比如 YOLO11/YOLOv8/YOLOv5 就会有很多,比如[这里](https://github.com/Eric-Canas/qrdet/releases)可以下载到检测二维码的 YOLOv8 与训练模型(qrdet-*.pt),直接拿来导出成 ONNX 格式再转换为 [MaixCAM 支持的格式](https://maixhub.com/model/zoo/480)即可

不自己训练,网上可以找到开源分享的训练好的预训练模型,比如 YOLO11/YOLOv8/YOLOv5 就会有很多,比如[这里](https://github.com/Eric-Canas/qrdet/releases)可以下载到检测二维码的 YOLOv8 与训练模型(qrdet-*.pt),直接拿来导出成 ONNX 格式再转换为 [MaixCAM 支持的格式](https://maixhub.com/model/zoo/480)即可
转换方法看[MaixCAM 模型转换文档](../ai_model_converter/maixcam.md)

## 哪里找数据集

* 方法一:去算法官方官方找数据集。
比如对于 YOLO11/YOLOv8, [YOLO 官方文档-数据集](https://docs.ultralytics.com/datasets/) 中可以看到有很多开源数据集,按照其文档使用一行命令就能快速训练。同样导出 ONNX 格式再转换为 MaixCAM 支持的格式即可。
* 方法二:去数据集网站获取。
比如 [Kaggle](https://www.kaggle.com/datasets/riondsilva21/hand-keypoint-dataset-26k)[roboflow](https://universe.roboflow.com/)等等。
* 方法三:找开源数据集制作成 YOLO 支持的格式。
* 方法三:找开源数据集制作成模型训练脚本(比如 YOLO支持的格式。



Expand Down
2 changes: 1 addition & 1 deletion docs/doc/zh/sidebar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ items:
- file: ai_model_converter/maixcam.md
label: ONNX 模型转给 MaixCAM 用
- file: pro/datasets.md
label: 哪里找数据集
label: 哪里找模型和数据集
- file: pro/customize_model.md
label: 移植新模型

Expand Down
3 changes: 3 additions & 0 deletions docs/doc/zh/vision/detect_obb.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ plane, ship, storage tank, baseball diamond, tennis court, basketball court, gro
```
`/root/models/yolo11n_obb.mud`文件中也能看到。

## 更多输入分辨率

默认的输入图像分辨率是`320x224`,如果需要更高的分辨率,可以到[MaixHub 模型库](https://maixhub.com/model/zoo/869) 下载,或者按照后文自定义模型。

## MaixPy MaixCAM 自定义自己的OBB模型

Expand Down

0 comments on commit 3a7c496

Please sign in to comment.