Giter Club home page Giter Club logo

maixpy3's Introduction

MaixPy3 Logo

This repository is DEPRECATED !

But you can remain use this repo for Sipeed Maix-II-Dock(v831) board.

Now we recommend to use Sipeed/MaixPy and new hardware platform, more info visit it.

MaixPy3 GitHub forks GitHub stars GitHub watchers

MIT PyPI version Python issue

MaixPy3 is a Python3 toolkit based on cpython, which simplifies the development of applications on Linux AI edge devices through Python programming.

Support Jupyter Environment

Install rpyc_ikernel kernel in jupyter notebook & lab to get an IDE that can remotely call Python code, videos, and image streaming.

index.png

Installation

  • ready linux ubuntu20.04 desktop
sudo apt update && sudo apt install libjpeg-dev gcc libopencv-dev -qq -y && wget http://mirrors.kernel.org/ubuntu/pool/main/libf/libffi/libffi6_3.2.1-8_amd64.deb && sudo apt install ./libffi6_3.2.1-8_amd64.deb -qq -y

python3 -m pip install pybind11 maixpy3
  • run this python code
from maix import camera, display
display.show(camera.capture().draw_string(0, 0, "hello world!"))

uasge.png

Develop

Under linux x86_64, use python3 setup.py build && python3 -m pip install . to complete the linux package construction. If you need .whl pre-compiled package, please change build to bdist_wheel. For other platforms, take the version of maix_v83x as an example, match the Python3 + cross-compilation chain of the corresponding platform, and run python3.8 setup.py build maix_v83x to complete the construction of the target platform package.

Welcome to provide configurations of different platforms to MaixPy3/envs/ to adapt to the MaixPy3 environment.

Platform Status Config Progress Toolchain
linux_pc & RPi_2B working linux_desktop 70% develop.md & maixpy3_build.yml
maix_v83x working maix_v83x 99% v83x_linux_x86_python3.8_toolchain
maix_r329 working maix_r329 99% r329_linux_x86_python3.9_toolchain

License

Copyright (c) Sipeed Corporation. All rights reserved.

Licensed under the MIT license.

maixpy3's People

Contributors

adancurusul avatar dianjixz avatar jasperg1998 avatar junhuanchen avatar neutree avatar yanxingliu avatar znstj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

maixpy3's Issues

Access direct camera Image - sp2305_mipi

Hi I wonder if you can help me.

I have an IP camera (Yi Y20GA) that uses the same image sensor used in https://www.seeedstudio.com/Sipeed-MAIX-Dock-p-4815.html.
I'm trying to access her, but I found last information about her.

I was able to compile the framework: https://github.com/lindenis-org/lindenis-v536-softwinner/

But I can not make it work with this sensor

I get this error:

[ISP]cannot find sp2305_mipi_1936_1096_20_0 isp config!!!
....
[CAMERA_ERR] select timeout,end capture thread!

Full log:

[CAMERA] Using format parameters LBC_2_5X.
[CAMERA] camera pixelformat: LBC_2_5X
[CAMERA] Resolution size : 1936 * 1096
[CAMERA] The photo save path is /tmp.
[CAMERA] The number of photos taken is 5.
[CAMERA] Camera capture framerate is 20/1
[CAMERA] VIDIOC_S_FMT succeed
[CAMERA] fmt.type = 9
[CAMERA] fmt.fmt.pix_mp.width = 1936
[CAMERA] fmt.fmt.pix_mp.height = 1096
[CAMERA] fmt.fmt.pix_mp.pixelformat = LBC_2_5X
[CAMERA] fmt.fmt.pix_mp.field = 1
[CAMERA_DEBUG] reqbuf number is 3
[CAMERA_DEBUG] map buffer index: 0, mem: 0xb69ff000, len: 145600, offset: 0
[CAMERA_DEBUG] map buffer index: 1, mem: 0xb68b9000, len: 145600, offset: 146000
[CAMERA_DEBUG] map buffer index: 2, mem: 0xb6773000, len: 145600, offset: 28c000
[CAMERA] stream on succeed
[ISP]video device name is vin_video0
cutils:D/AWIspApi: F:awIspGetIspId, L:48, video0 --> isp0
>>>>>>>>>>>>>>>>>>>> ISP VERSION INFO <<<<<<<<<<<<<<<<<<<
[ISP]version:V1.00
[ISP]tag   : isp-500-520-v2.00
[ISP]branch: a50_merge
[ISP]commit: 924456a4a4b18b614a8273f282b25ad4ee59f417
[ISP]date  : Tue Feb 12 17:03:31 2019 +0800
[ISP]author: zhengjiangwei
--------------------------------------------------------

[ISP]register sensor entity is sp2305_mipi
[ISP]open isp device[0] success!
[ISP_WARN]open /mnt/isp0_ctx_saved.bin success!!!
[ISP]cannot find sp2305_mipi_1936_1096_20_0 isp config!!!
[ISP]use default isp config.
[ISP]create isp0 server thread!
[CAMERA] capture num is [0]
[CAMERA_ERR] select timeout,end capture thread!
[CAMERA] Capture thread finish
[CAMERA_DEBUG]***************************************************************
[CAMERA_DEBUG] Query the actual frame rate.
 select timeout, measure the frame rate failed
[CAMERA_DEBUG] camera fps = 0.0.
[CAMERA_DEBUG]***************************************************************
[ISP_ERR] func: events_loop, line: 162,isp0 event select timeout
[ISP_WARN]open /mnt/isp0_ctx_saved.bin success!!!
[CAMERA] close /dev/video0
[CAMERA_ERR] capture_photo return error

I tried all the formats you have in the example

./camerademo YUV422P 1936 1096 0 bmp /tmp 5 debug
./camerademo YUV420 1936 1096 0 bmp /tmp 5 debug
./camerademo YVU420 1936 1096 0 bmp /tmp 5 debug
./camerademo NV16 1936 1096 0 bmp /tmp 5 debug
./camerademo NV12 1936 1096 0 bmp /tmp 5 debug
./camerademo NV61 1936 1096 0 bmp /tmp 5 debug
./camerademo NV21 1936 1096 0 bmp /tmp 5 debug
./camerademo HM12 1936 1096 0 bmp /tmp 5 debug
./camerademo YUYV 1936 1096 0 bmp /tmp 5 debug
./camerademo YVYU 1936 1096 0 bmp /tmp 5 debug
./camerademo UYVY 1936 1096 0 bmp /tmp 5 debug
./camerademo VYUY 1936 1096 0 bmp /tmp 5 debug
./camerademo BA81 1936 1096 0 bmp /tmp 5 debug
./camerademo GBRG 1936 1096 0 bmp /tmp 5 debug
./camerademo GRBG 1936 1096 0 bmp /tmp 5 debug
./camerademo RGGB 1936 1096 0 bmp /tmp 5 debug
./camerademo BG10 1936 1096 0 bmp /tmp 5 debug
./camerademo GB10 1936 1096 0 bmp /tmp 5 debug
./camerademo BA10 1936 1096 0 bmp /tmp 5 debug
./camerademo RG10 1936 1096 0 bmp /tmp 5 debug
./camerademo BG12 1936 1096 0 bmp /tmp 5 debug
./camerademo GB12 1936 1096 0 bmp /tmp 5 debug
./camerademo BA12 1936 1096 0 bmp /tmp 5 debug
./camerademo RG12 1936 1096 0 bmp /tmp 5 debug
./camerademo MJPEG 1936 1096 0 bmp /tmp 5 debug
./camerademo H264 1936 1096 0 bmp /tmp 5 debug

Run on PC without Webcam

If I run maixpy3 scripts on a LinuxVM (docker) without a webcam available, it fails badly. It should be possible to at least
import the modules. Nice to have would be that only features that need the hardware are switched off.

This will enable developing Python scripts that depend on maix, and run CI builds.

[display] tips: os.environ(export) not _MAIX_WIDTH_ or _MAIX_HEIGHT_.
[ WARN:0] global /io/opencv/modules/videoio/src/cap_v4l.cpp (802) open VIDEOIO ERROR: V4L: can't open camera by index 0
assets path= /MaixPy3/home/occi/assets - reactions path= /MaixPy3/home/occi/reactions
Traceback (most recent call last):
  File "main.py", line 19, in <module>
    import occi_default
  File "/MaixPy3/home/occi_default/__init__.py", line 3, in <module>
    from maix import nn
  File "/opt/conda/lib/python3.7/site-packages/maix/nn.py", line 1, in <module>
    from _maix_nn import *
ModuleNotFoundError: No module named '_maix_nn'

Convert to AWNN

I trained a custom yoloV2 detector with 2 classes using the tools provided in this repository, but I've to modify the input size of the image to 416x416 to get better results for one of the classes during the training. Then I used the export.py script to convert my file into ONNX, which according to the logs reported it was built successfully, the same script also convert my file from ONNX to NCNN, which according and gave me two files (.bin and .param). For some reason when I uploaded my files to the AWNN online converter tool I got the following error. The error is caused because when the input size of the image?

image

Here is a description of what my .param file looks and the structure of the folder I'm trying to upload to the converter.

image

28 28
Input            input0                   0 1 input0 0=416 1=416 2=3
Convolution      Conv_0                   1 1 input0 148 0=32 1=3 11=3 2=1 12=1 3=1 13=1 4=1 14=1 15=1 16=1 5=1 6=864
ReLU             LeakyRelu_1              1 1 148 110 0=1.000000e-01
Convolution      Conv_2                   1 1 110 151 0=32 1=3 11=3 2=1 12=1 3=2 13=2 4=1 14=1 15=1 16=1 5=1 6=9216
ReLU             LeakyRelu_3              1 1 151 113 0=1.000000e-01
Convolution      Conv_4                   1 1 113 154 0=64 1=3 11=3 2=1 12=1 3=1 13=1 4=1 14=1 15=1 16=1 5=1 6=18432
ReLU             LeakyRelu_5              1 1 154 116 0=1.000000e-01
Convolution      Conv_6                   1 1 116 157 0=64 1=3 11=3 2=1 12=1 3=2 13=2 4=1 14=1 15=1 16=1 5=1 6=36864
ReLU             LeakyRelu_7              1 1 157 119 0=1.000000e-01
Convolution      Conv_8                   1 1 119 160 0=128 1=3 11=3 2=1 12=1 3=1 13=1 4=1 14=1 15=1 16=1 5=1 6=73728
ReLU             LeakyRelu_9              1 1 160 122 0=1.000000e-01
Convolution      Conv_10                  1 1 122 163 0=128 1=3 11=3 2=1 12=1 3=2 13=2 4=1 14=1 15=1 16=1 5=1 6=147456
ReLU             LeakyRelu_11             1 1 163 125 0=1.000000e-01
Convolution      Conv_12                  1 1 125 166 0=256 1=3 11=3 2=1 12=1 3=1 13=1 4=1 14=1 15=1 16=1 5=1 6=294912
ReLU             LeakyRelu_13             1 1 166 128 0=1.000000e-01
Convolution      Conv_14                  1 1 128 169 0=256 1=3 11=3 2=1 12=1 3=2 13=2 4=1 14=1 15=1 16=1 5=1 6=589824
ReLU             LeakyRelu_15             1 1 169 131 0=1.000000e-01
Convolution      Conv_16                  1 1 131 172 0=512 1=3 11=3 2=1 12=1 3=1 13=1 4=1 14=1 15=1 16=1 5=1 6=1179648
ReLU             LeakyRelu_17             1 1 172 134 0=1.000000e-01	
Convolution      Conv_18                  1 1 134 175 0=512 1=3 11=3 2=1 12=1 3=2 13=2 4=1 14=1 15=1 16=1 5=1 6=2359296
ReLU             LeakyRelu_19             1 1 175 137 0=1.000000e-01
Convolution      Conv_20                  1 1 137 178 0=512 1=3 11=3 2=1 12=1 3=1 13=1 4=1 14=1 15=1 16=1 5=1 6=2359296
ReLU             LeakyRelu_21             1 1 178 140 0=1.000000e-01
Convolution      Conv_22                  1 1 140 181 0=512 1=3 11=3 2=1 12=1 3=1 13=1 4=1 14=1 15=1 16=1 5=1 6=2359296
ReLU             LeakyRelu_23             1 1 181 143 0=1.000000e-01
Convolution      Conv_24                  1 1 143 184 0=512 1=3 11=3 2=1 12=1 3=1 13=1 4=1 14=1 15=1 16=1 5=1 6=2359296
ReLU             LeakyRelu_25             1 1 184 146 0=1.000000e-01
Convolution      Conv_26                  1 1 146 output0 0=35 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=17920```

Input image size greater than 224

Hello,

I could follow successfully the Slim YoloV2 tutorial and deploy a model with my custom data on the V831 board. However, the results where not as expected, so I proceed to increase the input size of my model to 320x320, I was able to convert the model to the format can be deployed on the board but when I tried to run my program on it with the new model, it gave me core dumped. I was wondering if it is actually possible to deploy models with input image size greater than 224x224 or to deploy other models such as TiniYolo V3 on V831 board. Thanks for the help

How to expand the OS disk on the SD card on Maix-II ?

Hi All,
我使用目前的鏡像版本 "maixpy3-0.3.5_MaixII-Dock_20211216.img",
由於其根目錄僅有254.5M的大小, 所以參考底下這篇說明想試著擴增到2G:
https://www.cnblogs.com/USTHzhanglu/p/15207336.html

   但也僅能擴增到381.8M, 雖然可以開機, 但並沒有成功完成擴增, 底下是操作過程紀錄,
   可以給一些建議嗎? 感謝。

新年快樂
-chayi

BusyBox v1.27.2 () built-in shell (ash)

------run profile file-----


/ |/ /__ ()_ __ / / ()__ __ ____ __
/ /|
/ / _ `/ /\ \ / / /__/ / _ / // /\ \ /
// //_,///_\ //////_,//_\

root@sipeed:/# [framebuffer](240,240, 24bpp)

root@sipeed:/# fdisk -l

Disk /dev/mmcblk0: 29.1 GiB, 31266439168 bytes, 61067264 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: AB6F3888-569A-4926-9668-80941DCB40BC

Device Start End Sectors Size Type
/dev/mmcblk0p1 49152 49663 512 256K Microsoft basic data
/dev/mmcblk0p2 49664 54159 4496 2.2M Microsoft basic data
/dev/mmcblk0p3 54160 578447 524288 256M Microsoft basic data
/dev/mmcblk0p4 578448 609167 30720 15M Microsoft basic data
/dev/mmcblk0p5 609168 61067230 60458063 28.8G Microsoft basic data

root@sipeed:/# df -h
Filesystem Size Used Available Use% Mounted on
/dev/root 254.5M 147.8M 101.6M 59% /
tmpfs 29.4M 16.0K 29.4M 0% /tmp
none 29.3M 0 29.3M 0% /dev
/dev/mmcblk0p5 28.8G 48.0K 28.8G 0% /mnt/UDISK
/dev/mmcblk0p5 28.8G 48.0K 28.8G 0% /root
root@sipeed:/# fdisk /dev/mmcblk0

Welcome to fdisk (util-linux 2.25.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Command (m for help): d
Partition number (1-5, default 5): 3

Partition 3 has been deleted.

Command (m for help): d
Partition number (1,2,4,5, default 5): 4

Partition 4 has been deleted.

Command (m for help): d
Partition number (1,2,5, default 5): 5

Partition 5 has been deleted.

Command (m for help): n
Partition number (3-5, default 3): 3
First sector (54160-61067230, default 55296): 54160
Last sector, +sectors or +size{K,M,G,T,P} (54160-61067230, default 61067230): +2G

Created a new partition 3 of type 'Linux filesystem' and of size 2 GiB.

Command (m for help): n
Partition number (4,5, default 4): 4
First sector (4247552-61067230, default 4247552):
Last sector, +sectors or +size{K,M,G,T,P} (4247552-61067230, default 61067230): +1G

Created a new partition 4 of type 'Linux filesystem' and of size 1 GiB.

Command (m for help): n
Selected partition 5
First sector (6344704-61067230, default 6344704):
Last sector, +sectors or +size{K,M,G,T,P} (6344704-61067230, default 61067230):

Created a new partition 5 of type 'Linux filesystem' and of size 26.1 GiB.

Command (m for help): x

Expert command (m for help): n
Partition number (1-5, default 5): 3

New name: rootfs

Partition name changed from '' to 'rootfs'.

Expert command (m for help): n
Partition number (1-5, default 5): 4

New name: swap

Partition name changed from '' to 'swap'.

Expert command (m for help): n
Partition number (1-5, default 5): 5

New name: UDISK

Partition name changed from '' to 'UDISK'.

Expert command (m for help): r

Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Re-reading the partition table failed.: Resource busy

The kernel still uses the old table. The new table will be used at the next reboot or after you run partprobe(8) or kpartx(8).

root@sipeed:/# reboot
root@sipeed:/# Stopping ntpd: done
Stop dropbear: OK
Stopping telnetd: start-stop-daemon: warning: killing process 840: No such process
FAIL
Stopping network...
Saving random seed... done.
disable android usb
sh: write error: No such device
Stopping app...
killall: python3: no process killed
Stopping logging: OK
save /etc/asound.conf ...
Unload mpp modules
module is not loaded
module is not loaded
module is not loaded
umount: none busy - remounted read-only
The system is going down NOW!
Sent SIGTERM to all processes
Sen[30]HELLO! BOOT0 is starting!
[32]BOOT0 commit : e3b2a9e
[35]board init start
[37]set pll start
[40]set pll end
[41][pmu]: bus read error
[44][pmu]: bus read error
[46]board init ok
[48]chip id check OK
[50]DRAM BOOT DRIVE INFO: V0.41
[53]DRAM CLK = 528 MHz
[55]DRAM Type = 2 (2:DDR2,3:DDR3)
[59]DRAMC read ODT off.
[61]DRAM ODT off.
[63]DRAM SIZE =64 M
[70]DRAM simple test OK.
[72]rtc standby flag is 0x0, super standby flag is 0x0
[77]dram size =64
MESSAGE: [0x0] TEE-CORE: OP-TEE version: sun8iw19p1_v0.6.0-14-gf6954e7 #1 2019年 11月 21日 星期四 01:34:42 UTC arm
ERROR: [0x0] TEE-CORE:platform_standby_fdt_parse:126: no pmu node
ERROR: [0x0] TEE-CORE:sunxi_twi_parse_from_dt:84: no pmu node
------run rc.preboot file-----
setup console
fbv - The Framebuffer Viewer
/home/res/logo.png
140 x 140
swapon: /dev/mmcblk0p4: Invalid argument
Setting up swapspace version 1, size = 1073737728 bytes
------run rc.modules file-----
------run rc.final file-----
Load mpp modules
insmod: can't insert '/lib/modules/4.9.118/videobuf2-core.ko': No such file or directory
insmod: can't insert '/lib/modules/4.9.118/videobuf2-memops.ko': No such file or directory
insmod: can't insert '/lib/modules/4.9.118/videobuf2-v4l2.ko': No such file or directory
load /etc/asound.conf ...
alsactl: set_control:1461: Cannot write control '2:0:0:codec trigger playback time value:0' : Operation not permitted
alsactl: set_control:1461: Cannot write control '2:0:0:codec trigger capture time value:0' : Operation not permitted
Starting app...
enable android usb
Initializing random number generator... done.
Starting network...
Starting telnetd: OK
Start dropbear: OK
Starting ntpd: done

BusyBox v1.27.2 () built-in shell (ash)

------run profile file-----


/ |/ /__ ()_ __ / / ()__ __ ____ __
/ /|
/ / _ `/ /\ \ / / /__/ / _ / // /\ \ /
// //_,///_\ //////_,//_\

root@sipeed:/# [framebuffer](240,240, 24bpp)

root@sipeed:/# df -h
Filesystem Size Used Available Use% Mounted on
/dev/root 254.5M 147.8M 101.6M 59% /
tmpfs 29.4M 16.0K 29.4M 0% /tmp
none 29.3M 0 29.3M 0% /dev
/dev/mmcblk0p5 26.1G 48.0K 26.1G 0% /mnt/UDISK
/dev/mmcblk0p5 26.1G 48.0K 26.1G 0% /root
root@sipeed:/# fdisk -l

Disk /dev/mmcblk0: 29.1 GiB, 31266439168 bytes, 61067264 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: AB6F3888-569A-4926-9668-80941DCB40BC

Device Start End Sectors Size Type
/dev/mmcblk0p1 49152 49663 512 256K Microsoft basic data
/dev/mmcblk0p2 49664 54159 4496 2.2M Microsoft basic data
/dev/mmcblk0p3 54160 4247551 4193392 2G Linux filesystem
/dev/mmcblk0p4 4247552 6344703 2097152 1G Linux filesystem
/dev/mmcblk0p5 6344704 61067230 54722527 26.1G Linux filesystem

root@sipeed:/# resize2fs /dev/root
resize2fs 1.42.12 (29-Aug-2014)
Filesystem at /dev/root is mounted on /; on-line resizing required
old_desc_blocks = 1, new_desc_blocks = 1
resize2fs: Invalid argument While checking for on-line resizing support
root@sipeed:/# fdisk -l

Disk /dev/mmcblk0: 29.1 GiB, 31266439168 bytes, 61067264 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: AB6F3888-569A-4926-9668-80941DCB40BC

Device Start End Sectors Size Type
/dev/mmcblk0p1 49152 49663 512 256K Microsoft basic data
/dev/mmcblk0p2 49664 54159 4496 2.2M Microsoft basic data
/dev/mmcblk0p3 54160 4247551 4193392 2G Linux filesystem
/dev/mmcblk0p4 4247552 6344703 2097152 1G Linux filesystem
/dev/mmcblk0p5 6344704 61067230 54722527 26.1G Linux filesystem

root@sipeed:/# df -h
Filesystem Size Used Available Use% Mounted on
/dev/root 381.8M 147.8M 228.8M 39% /
tmpfs 29.4M 16.0K 29.4M 0% /tmp
none 29.3M 0 29.3M 0% /dev
/dev/mmcblk0p5 26.1G 48.0K 26.1G 0% /mnt/UDISK
/dev/mmcblk0p5 26.1G 48.0K 26.1G 0% /root
root@sipeed:/#

How to install openCV on Maix-II

Hello I would like to use openCV for testing some Haar Classifiers and for extracting some frames of a video for analyze them. I tried to install opencv with PIP but it gaves me the following error: ERROR: Could not install packages due to an OSError: [Errno 28] No space left on device

Then I install it using opkg and it's installed. However, when I tried to import it througs an error. Is there a chance to use Open-CV on this board?

imagen

How to view logs

I have a v831 and running models always get killed,how to view logs

Jupiter Code runs only once

Right after launching the code runs OK and that is all.
All subsequent attempts gives attached messages until next total relaunch.
Bug

Can't connect tho MaixII through SSH or FTP

I was trying to conect to my board via SSH and FTP but so far I have not suceed.

My device is using the 20210401 image. I was able to configure everything and when I restart the decive it provides me the IP addres. I was trying to ping this addres from a nother PC connected to the same network but as you can see it says that the destination host is unreachable. On my board I'm able to ping websites just to make sure that the board has connectivity.

For both attempts I'm using the ports specified in this guide: https://maixpy.sipeed.com/maixpy3/zh/tools/mobaxterm.html

imagen
imagen
imagen
imagen

How to use MaixPy3 nn to load custom models

I have some problem with understanding how to use own models with MaixPy3 nn on Sipeed MAIX-II Dock(V831). In your example scripts is presented resnet model, and it works well. I want to load into sipeed other cnn model, for example yolo3 or mobilenet_ssd for object detection and some other models, that have different formats of popular frameworks( tflite, keras h5, tensorflow pb). In your example model is presented via 2 files: resnet.bin and resnet.param. How can i convert my files of models (h5, or pb, or tflite) into this representation to load with nn lib? Maybe there are some open-source scripts for this purpose? I cant find some way(scripts) to create resnet.param. In this file was written some params, that i dont understand.
I will be glad your feedback!

Cannot get Image over RPYc

I'm trying out usage_display.ipynb. I got a message about calling config() so I added that, but I have only gotten a black image so far. That is on one device, on another only connected over WiFi it works.

import time 
last_time = time.time()

from maix import display, camera
from PIL import Image, ImageDraw

camera.config(size=(224,224))
display.local_show(False)
display.hook(clear_output=True)

while True:
    im = camera.capture()
    if im:
        draw = ImageDraw.Draw(im)
        last_time = time.time()
        draw.text((10, 10), str((1000 // (1000 * (time.time() - last_time)))), (255, 0, 0))
        display.show(im)

I got the log by connecting over UART

[ISP]open isp device[0] success!
[ISP_WARN]sdcard is not mounted!!!
[ISP]find sp2305_mipi_1920_1080_20_0 [sp2305_mipi_day_isp_cfg] isp config
[ISP]create isp0 server thread!
E0424 20:09:34.905745   938 mpi_vi.c:1099]                  <AW_MPI_VI_EnableVirChn> vichn[0] is unexist!!
E0424 20:09:34.906031   938 mpi_vi.c:1157]                  <AW_MPI_VI_GetFrame> vichn[0] is unexist!!
fatal, dev = 0  chn = 0 GetFrame Failed!E0424 20:09:34.926403   938 mpi_vi.c:1124] <AW_MPI_VI_DisableVirChn> vichn[0!
W0424 20:09:34.926692   938 mpi_vi.c:999]                   <AW_MPI_VI_DestoryVirChn> vichn[0] is unexist!!
[ISP_ERR]videoInputHw_ChnDisable, line: 821,VIN CH[0] number is invalid!
E0424 20:09:34.926868   938 mpi_vi.c:1124]                  <AW_MPI_VI_DisableVirChn> vichn[0] is unexist!!
W0424 20:09:34.926987   938 mpi_vi.c:999]                   <AW_MPI_VI_DestoryVirChn> vichn[0] is unexist!!
[ISP_ERR]videoInputHw_ChnDisable, line: 821,VIN CH[1] number is invalid!
fatal, dev = 0  chn = 0 GetFrame Failed!I0424 20:09:35.251147   910 VideoVirVi_Component.c:360] <DoVideoViReturnAllVs
I0424 20:09:35.251675   910 VideoVirVi_Component.c:1077]    <Vi_ComponentThread> wait using frame return done
[ISP_ERR]video_wait_buffer, line: 435,video0 select timeout!
E0424 20:09:36.732013   909 videoInputHw.c:4186]            <VideoInputHw_CapThread> fatal error! vipp[0] get frame !
[ISP_ERR]video_wait_buffer, line: 435,video1 select timeout!
E0424 20:09:36.732515   911 videoInputHw.c:4186]            <VideoInputHw_CapThread> fatal error! vipp[1] get frame !
I0424 20:09:36.734416   914 mpi_vi.c:1136]                  <AW_MPI_VI_DisableVirChn> iseGroup comp state[0x2], do n!
I0424 20:09:36.735095   912 VideoVirVi_Component.c:1077]    <Vi_ComponentThread> wait using frame return done
[ISP_ERR]events_loop, line: 162,isp0 event select timeout
[ISP_ERR]events_loop, line: 162,isp0 event select timeout
[ISP_ERR]video_wait_buffer, line: 435,video1 select timeout!
E0424 20:09:38.735074   911 videoInputHw.c:4186]            <VideoInputHw_CapThread> fatal error! vipp[1] get frame !

How to use MaixPy3 nn to test Yolov2 script

I have a problem with understanding how to use example models yolov2 with MaixPy3 nn on Sipeed MAIX-II Dock V831.

In the MaixPy3_scripts example applications presented here there is a yolov2 model with the .bin and .param files and an example script to test completed. Which is very cool.

So I want to load that example into sipeed v831 board for object detection. So I transfer over the files to my board via the microSD card and moved it to /home/res and I change the directories and permissions in the file and try and run it but I am getting an error when running it:

ImportError: cannot import name 'decoder' from 'maix.nn' (/usr/lib/python3.8/site-packages/maix/nn.pyc)

In the readme for ../MaixPy3_scripts/ it says (google translated):

"When using the scripts in scripts, please install some resource files in basic first. The resource files that scripts depend on are concentrated in basic/res, and they should be copied to v831 before running!"

But I can't find basic/res to install the resource files and cant find a tutorial or help anywhere on how to get that going. Any help will be appreciated in finding a location or a tutorial or just some help in setting it up. My goal is to get an example yolov2 running object detection so that I can see how it performs and eventually try and build my own yolov2 model and maybe even train new algorithms like YoloR or yoloRET for Edge AI.

I will be glad for your feedback!

can Maix-II dock camera be IR sensitive?

Hi, my application requires the Maix-II board to work in complete darkness with IR LEDs. Can Maix-II board be bought without IR filter? If not is there a way to remove it's IR filter?

关于在Maix 2 Dock上播放视频的方案

想问,能不能播放本地MP4文件,实现思路是怎么样的?
我找到了一个video_stream好像是播放mjpeg的?但我下的视频demo报错,错误如下
frame_length = int(frame_length.decode())
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte

官方大大和热心网友帮个忙,求助一个便捷的播放本地视频的方法,感谢感谢

What's the meaning of mean and norm when use AWNN converter

Hello, I trained an object detector with Yolo and I would like to know how to convert it to AWNN. I was able to convert the .cfg and .weights files to .bin a .para files that belongs to a NCNN. However, I'm confused of the values that I should use for the NCNN to AWNN online converter tool. The input of the images on my yolo network are 320x240 however I don't know how to get the mean and normalization factor.

Using Maix-ii dock’s I2C as slave

Hello, I wanted to know if anyone has figured out how to implement/use the I2C in maixpy3 as a slave rather than master. I have looked through the pylibi2c module but haven’t been able to find a definitive answer. Would love to hear if there are any planned updates to maixpy3 that might implement this or ways to implement it myself.

Missing build recipe documentation

Please document

  1. Setup build + test environment on Debian/Ubuntu PC
  2. Packages needed on embedded devices OpenWRT
  • Define a Dockerfile for Continuous Integration / Testing

Record a video

Hi, i tryed to record a video with the sample in the website, but it doesn't work https://wiki.sipeed.com/soft/maixpy3/zh/usage/Audio/play_mp4.html.

I use chatgpt to create this code, but i receive the below error an i don't know how to solve it.

Can anyone share with me the right code to record a video? Thanks

import av
from maix import camera, image
import numpy as np

# Impostazioni per la registrazione video
output_filename = '/root/output_video.mp4'
frame_width = 640
frame_height = 480
fps = 24

# Configura la fotocamera
camera.config(size=(frame_width,frame_height))

# Configura il codec video
output_options = {
    'format': 'mp4',
    'pix_fmt': 'yuv420p',
    'framerate': fps,
    'bit_rate': 4000000,  # Bit rate desiderato
}

# Apri il file video per la scrittura
output_container = av.open(output_filename, 'w')

# Aggiungi uno stream video al contenitore di output
output_stream = output_container.add_stream('h264', rate=fps)
output_stream.width = frame_width
output_stream.height = frame_height
output_stream.pix_fmt = 'yuv420p'
output_stream.bit_rate = output_options['bit_rate']
output_stream.options = output_options

try:
    # Ciclo di cattura e scrittura dei frame
    while True:
        # Cattura l'immagine dalla fotocamera
        img = camera.capture()
        numpydata  = np.asarray(img)
        # Converte l'immagine in un formato compatibile con av.VideoFrame
        frame = av.VideoFrame.from_ndarray(numpydata , format='rgb8')

        # Scrivi il frame nel contenitore di output
        for packet in output_stream.encode(frame):
            output_container.mux(packet)

finally:
    # Chiudi la fotocamera e il contenitore di output
    camera.close()
    for packet in output_stream.encode():
        output_container.mux(packet)
    output_container.close()

ERROR :


========= Remote Traceback (1) =========
Traceback (most recent call last):
  File "<string>", line 40, in <module>
  File "av/video/frame.pyx", line 414, in av.video.frame.VideoFrame.from_ndarray
  File "av/utils.pyx", line 70, in av.utils.check_ndarray
ValueError: Expected numpy array with dtype `uint8` but got `object`

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/rpyc/core/protocol.py", line 324, in _dispatch_request
  File "/usr/lib/python3.8/site-packages/rpyc/core/protocol.py", line 592, in _handle_call
  File "<string>", line 49, in <module>
  File "av/stream.pyx", line 153, in av.stream.Stream.encode
  File "av/codec/context.pyx", line 482, in av.codec.context.CodecContext.encode
  File "av/codec/context.pyx", line 285, in av.codec.context.CodecContext.open
  File "/usr/lib/python3.8/_collections_abc.py", line 832, in update
TypeError: Argument 'value' has incorrect type (expected str, got int)

How to ask questions?(如何提问?)

Before encountering a problem, please browse (project, community) whether there are related problem feedback records, and then write down the problems, operations, environment, and phenomena you encounter.

  • What's the problem?
  • What did you do? Have a screenshot or code!
  • What system environment are you operating under?
  • What is the discrepancy between the expected phenomenon and the actual phenomenon? (There are pictures and the truth!)

在遇到问题之前,请浏览一下(项目、社区)是否有相关的问题反馈记录,再把你遇到的问题,操作,环境,现象都写下来。

  • 遇到了什么问题?
  • 你做了什么操作?要有截图或代码!
  • 你在什么系统环境下进行的操作?
  • 期望的现象与实际的现象有什么不符?(有图有真相!)

Read datamatrix

Hi, I need to read datamatrix code, but in Image module i can find only this functions find_qrcodes and find_barcodes, did anyone implement datamatrix reader yet?

https://wiki.sipeed.com/soft/maixpy3/zh/api/maix/image.html

I found pylibdmtx library, but i can't install it with opkg install libdmtx , i tryed with pip3 install pylibdmtx but when i run the program i get this error "Unable to find dmtx shared library"

Can anyone help me, please?

image

Allwinner v831 too low confidence on image classification when running resnet18

While working on resnet18, I found some interesting issues.

  1. I custom trained resnet18 using transfer learning techniques for 10 classes. Then tested on my laptop using webcam (webcam is the same as on maix-ii dock board) and it showed good results. If I point webcam at a person, it results "people: 99.9%". Shows max confidence up to 100%.

Then, I converted this model to awnn form and uploaded to allwinner v831. Here is interesting - percentage of confidence was only between 15 - 45% no matter on what object (no threshold set, but anyway starts at around 15%). I tried to change focus of camera, bring the objects closer or further from camera, even showed images, on which the model was trained - it showed only this small range of confidence. But, on laptop, it was showing up to 100% confidence. Exact model, but converted to awnn showed much lower confidence.

  1. Also, I looked at first 5 most confidence scores, first 2-3 objects were showing exact same percentage of confidence (e.g. airplane: 23.45%, car 23.45%, buildings 23.45%, road 3%, pheasant 0.23%). This is so weird, it must not show exactly the same confidence on any of objects.

  2. I tried the model that was provided by allwinner (I run python app.py on therminal) --- just in rare cases it reached up to 70% confidence, but frequently ranged between 10 - 50% (10% threshold).

I could not find any reason for such behavior of resnet18 on allwinner v831, but I am thinking now is - a) either there are some bugs on converter pytorch - awnn OR b) there are bugs on libraries OR c) hardware performance

P.S. I attached link to videos and codes to make my words clearer. https://drive.google.com/drive/folders/17eKPOSqrP54RyBei_gemIOxNq8uV38Uo?usp=sharing

P.S. P.S. if you open sample_output folder, you can see all images of detected "airplanes". But, if you open "airplane.txt" file, you will see first 5 confidence scores of each image. Images are named: class + time + ".jpg". Each row of "airplane.txt" file is
named: time + date + confidence scores. Each row has its corresponding image (match them by time).

ReLU process forward error on Maix-II

我在V831上(Maix-II)测试自己创建的简单神经网络模型时,模型能够正常被转换为awnn模型,但是无法进行 forward,错误信息指向模型中的ReLU操作,将模型中ReLU运算去掉后,模型可以正常推演。

固件版本:v831-m2dock-maixpy3-0.4.7

错误信息:
image

测试用的模型如下,简单的卷积和ReLU的叠加

class TEST_NET(nn.Module):
    def __init__(self):
        super().__init__();
        self.conv1 = nn.Conv2d(3, 8, kernel_size=3, stride=2, padding=1)
        self.conv2 = nn.Conv2d(8, 16, kernel_size=3, stride=1, padding=1)
        self.conv3 = nn.Conv2d(16, 32, kernel_size=3, stride=2, padding=1)
        self.conv4 = nn.Conv2d(32, 32, kernel_size=3, stride=1, padding=1)

    def forward(self, x):
        x = F.relu(self.conv1(x))
        x = F.relu(self.conv2(x))
        x = F.relu(self.conv3(x))
        x = F.relu(self.conv4(x))
        return x

關於v831 pwm輸出頻率

Hi, Sir:

最近入手sipeed maix ii dock, v831,試著使用板子上的3路pwm驅動遙控車
常使用的servo。該種servo的pwm頻率是50Hz。pwm產生為使用maixpy3的pwm
類別,使用示波器量測信號,最靠近的頻率是61Hz,無法再低。

maix ii dock上燒錄的映像檔版本是maixpy3-0.3.5_MaixII-Dock_20211216.img。

附件圖檔中的程式碼是用來測試pwm頻率的設定方式。
15443815005377

excel檔案是紀錄不同period設定量到的pwm頻率。
v831_pwm.xlsx

波形圖檔如下。使用FNIRSI 1013D示波器量測到的波形。
7

請問maixpy3對v831的pwm類別,要怎麼設定才能產生50Hz的pwm信號?
感謝您。

BR, Akio

requests或者mqtt库无法脱机运行

在maxipy0.5上,如果连接Jupyter可以正常使用requests或者mqtt库,但是脱机之后在main.py里相同的代码就无法运行,即使这会使用充电宝供电也不行,使用手机2.4G热点也不可以
image

import requests
from maix import display, image
r = requests.get('https://api.github.com/user', auth=('user', 'pass'))

hello_img = image.Image().new(size = (240, 240), color = (255, 0, 0), mode = "RGB") #创建一张红色背景图
hello_img.draw_string(30, 115, str(r.status_code), scale = 1.0,color = (255, 255, 255), thickness = 1) #在红色背景图上写下hello world
display.show(hello_img)

Detach camera from display dependency (v831)

I was able to successfully run an old version of MaixPy3 on a generic IP camera (v831).
However, the new versions of the library (camera) seem to be strongly coupled to the need to have a display.

It would be interesting to have some parameter in cam.config(size, display=True), which would serve to activate or not the display.

from maix import camera
camera.config(size=(640, 480), display=False)

fatal error: imlib.h: No such file or directory

I try to build the project for maix_v83x.

After cloning and submodule init, following the instructions in readme, I get the following error

/opt/v83x_linux_x86_python3.8_toolchain/toolchain-sunxi-musl/toolchain/bin/arm-openwrt-linux-muslgnueabi-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -O2 -I/home/dls/v83x/sdk/out/host/include -I/home/dls/v83x/sdk/out/host/usr/include -I/home/dls/v83x/sdk/out/v831-sipeed/staging_dir/target/host/include -Os -pipe -march=armv7-a -mtune=cortex-a7 -mfpu=neon -fno-caller-saves -Wno-unused-result -mfloat-abi=hard -Wformat -Werror=format-security -fdiagnostics-color=auto -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -I/opt/v83x_linux_x86_python3.8_toolchain/usr/include -I/opt/v83x_linux_x86_python3.8_toolchain/toolchain-sunxi-musl/toolchain/usr/include -I/opt/v83x_linux_x86_python3.8_toolchain/toolchain-sunxi-musl/toolchain/include -I/opt/v83x_linux_x86_python3.8_toolchain/toolchain-sunxi-musl/toolchain/include/fortify -I/opt/v83x_linux_x86_python3.8_toolchain/usr/include/python3.8 -fPIC -I/home/xb/dev/oven/MaixPy3/envs/../ext_modules/libmaix/components/libmaix/include -I/home/xb/dev/oven/MaixPy3/envs/../ext_modules/libmaix/components/libmaix/lib/arch/v83x/include/opencv4/ -I/home/xb/dev/oven/MaixPy3/envs/../ext_modules/libmaix/components/maix_cv_image/include -I/home/xb/dev/oven/MaixPy3/envs/../ext_modules/libmaix/components/third_party/imlib/include -I/home/xb/dev/oven/MaixPy3/envs/../ext_modules/_maix_image/include -I/opt/v83x_linux_x86_python3.8_toolchain/host/lib/python3.8/site-packages/pybind11/include -Iopt/v83x_linux_x86_python3.8_toolchain/usr/include/python3.8 -c ext_modules/_maix_image/_maix_custom.cpp -o build/temp.linux-armv7l-3.8/ext_modules/_maix_image/_maix_custom.o -fvisibility=hidden -g0 -std=c++11 -std=gnu++11 -DCONFIG_ARCH_V831 -DIMLIB_CONFIG_H_FILE="costom_imlib_config.h"
In file included from ext_modules/_maix_image/_maix_custom.cpp:1:0:
/home/xb/dev/oven/MaixPy3/envs/../ext_modules/_maix_image/include/maix_image.h:66:19: fatal error: imlib.h: No such file or directory
 #include "imlib.h"
                   ^
compilation terminated.

Is there a missing lib in the Toolchain https://github.com/sipeed/MaixPy3/releases/tag/20210613 ? It's pretty old now.

Cant access MAix Doc II

I tried everything to format and access this board but it keeps showing this error:
ERROR: [0x0] TEE-CORE:platform_standby_fdt_parse:126: no pmu node
ERROR: [0x0] TEE-CORE:sunxi_twi_parse_from_dt:84: no pmu node

保存图片显示出来的颜色不对

代码如下:1627963508from PIL import Image, ImageFont, ImageDraw from maix import display, camera import time img = camera.capture() img.save('/mnt/UDISK/%d.jpg' % int(time.time()), quality=100)

基于tina-V83x构建固件,但没有python环境

我尝试基于 https://github.com/Tina-Linux/tina-V83x 这个仓库去构建固件并通过whl的形式在上面安装MaixPy3
但是烧录之后发现直接编出来的固件没有Python
找到menuconfig文件发现默认的编译选项里没有勾选Python:
https://github.com/Tina-Linux/tina-V83x/blob/master/target/allwinner/v831-MaixII_Dock/defconfig

请问是这个原因导致固件中不包含Python嘛,如果是的话,可以提供当前release版本系统固件的编译选项嘛

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.