Skip to content

Commit eedad16

Browse files
committed
update doc
1 parent 270f56d commit eedad16

File tree

4 files changed

+52
-0
lines changed

4 files changed

+52
-0
lines changed

docs/doc/en/basic/maixvision.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ When we click the 'pause' button in the top right corner, it will stop sending i
3939
## Code Auto Completion
4040

4141
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.
42+
> 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.
4243
4344
* To install Python, visit the [Python official website](https://python.org/).
4445
* 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.
@@ -52,6 +53,27 @@ Code suggestions depend on local Python packages installed on your computer. To
5253
> 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.
5354
5455

56+
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.
57+
58+
## Single file and project (multiple py file projects/modularization)
59+
60+
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).
61+
* **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.
62+
* **Project (multiple files) mode**:
63+
* Create an empty folder in the system file manager, and MaixVision clicks `Open folder/project` to open this empty folder.
64+
* 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`
65+
```python
66+
def say_hello():
67+
print("hello from module a")
68+
```
69+
* Reference in `main.py`
70+
```python
71+
from a import say_hello
72+
say_hello()
73+
```
74+
* 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.
75+
* 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.
76+
5577

5678
## Calculating the Image Histogram
5779

docs/doc/en/faq.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,9 @@ Here, the `model` is specified as the `yolov5s_224_int8.cvimodel` file relative
130130

131131
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).
132132

133+
## MaixVision how to import from another .py file
134+
135+
Read documentation of [MaixVision](./basic/maixvision.md) carefully.
133136

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

docs/doc/zh/basic/maixvision.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ while 1:
4141

4242

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

58+
另外,除了 MaixPy 软件包,其它的代码提示,比如 `numpy/opencv` 都同样的需要在电脑也安装一份来实现代码提示。
59+
60+
## 单文件和项目(多个 py 文件项目/模块化)
61+
62+
在编写代码时,一般两种模式,执行单个文件,或者执行一个完成项目(包含多个 py 文件或者其它资源文件)。
63+
* **单文件模式**:MaixVision 创建或者打开一个 `.py`格式的文件,编辑后点击左下角运行即可执行代码。
64+
* **项目(多文件)模式**
65+
* 在系统文件管理器创建一个空文件夹,MaixVision 点击`打开文件夹/项目`打开这个空文件夹。
66+
* 创建一个`main.py`的主程序入口(名字必须是`main.py`),如果`main.py`想引用其它`.py`文件,在项目文件夹下建立一个`.py`文件比如`a.py`
67+
```python
68+
def say_hello():
69+
print("hello from module a")
70+
```
71+
*`main.py` 中引用
72+
```python
73+
from a import say_hello
74+
say_hello()
75+
```
76+
* 运行项目,点击左下角`运行项目`按钮将整个项目自动打包发送到设备中运行。
77+
* 如果你打开了一个文件夹/项目,仍想单独运行某个文件,可以打开想要运行的文件,然后点击左下角`运行当前文件`只发送当前文件到设备运行,注意不会发送其它文件到设备,所以不要引用其它`.py`文件。
78+
5779

5880
## 计算图像的直方图
5981

docs/doc/zh/faq.md

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

136+
## MaixVision 如何编写多个文件,一个文件导入另一个文件的代码
137+
138+
仔细阅读 [MaixVision 使用文档](./basic/maixvision.md)
139+
140+
136141
## MaixCAM 启动非常缓慢,甚至超过了 1 分钟,或者屏幕在闪动
137142

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

0 commit comments

Comments
 (0)