Skip to content

Commit

Permalink
fix generate api doc error
Browse files Browse the repository at this point in the history
  • Loading branch information
Neutree committed May 8, 2024
1 parent ae8ea34 commit 6781d07
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 5 deletions.
17 changes: 14 additions & 3 deletions components/maix/gen_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,16 +86,27 @@ def parse_module(pyi_path, k, v):
print(f"[WARN] can not find {pyi_path}, you can build for linux platform first to generate this file")
return
items = parse_pyi(pyi_path)
for m_k, m_v in v["members"].items():
if v["type"] == "func":
name = v["name"]
func_def = find_func_def(items["func"], name)
if func_def:
v["py_def"] = func_def.replace("maix._maix", "maix")
elif v["type"] == "class":
for mc_k, mc_v in v["members"].items():
if mc_v["type"] == "func":
func_def = find_class_func_def(items, k, mc_k, False)
if func_def:
mc_v["py_def"] = func_def.replace("maix._maix", "maix")
for m_k, m_v in v.get("members", {}).items():
if m_v["type"] == "func":
name = m_v["name"]
func_def = find_func_def(items, name)
func_def = find_func_def(items["func"], name)
if func_def:
m_v["py_def"] = func_def.replace("maix._maix", "maix")
elif m_v["type"] == "class":
for mc_k, mc_v in m_v["members"].items():
if mc_v["type"] == "func":
func_def = find_class_func_def(items, m_k, mc_k, m_v["name"] == "Tensors")
func_def = find_class_func_def(items, m_k, mc_k, False)
if func_def:
mc_v["py_def"] = func_def.replace("maix._maix", "maix")
module_dir = os.path.join(maix_pyi_root, k)
Expand Down
16 changes: 15 additions & 1 deletion docs/doc/en/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ title: MaixPy FAQ (Frequently Asked Questions)
This page lists common questions and solutions related to MaixPy. If you encounter any issues, please search for answers here first.
If you cannot find an answer on this page, you can post your question with detailed steps on the [MaixHub Discussion Forum](https://maixhub.com/discussion).

If you use MaixCAM, you can also refer to [MaixCAM FAQ](https://wiki.sipeed.com/hardware/zh/maixcam/faq.html)

## MaixVision cannot find the device?

First, confirm whether the connection method is WiFi or USB cable.
Expand Down Expand Up @@ -51,4 +53,16 @@ However, if you are an expert, we welcome you to submit a pull request!
Failure to parse the model file is generally caused by file corruption. Ensure that your model file is not damaged. For example:
* If it was downloaded from the internet, make sure the download was not corrupted. Typically, files on the internet provide sha256sum/md5 checksums. After downloading, you can compare these values; for specific methods, please search online or ask ChatGPT.
* If it comes from a compressed archive, ensure that the decompression process was error-free. You can decompress the archive again to make sure there were no errors in the process.
* Ensure that the file was not damaged during the transfer to the device. You can compare the sha256sum values of the file on the device and on your computer; for specific methods, please search online or ask ChatGPT.
* Ensure that the file was not damaged during the transfer to the device. You can compare the sha256sum values of the file on the device and on your computer; for specific methods, please search online or ask ChatGPT.


## Power-on Black Screen, No Display on the Screen

* Check if the TF (micro-SD) card is installed.
* Check if the latest system image is burned onto the TF card (strongly recommended to update to the latest system image); see documentation for specific burning methods.
* Check if the TF card is fully inserted into the TF card slot, ensuring there are no gaps and it is not loose.
* Check if the screen and camera ribbon cables are correctly and securely connected; there should be no looseness.
* Check if the power LED (red light) and the system operation status LED (blue light) on the board are lit. If the red light is off, consider hardware issues such as no power supply, insufficient power supply, or a damaged board.
* Connect the board to a computer using a USB to TTL cable, open the serial port assistant on the computer, restart the board, and check the boot logs for any errors.
> If there is no log output, try swapping the TX and RX wires. For MaixCAM, the orientation of the Type-C to serial port adapter may vary, and TX RX might be reversed, meaning it does not support reversible plugging.
12 changes: 11 additions & 1 deletion docs/doc/zh/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ title: MaixPy FAQ(常见问题)
此页面列出了 MaixPy 相关的常见问题和解决方案,如果你遇到了问题,请先在这里找寻答案。
如果这个页面找不到答案,可以到 [MaixHub 讨论版块](https://maixhub.com/discussion) 将问题的详细步骤发贴提问。

如果你使用的是 MaixCAM, 也可以参考 [MaixCAM FAQ](https://wiki.sipeed.com/hardware/zh/maixcam/faq.html)

## MaixVision 无法搜索到设备?

先确认连接方式是 WiFi 还是 USB 线,
Expand Down Expand Up @@ -48,7 +50,6 @@ MaixPy 目前仅支持 MaixCAM 系列板子,其它同款芯片的板子也不
当然,如果你是大佬,我们也欢迎你提交 PR!



## 运行模型报错 cvimodel built for xxxcv181x CANNOT run on platform cv181x

解析模型文件失败了,一般情况是模型文件损坏造成的,确保你的模型文件是没有损坏的。
Expand All @@ -57,3 +58,12 @@ MaixPy 目前仅支持 MaixCAM 系列板子,其它同款芯片的板子也不
* 如果是来自压缩包,请确认解压过程没有出错,可以从压缩包重新解压一遍保证中间没有出错。
* 保证传输到设备的过程没有造成文件损坏,可以对比一下设备中的文件和电脑中的文件 sha256sum 值,具体方法请自性搜索或者问 ChatGPT。

## 上电启动黑屏,屏幕无显示

* 检查是否安装了 TF(micro-SD)卡。
* 检查 TF 卡里面是否烧录了最新的系统镜像(强烈推荐烧录到最新的系统镜像),具体烧录方法看文档。
* 检查 TF 卡是否完全插进到了 TF 卡口,确保没有缝隙和松动。
* 检查屏幕和摄像头排线是否正确扣紧了,不能出现松动现象。
* 检查板子上的电源灯(红灯)以及系统运行状态灯(蓝灯)是否亮起,如果红灯不亮则考虑硬件问题,比如无供电或者供电不足或者板子烧坏了。
* 用 USB 转 TTL 连接电脑和板子的串口,电脑打开串口助手,让板子重启,查看启动日志里面是否有报错。
> 如果没有日志输出,可以尝试交换一下 TX 和 RX 接线, 对于 MaixCAM, Type-C 转 串口小板插的方向不一样 TX RX 可能反向,即不支持正反插。

0 comments on commit 6781d07

Please sign in to comment.