Skip to content

Commit

Permalink
update doc
Browse files Browse the repository at this point in the history
  • Loading branch information
Neutree committed Feb 5, 2025
1 parent 270f56d commit eedad16
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 0 deletions.
22 changes: 22 additions & 0 deletions docs/doc/en/basic/maixvision.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ When we click the 'pause' button in the top right corner, it will stop sending i
## Code Auto Completion

Code suggestions depend on local Python packages installed on your computer. To enable code suggestions, you need to install Python on your computer and the required Python packages.
> If it is not installed, a red underlined wavy line error prompt will be displayed. The code can still run normally, but there will be no code completion prompt.
* To install Python, visit the [Python official website](https://python.org/).
* To install the required packages, for MaixPy, for instance, you need to install the MaixPy package on your computer using `pip install MaixPy`. If `MaixPy` gets updated, you should update it on both your computer and device. On your computer, manually execute `pip install MaixPy -U` in the terminal. For device updates, update directly in the `Settings` application.
Expand All @@ -52,6 +53,27 @@ Code suggestions depend on local Python packages installed on your computer. To
> Additionally, while you have the MaixPy package installed on your computer, due to our limited resources, we cannot guarantee that you can directly use the Maix package in your computer's Python. Please run it on supported devices.

In addition, in addition to the MaixPy package, other code hints, such as `numpy/opencv`, also need to be installed on the computer to implement code hints.

## Single file and project (multiple py file projects/modularization)

When writing code, there are generally two modes, executing a single file, or executing a complete project (containing multiple py files or other resource files).
* **Single file mode**: MaixVision creates or opens a file in the `.py` format, and clicks Run in the lower left corner after editing to execute the code.
* **Project (multiple files) mode**:
* Create an empty folder in the system file manager, and MaixVision clicks `Open folder/project` to open this empty folder.
* Create a main program entry of `main.py` (the name must be `main.py`). If `main.py` wants to reference other `.py` files, create a `.py` file in the project folder, such as `a.py`
```python
def say_hello():
print("hello from module a")
```
* Reference in `main.py`
```python
from a import say_hello
say_hello()
```
* Run the project, click the `Run Project` button in the lower left corner to automatically package the entire project and send it to the device for running.
* If you have opened a folder/project and still want to run a file separately, you can open the file you want to run, and then click the `Run Current File` in the lower left corner to send only the current file to the device for running. Note that other files will not be sent to the device, so do not reference other `.py` files.


## Calculating the Image Histogram

Expand Down
3 changes: 3 additions & 0 deletions docs/doc/en/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,9 @@ Here, the `model` is specified as the `yolov5s_224_int8.cvimodel` file relative

This error occurs because MaixVision's code hinting feature cannot find the `maix` module. It's important to understand that MaixVision's code hinting relies on the local Python packages on your computer, while the code execution depends on the Python packages on the device. To enable MaixVision's code hinting, you need to install Python and the `MaixPy` package on your computer. For more details, refer to the [MaixVision User Documentation](./basic/maixvision.md).

## MaixVision how to import from another .py file

Read documentation of [MaixVision](./basic/maixvision.md) carefully.

## MaixCAM starts very slowly, even exceeding 1 minute, or the screen flickers

Expand Down
22 changes: 22 additions & 0 deletions docs/doc/zh/basic/maixvision.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ while 1:


代码提示依赖电脑本地的 Python 包,为了实现代码提示,我们需要在电脑中安装 Python,并且安装需要提示的 Python 包。
> 不安装则会显示红色下划波浪线错误提示,代码仍然能正常运行,只是没有代码补全提示。
* 安装 Python 请访问 [Python 官网](https://python.org/)安装。
* 安装需要提示的包,比如对于 MaixPy, 你需要在电脑也安装一份 MaixPy 包,在电脑使用`pip install MaixPy`即可安装好,如果`MaixPy`更新了,你也需要在电脑和设备更新到`MaixPy`,电脑手动在终端执行`pip install MaixPy -U`即可,设备更新直接在`设置`应用中更新即可。
Expand All @@ -54,6 +55,27 @@ while 1:
> 另外,虽然你在电脑上安装了 MaixPy 包,但是由于我们精力有限,我们不确保你能直接在电脑的 Python 导入 maix 包进行使用,请在支持的设备上运行。

另外,除了 MaixPy 软件包,其它的代码提示,比如 `numpy/opencv` 都同样的需要在电脑也安装一份来实现代码提示。

## 单文件和项目(多个 py 文件项目/模块化)

在编写代码时,一般两种模式,执行单个文件,或者执行一个完成项目(包含多个 py 文件或者其它资源文件)。
* **单文件模式**:MaixVision 创建或者打开一个 `.py`格式的文件,编辑后点击左下角运行即可执行代码。
* **项目(多文件)模式**
* 在系统文件管理器创建一个空文件夹,MaixVision 点击`打开文件夹/项目`打开这个空文件夹。
* 创建一个`main.py`的主程序入口(名字必须是`main.py`),如果`main.py`想引用其它`.py`文件,在项目文件夹下建立一个`.py`文件比如`a.py`
```python
def say_hello():
print("hello from module a")
```
*`main.py` 中引用
```python
from a import say_hello
say_hello()
```
* 运行项目,点击左下角`运行项目`按钮将整个项目自动打包发送到设备中运行。
* 如果你打开了一个文件夹/项目,仍想单独运行某个文件,可以打开想要运行的文件,然后点击左下角`运行当前文件`只发送当前文件到设备运行,注意不会发送其它文件到设备,所以不要引用其它`.py`文件。


## 计算图像的直方图

Expand Down
5 changes: 5 additions & 0 deletions docs/doc/zh/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,11 @@ labels = person, bicycle, car, motorcycle, airplane, bus, train, truck, boat, tr
这是 MaixVision 的代码提示功能报错找不到 maix 模块。
这里需要搞清楚一个概念: MaixVision 的代码提示依赖的是电脑本地的 Python 包,代码运行依赖的设备端的 Python 包,所以要让 MaixVision 能够提示就要在电脑上也安装 Python 和 `MaixPy` 包。具体请看[MaixVision 使用文档](./basic/maixvision.md)

## MaixVision 如何编写多个文件,一个文件导入另一个文件的代码

仔细阅读 [MaixVision 使用文档](./basic/maixvision.md)


## MaixCAM 启动非常缓慢,甚至超过了 1 分钟,或者屏幕在闪动

多半是由于供电不足造成的, MaixCAM 需要 5v 150mA~500mA 左右的电压和点流,如果你遇到了这种现象,可以使用 USB 转 TTL 模块连接 MaixCAM 的串口到电脑,可以看到`Card did not respond to voltage select! : -110` 这样的字样,说明供电不足,换一个更加的稳定的供电设备即可。
Expand Down

0 comments on commit eedad16

Please sign in to comment.