Skip to content

Commit

Permalink
update vision docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Neutree committed Dec 5, 2024
1 parent ab451fc commit 5113399
Show file tree
Hide file tree
Showing 8 changed files with 71 additions and 2 deletions.
25 changes: 25 additions & 0 deletions docs/doc/en/pro/datasets.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
title: MaixCAM MaixPy: Where to Find Datasets for Training 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.

## Is It Possible Not to Use a Dataset?

Yes, it is possible!

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.

## 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.

### 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.

### 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.

2 changes: 2 additions & 0 deletions docs/doc/en/sidebar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ items:
label: YOLO11/v8 model offline training
- file: ai_model_converter/maixcam.md
label: ONNX model to MaixCAM's
- file: pro/datasets.md
label: Where to find datasets
- file: pro/customize_model.md
label: Customize new AI model

Expand Down
7 changes: 6 additions & 1 deletion docs/doc/en/vision/customize_model_yolov8.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ To ensure our model can be used on MaixPy (MaixCAM), it must go through the foll
* Convert the `onnx` model into a `MUD` file supported by MaixPy, as described in the [MaixCAM Model Conversion](../ai_model_converter/maixcam.md) article.
* Use MaixPy to load and run the model.

## Where to Find Datasets for Training

Please refer to [Where to find datasets](../pro/datasets.md)


## Reference Articles

Since this process is quite general, this article only provides an overview. For specific details, please refer to the **[YOLO11 / YOLOv8 official code and documentation](https://github.com/ultralytics/ultralytics)** (**recommended**) and search for training tutorials to eventually export an ONNX file.
Expand Down Expand Up @@ -72,7 +77,7 @@ MaixPy/MaixCDK currently supports YOLOv8 / YOLO11 for object detection, YOLOv8-p

Follow [MaixCAM Model Conversion](../ai_model_converter/maixcam.md) to convert the model.

Pay attention to the model output node selection:
Pay attention to the selection of the model output nodes (note that the numerical values of your model might not be exactly the same; refer to the diagram below to identify the corresponding nodes):
* Object detection:
* YOLOv8 extracts `/model.22/dfl/conv/Conv_output_0,/model.22/Sigmoid_output_0` from ONNX as outputs.
* YOLO11 extracts `/model.23/dfl/conv/Conv_output_0,/model.23/Sigmoid_output_0`.
Expand Down
5 changes: 5 additions & 0 deletions docs/doc/en/vision/display.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ disp.set_backlight(50)

Note that when the program exits and returns to the app selection interface, the backlight brightness will automatically revert to the system setting.

If the brightness is set to `100%` and still feels dim, you can try modifying the `disp_max_backlight=50` option in the `/boot/board` file to a larger value. When `disp_max_backlight=100` and `disp.set_backlight(100)` are set, the hardware backlight control pin outputs a 100% duty cycle, which is a high level. The final duty cycle output to the hardware is calculated as:
`set_backlight value` * `disp_max_backlight`.

**Note**: Increasing the maximum brightness limit will lead to higher power consumption and heat generation. Adjust it reasonably based on your actual needs and avoid blindly maxing out the brightness.

## Displaying on MaixVision

When running code in MaixVision, images can be displayed on MaixVision for easier debugging and development.
Expand Down
23 changes: 23 additions & 0 deletions docs/doc/zh/pro/datasets.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
title: MaixCAM MaixPy 训练模型哪里能找到数据集
---

## 数据集有什么用

## 不找数据集行不行

行。

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

## 哪里找数据集

* 方法一:去算法官方官方找数据集。
比如对于 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 支持的格式。




2 changes: 2 additions & 0 deletions docs/doc/zh/sidebar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ items:
label: 离线训练 YOLO11/YOLOv8 模型
- file: ai_model_converter/maixcam.md
label: ONNX 模型转给 MaixCAM 用
- file: pro/datasets.md
label: 哪里找数据集
- file: pro/customize_model.md
label: 移植新模型

Expand Down
6 changes: 5 additions & 1 deletion docs/doc/zh/vision/customize_model_yolov8.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ YOLOv8 / YOLO11 不光支持检测物体,还有 yolov8-pose / YOLO11-pose 支
* 使用 MaixPy 加载模型运行。


## 哪里找数据集训练

请看[哪里找数据集](../pro/datasets.md)


## 参考文章

Expand Down Expand Up @@ -78,7 +82,7 @@ MaixPy/MaixCDK 目前支持了 YOLOv8 / YOLO11 检测 以及 YOLOv8-pose / YOLO1

按照[MaixCAM 模型转换](../ai_model_converter/maixcam.md) 进行模型转换。

注意模型输出节点的选择:
注意模型输出节点的选择(注意可能你的模型可能数值不完全一样,看下面的图找到相同的节点即可)
* 检测模型:
* YOLOv8 提取 onnx 的 `/model.22/dfl/conv/Conv_output_0,/model.22/Sigmoid_output_0` 这两个输出。
* YOLO11 提取`/model.23/dfl/conv/Conv_output_0,/model.23/Sigmoid_output_0`输出。
Expand Down
3 changes: 3 additions & 0 deletions docs/doc/zh/vision/display.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ disp.set_backlight(50)

注意,程序退出回到应用选择界面后会自动恢复到系统设置的背光亮度。

> 如果亮度设置到 `100%` 仍然觉得暗,可以尝试修改`/boot/board`文件中的`disp_max_backlight=50`选项为更大的值,当`disp_max_backlight=100`并且`disp.set_backlight(100)`时硬件上背光控制引脚输出`100%`占空比即高电平。即最终输出到硬件的占空比 = `set_backlight 设置值` * `disp_max_backlight`
> **注意**,修改最大亮度限制会带来功耗和发热量的上升,按照自己实际需求合理设置,不要盲目追求拉满亮度。

## 显示到 MaixVision

Expand Down

0 comments on commit 5113399

Please sign in to comment.