mirror of
https://github.com/m5stack/m5-docs.git
synced 2026-05-20 10:23:01 -07:00
Merge branch 'master' of https://github.com/m5stack/m5-docs
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 118 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 135 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 64 KiB |
@@ -16,7 +16,7 @@
|
||||
|
||||
**[7. Library](#Library)**
|
||||
|
||||
**[8. V-Training](#V-Training)**
|
||||
**[8. V-Training](en/related_documents/v-training)**
|
||||
|
||||
|
||||
|
||||
@@ -191,10 +191,6 @@ Linux command line to run permissions, then execute commands
|
||||
<a href="https://github.com/sipeed/MaixPy/tree/master/projects/maixpy_m5stickv"><button type="button" class="btn btn-primary">Github</button></a>
|
||||
|
||||
|
||||
## V-Training
|
||||
|
||||
<a href="#en/related_documents/v-training"><button type="button" class="btn btn-primary">V-Training Tutorial</button></a>
|
||||
|
||||
<style>
|
||||
|
||||
.link a{
|
||||
|
||||
@@ -1,4 +1,269 @@
|
||||
# quick start
|
||||
# UnitV Quick Start {docsify-ignore-all}
|
||||
|
||||
## CONTENT
|
||||
|
||||
**[1. Download Firmware](#Download)**
|
||||
|
||||
**[2. Flash Firmware](#Flash)**
|
||||
|
||||
**[3. Serial Debugging Tool](#Serial-Tool)**
|
||||
|
||||
**[5. Edit and Run the Code](#Edit-and-Run-the-Code)**
|
||||
|
||||
**[5. MaixPy IDE](#MaixPy-IDE)**
|
||||
|
||||
**[6. V-Training](#V-Training)**
|
||||
|
||||
**[7. Library](#Library)**
|
||||
|
||||
|
||||
lalalal
|
||||
## EasyLoader
|
||||
|
||||
<img src="https://m5stack.oss-cn-shenzhen.aliyuncs.com/image/EasyLoader_logo.png" width="100px" style="margin-top:20px">
|
||||
|
||||
<a href="https://m5stack.oss-cn-shenzhen.aliyuncs.com/EasyLoader/M5Core/M5StickV/EasyLoader_M5StickV_1022_beta.exe"><button type="button" class="btn btn-primary">click to download EasyLoader</button></a>
|
||||
|
||||
>1.EasyLoader is a simple and fast program burner, and each product page has a product-related case program for EasyLoader.For users who don't need to customize the firmware or perform other operations, using EasyLoader to burn firmware for M5StickV is the simplest solution.(**Currently EasyLoader is only available for Windows OS**)
|
||||
|
||||
>2.After downloading the software, double-click to run the application, connect the M5 device to the computer via the data cable, select the port parameters, and click **"Burn"** to start burning.
|
||||
|
||||
|
||||
## Download
|
||||
|
||||
> Users who use an operating system other than Windows or who need to specify a burning file can use **Kflash** for firmware burning. Click the link below to download the firmware.
|
||||
|
||||
<a href="https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/M5StickV_Firmware_1022_beta.kfpkg"><button type="button" class="btn btn-primary" target="view_window">click to download firmware </button></a>
|
||||
|
||||
|
||||
## Flash
|
||||
|
||||
>1. Flash tool Kflash_GUI.
|
||||
|
||||
<div class="link">
|
||||
<h4><span>Kflash_GUI:</span></h4>
|
||||
<p>
|
||||
<a href="https://github.com/sipeed/kflash_gui/releases/download/v1.5.3/kflash_gui_v1.5.3_windows.7z" target="_blank" rel="noopener noreferrer"><img src="https://cdn.shopify.com/s/files/1/0056/7689/2250/files/windows_89cc6ea0-2a3c-4327-97e5-8f51f448c38b_icon.png?v=1557026574" alt="">Windows</a>
|
||||
<a href="https://github.com/sipeed/kflash_gui/releases/download/v1.5.2/kflash_gui_v1.5.2_macOS.dmg" target="_blank" rel="noopener noreferrer"><img src="https://cdn.shopify.com/s/files/1/0056/7689/2250/files/mac_large.png?v=1557026570" alt="">MacOS</a>
|
||||
<a href="https://github.com/sipeed/kflash_gui/releases/download/v1.5.3/kflash_gui_v1.5.3_linux.tar.xz" target="_blank" rel="noopener noreferrer"><img src="https://cdn.shopify.com/s/files/1/0056/7689/2250/files/linux_icon.png?v=1557026584" alt="">Linux</a></p>
|
||||
</div>
|
||||
|
||||
>2. Connect the device to the computer through the Tpye-C data cable, double-click to open the burning tool**Kflash_GUI** application, select the corresponding device port, development board type (M5StickV), firmware program, baud rate. Click to download , start burning.
|
||||
|
||||
<img src="assets\img\getting_started_pics\m5stickv\kflash_gui_01.jpg">
|
||||
|
||||
### Kflash
|
||||
|
||||
>3.对于习惯使用命令行操作的用户来说还可以选择Kflash作为固件烧录工具.[点击此处查看详情](https://github.com/kendryte/kflash.py)
|
||||
|
||||
|
||||
## Serial-Tool
|
||||
|
||||
>1. You will need a serial debugging tool for programming M5StickV, you can use Putty [in here](https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html),for download and information.
|
||||
|
||||
>2. Run Putty, connect M5StickV to your PC, in Putty, set com number, baudrate, click "open", by now the connect process should started.(you can check the com number in device manager on your PC)
|
||||
|
||||
<img src="assets\img\getting_started_pics\m5stickv\putty_01.jpg">
|
||||
|
||||
> When connected, it will automatically enter Maixpy UI. Now the device is runing the default code, you can terminate it by "Ctrl+C".
|
||||
|
||||
<img src="assets\img\getting_started_pics\m5stickv\putty_02.jpg">
|
||||
|
||||
|
||||
## Edit and Run the Code
|
||||
|
||||
### Editting
|
||||
|
||||
|
||||
> The language shell programm(REPL) is good for instant code validatation, it can be used at short code programming and validation. In real project where we will have massive amount of code, in that case we will need a Code Editor for better orgnization of the code files.
|
||||
|
||||
|
||||
>Inside MaixPy,integrates a open source Editor [Micropython Editor(pye)](https://github.com/robert-hh/Micropython-Editor),which is convenient for us to manage the code.
|
||||
|
||||
function `os.listdir()` is for checking the files in current directory.
|
||||
|
||||
|
||||
With function `pye("hello.py")`, you can create new files and enter editing mode(if file exist, only enter editting mode)[click for more](https://github.com/robert-hh/Micropython-Editor/blob/master/Pyboard%20Editor.pdf)
|
||||
|
||||
If editing finished, you can do `Ctrl+S` > `Enter` to save the script. `Ctrl+Q` to exit edit mode.
|
||||
|
||||
|
||||
**Notice**: This editor have some requiremnt on the Serial tool, KEY `BackSpace` have to set as `DEL` function,or `BackSpace` will implement the same function as `Ctrl+H`(charater replacement)
|
||||
|
||||
|
||||
### File Execution
|
||||
|
||||
Function `os.chdir()` is used for switch current directory to a certain directory, for example `os.chdir("/flash")`
|
||||
|
||||
#### Solution 1: `import`
|
||||
|
||||
Run `import hello`
|
||||
|
||||
You can see the output: `hello maixpy`
|
||||
|
||||
In this way, it is simple and handy, but thers something worth your attention, `import` can only be utilized once, the second time `import` won't work. If you need to use `import` mutiple times, please refers to solution 2 below
|
||||
|
||||
#### Solution 2: `exec()`
|
||||
|
||||
Use `exec()` function:
|
||||
|
||||
```python
|
||||
with open("hello.py") as f:
|
||||
exec(f.read())
|
||||
|
||||
```
|
||||
|
||||
### AutoRun after Power On
|
||||
|
||||
|
||||
System will create a `boot.py` file at directory `/flash` or `/sd` , it will run this script after power on, modify this file will realize the AutoRun.
|
||||
|
||||
## MaixPy IDE
|
||||
|
||||
|
||||
#### Download MaixPy IDE
|
||||
|
||||
MaixPy IDE can easily realize real-time editing, uploading, execution, and real-time monitoring of camera images, file transfer and other functions. Using MaixPy IDE, because data compression and transmission require a part of resources, performance will be reduced, but This is a great development tool for developers who are not demanding in performance or who are in the debugging phase.
|
||||
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown">Download MaixPy IDE v0.2.4</button>
|
||||
<div class="dropdown-menu">
|
||||
<a class="dropdown-item" href="http://dl.cdn.sipeed.com/maixpy-ide-windows-0.2.4-installer-archive.7z">windows-0.2.4-installer-archive.7z</a>
|
||||
<a class="dropdown-item" href="http://dl.cdn.sipeed.com/maixpy-ide-windows-0.2.4.exe">windows-0.2.4.exe</a>
|
||||
<a class="dropdown-item" href="http://dl.cdn.sipeed.com/maixpy-ide-linux-x86_64-0.2.4-installer-archive.7z">linux-x86_64-0.2.4-installer-archive.7z</a>
|
||||
<a class="dropdown-item" href="http://dl.cdn.sipeed.com/maixpy-ide-linux-x86_64-0.2.4.run">linux-x86_64-0.2.4.run</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
#### Install MaixPy IDE
|
||||
|
||||
Windows platform can directly double-click the exe file to run the installer.
|
||||
|
||||
Linux command line to run permissions, then execute commands
|
||||
|
||||
`chmod +x maixpy-ide-linux-x86_64-0.2.2.run`
|
||||
|
||||
`./maixpy-ide-linux-x86_64-0.2.2.run`
|
||||
|
||||
#### Use MaixPy IDE
|
||||
|
||||
>Run the MaixPy IDE, click on the toolbar, select the model of the development board. `Tool`-> `Select Board`-> `M5StickV` (Tools -> Select Development Board)
|
||||
|
||||
<img src="assets\img\getting_started_pics\m5stickv\ide_01.jpg" width="70%">
|
||||
|
||||
>Click the Connect button in the lower left corner and select the correct connection port, click OK.
|
||||
|
||||
<img src="assets\img\getting_started_pics\m5stickv\ide_02.jpg" width="70%">
|
||||
|
||||
>When the connection button changes from green to red, it has been connected successfully. You can edit the code in the edit box above. Click the Run button in the lower left corner to execute the code and verify it.
|
||||
|
||||
<img src="assets\img\getting_started_pics\m5stickv\ide_03.jpg" width="70%">
|
||||
|
||||
|
||||
## V-Training
|
||||
|
||||
V-Training is an online recognition model training service customized for K210 series products launched by M5Stack.
|
||||
|
||||
|
||||
### boot program
|
||||
|
||||
>The boot program is a picture material shooting program suitable for UnitV, which is used for material collection in the early stage of model training.
|
||||
|
||||
<a href="https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/UnitV_boot_v1220.py"><button type="button" class="btn btn-primary">Click to download the boot program</button></a>
|
||||
|
||||
>The training materials will be saved to the SD card by default, so please insert the SD card into the UnitV card slot before running the boot program. (Note: UnitV has requirements for the selection of SD cards, [click here to see the type of support](en/unit/unitv?id=sd-card-test))
|
||||
|
||||
|
||||
>Run the MaixPy IDE and connect to the UnitV device. Click the "Open File" option, open the downloaded boot.py file, and click the Run button. After running successfully, the camera image will be monitored in real time in the upper right corner of MaixPy IDE
|
||||
|
||||
>Match the camera screen on the IDE for shooting operations. Press the A button to take a picture. The B button is used to switch the class number. The output log will correspond to the class number of each operation and the number of pictures taken. Click "Serial Port Monitor" below to see the log output.
|
||||
|
||||
<img src="assets\img\getting_started_pics\unitv\unitv_qs1.jpg" width="60%">
|
||||
|
||||
>At present, the program provides a total of 10 groups of classes for users to shoot training materials, each group represents a kind of recognition object. <mark> In order to obtain better training results, users must shoot more than 3 groups of Class Recognition object). In order to ensure the accuracy of recognition, the number of Class shooting materials in each group needs to exceed 35, otherwise it will not be passed during cloud training. The greater the number of materials, the better the recognition training effect and the higher the recognition rate high</mark>
|
||||
|
||||
<img src="assets\img\getting_started_pics\unitv\unitv_qs2.jpg" width="60%">
|
||||
|
||||
>When shooting training materials, please try to keep the ambient light conditions of the material shooting consistent with the actual recognition application scene. The shooting distance is recommended to fill the screen with the recognition object completely and there is no other debris in the background.
|
||||
|
||||
|
||||
### Material inspection and suppression
|
||||
|
||||
>After shooting the materials, click the disconnect option in the IDE, remove the SD card, and copy the image materials ("train" and "vaild" folders) in the SD to the computer through a card reader.
|
||||
|
||||
|
||||
<img src="assets\img\getting_started_pics\unitv\unitv_qs3.jpg" width="60%">
|
||||
|
||||
>The "Class" and "vaild" folders have the same Class number folder directory. When you switch between Classes and shoot material, the program will create files with the same Class number in "train" and "vaild" at the same time. Folder, and store the captured pictures into the Class folder under the respective directories of "train" and "vaild" according to the storage rules.
|
||||
|
||||
><mark>In addition to checking the correctness of the picture content before suppressing the packaging, you must ensure that the sum of the material pictures in the same Class serial number directory in the two folders of "train" and "vaild" is greater than 35. The class serial number catalog when the total number is less than 35 please Delete or backup. </mark> After completing the inspection, the next thing to do is to suppress the material files. Press the "train" and "vaild" folders into a "zip" format compressed package.
|
||||
|
||||
## Upload Data to Cloud
|
||||
|
||||
>[Click to visit upload page](http://v-training.m5stack.com/),type in your personal information(upload file should under 200MB, and had to be ZIP format)
|
||||
|
||||
<img src="assets\img\related_documents\v-training\6.jpg" width="60%">
|
||||
|
||||
> After the Upload is done, file will enter request queue. At bottom left corner will show the current queue status.
|
||||
|
||||
<img src="assets\img\related_documents\v-training\7.jpg" width="60%">
|
||||
|
||||
|
||||
## Download Model
|
||||
|
||||
>After training accomplished, code file will sent to your personal e-mail, copy the download link to download the file to your computer.Unzip the file, copy it to SD card, keep the SD card in the M5StickV
|
||||
|
||||
<img src="assets\img\related_documents\v-training\8.jpg" width="60%">
|
||||
|
||||
<img src="assets\img\related_documents\v-training\9.jpg" width="60%">
|
||||
|
||||
## Program modification
|
||||
|
||||
>The guidance program returned after training is only provided with the object recognition function, but it is the output of the designated recognition or unrecognition state, so the user can modify it according to the existing program according to his own needs. To realize the output of identification data, or the corresponding execution function after the identification is successful. For example, the identification information is printed out serially.
|
||||
|
||||
**The following is the boot program with serial port printing program added. It is only a partial comment and is not a complete program. Please use the boot program file returned by training to modify it.**
|
||||
|
||||
```
|
||||
...
|
||||
|
||||
task = kpu.load("/sd/c33723fb62faf1be_mbnet10_quant.kmodel")//载入模型文件
|
||||
|
||||
labels=["1","2","3","4","5","6"] #The list corresponds to the Class order of the training material, and corresponds to each identifier. You can also modify the elements in the list into other string fields.
|
||||
|
||||
|
||||
while(True):
|
||||
img = sensor.snapshot()
|
||||
fmap = kpu.forward(task, img)
|
||||
plist=fmap[:]
|
||||
pmax=max(plist)
|
||||
max_index=plist.index(pmax)
|
||||
a = lcd.display(img)
|
||||
if pmax > 0.95://Determine whether the recognition rate of the object is greater than 95%
|
||||
lcd.draw_string(40, 60, "Accu:%.2f Type:%s"%(pmax, labels[max_index].strip()))
|
||||
print(labels[max_index])//Print the identified object name through the serial port.
|
||||
|
||||
....
|
||||
```
|
||||
|
||||
>After the UnitV is powered, it will run the boot program in SD by default to automatically recognize it. After adding the serial printing program, you can use the serial debugging tool to check the identification information.
|
||||
|
||||
|
||||
## Library
|
||||
|
||||
In the library documentation, you can find more APIs to help you build a variety of applications。
|
||||
|
||||
<a href="https://maixpy.sipeed.com/en/libs/standard/"><button type="button" class="btn btn-primary">See more program examples</button></a>
|
||||
|
||||
<a href="https://github.com/sipeed/MaixPy/tree/master/projects/maixpy_m5stickv"><button type="button" class="btn btn-primary">Github</button></a>
|
||||
|
||||
|
||||
|
||||
<style>
|
||||
|
||||
.link a{
|
||||
|
||||
padding-left: 13%;
|
||||
|
||||
}
|
||||
|
||||
</style>
|
||||
+9
-11
@@ -342,53 +342,51 @@
|
||||
$(document).ready(function(){
|
||||
var mask_html = `<div class="mask"><a href="#" style="color:white;text-decoration:none" ><button type="button" class="btn-sm btn-primary mask-btn1">QuickStart</button></a><button type="button" class="btn-sm btn-primary mask-btn2">Document</button></div>`
|
||||
$("#core div.item a").append(mask_html);
|
||||
$("#unit div.item a:lt(4)").append(mask_html);
|
||||
$("#unit div.item a:lt(5)").append(mask_html);
|
||||
$("#core .mask a").attr("href", "#en/quick_start/m5core/m5stack_core_quick_start");
|
||||
$("#core .mask a").eq(6).attr("href", "#en/quick_start/m5stick/m5stick_quick_start");
|
||||
$("#core .mask a").eq(7).attr("href", "#en/quick_start/m5stickc/m5stickc_quick_start");
|
||||
$("#core .mask a").eq(8).attr("href", "#en/quick_start/m5stickv/m5stickv_quick_start");
|
||||
$("#unit .mask a").attr("href", "#en/quick_start/m5camera/m5camera_quick_start");
|
||||
// $("#unit .mask a").eq(4).attr("href", "#en/quick_start/unitv/unitv_quick_start");
|
||||
$("#unit .mask a").eq(4).attr("href", "#en/quick_start/unitv/unitv_quick_start");
|
||||
$(".product_page strong").parent('p').css("margin-bottom","0px");
|
||||
});
|
||||
|
||||
|
||||
var scrollFunc = function (e) {
|
||||
e = e || window.event;
|
||||
// if (e.wheelDelta) { //判断浏览器IE,谷歌滑轮事件
|
||||
var test = window.location.href;
|
||||
if(((test.slice(-4) == "/en/")||(test.slice(-4)== "/zh_CN/"))||((test.indexOf(/en/) == -1) && (test.indexOf(/zh_CN/) == -1))){
|
||||
$(".btn-group-vertical .btn-group button").addClass("btn-light");
|
||||
if((core.getBoundingClientRect().top + core.getBoundingClientRect().height) > 200){
|
||||
if(($("#core").offset().top + $("#core").height() - $(window).scrollTop()) > 100){
|
||||
$(".mb-navigation").text(' Core');
|
||||
$("#core-btn").removeClass("btn-light");
|
||||
$("#core-btn").addClass("btn-primary");
|
||||
}else if((module.getBoundingClientRect().top + module.getBoundingClientRect().height) > 200){
|
||||
}else if(($("#module").offset().top + $("#module").height() - $(window).scrollTop()) > 100){
|
||||
$(".mb-navigation").text(' Module');
|
||||
$("#module-btn").removeClass("btn-light");
|
||||
$("#module-btn").addClass("btn-primary");
|
||||
}else if((base.getBoundingClientRect().top + base.getBoundingClientRect().height) > 200){
|
||||
}else if(($("#base").offset().top + $("#base").height() - $(window).scrollTop()) > 100){
|
||||
$(".mb-navigation").text(' Base');
|
||||
$("#base-btn").removeClass("btn-light");
|
||||
$("#base-btn").addClass("btn-primary");
|
||||
}else if((unit.getBoundingClientRect().top + unit.getBoundingClientRect().height) > 200){
|
||||
}else if(($("#unit").offset().top + $("#unit").height() - $(window).scrollTop())> 100){
|
||||
$(".mb-navigation").text(' Unit');
|
||||
$("#unit-btn").removeClass("btn-light");
|
||||
$("#unit-btn").addClass("btn-primary");
|
||||
}else if((application.getBoundingClientRect().top + application.getBoundingClientRect().height) > 200){
|
||||
}else if(($("#application").offset().top + $("#application").height() - $(window).scrollTop())> 100){
|
||||
$(".mb-navigation").text(' Application');
|
||||
$("#application-btn").removeClass("btn-light");
|
||||
$("#application-btn").addClass("btn-primary");
|
||||
}else if((accessory.getBoundingClientRect().top + accessory.getBoundingClientRect().height) > 700){
|
||||
}else if(($("#accessory").offset().top + $("#accessory").height() - $(window).scrollTop()) > 800){
|
||||
$(".mb-navigation").text(' Accessory');
|
||||
$("#accessory-btn").removeClass("btn-light");
|
||||
$("#accessory-btn").addClass("btn-primary");
|
||||
}else if((aluminium.getBoundingClientRect().top + aluminium.getBoundingClientRect().height) > 600){
|
||||
}else if(($("#aluminium").offset().top + $("#aluminium").height() - $(window).scrollTop()) > 100){
|
||||
$(".mb-navigation").text(' Aluminium');
|
||||
$("#aluminium-btn").removeClass("btn-light");
|
||||
$("#aluminium-btn").addClass("btn-primary");
|
||||
}
|
||||
// }
|
||||
}
|
||||
}
|
||||
/*IE、Opera注册事件*/
|
||||
|
||||
@@ -341,13 +341,13 @@
|
||||
$(document).ready(function(){
|
||||
var mask_html = `<div class="mask"><a href="#" style="color:white;text-decoration:none" ><button type="button" class="btn-sm btn-primary mask-btn1">快速上手 »</button></a><button type="button" class="btn-sm btn-primary mask-btn2">产品文档 »</button></div>`
|
||||
$("#core div.item a").append(mask_html);
|
||||
$("#unit div.item a:lt(4)").append(mask_html);
|
||||
$("#unit div.item a:lt(5)").append(mask_html);
|
||||
$("#core .mask a").attr("href", "#zh_CN/quick_start/m5core/m5stack_core_quick_start");
|
||||
$("#core .mask a").eq(6).attr("href", "#zh_CN/quick_start/m5stick/m5stick_quick_start");
|
||||
$("#core .mask a").eq(7).attr("href", "#zh_CN/quick_start/m5stickc/m5stickc_quick_start");
|
||||
$("#core .mask a").eq(8).attr("href", "#zh_CN/quick_start/m5stickv/m5stickv_quick_start");
|
||||
$("#unit .mask a").attr("href", "#zh_CN/quick_start/m5camera/m5camera_quick_start");
|
||||
// $("#unit .mask a").eq(4).attr("href", "#zh_CN/quick_start/unitv/unitv_quick_start");
|
||||
$("#unit .mask a").eq(4).attr("href", "#zh_CN/quick_start/unitv/unitv_quick_start");
|
||||
$(".product_page strong").parent('p').css("margin-bottom","0px");
|
||||
});
|
||||
|
||||
@@ -358,31 +358,31 @@
|
||||
var test = window.location.href;
|
||||
if(((test.slice(-4) == "/en/")||(test.slice(-7)== "/zh_CN/"))||((test.indexOf(/en/) == -1) && (test.indexOf(/zh_CN/) == -1))){
|
||||
$(".btn-group-vertical button").addClass("btn-light");
|
||||
if((core.getBoundingClientRect().top + core.getBoundingClientRect().height) > 200){
|
||||
if(($("#core").offset().top + $("#core").height() - $(window).scrollTop()) > 100){
|
||||
$(".mb-navigation").text(' Core');
|
||||
$("#core-btn").removeClass("btn-light");
|
||||
$("#core-btn").addClass("btn-primary");
|
||||
}else if((module.getBoundingClientRect().top + module.getBoundingClientRect().height) > 200){
|
||||
}else if(($("#module").offset().top + $("#module").height() - $(window).scrollTop()) > 100){
|
||||
$(".mb-navigation").text(' Module');
|
||||
$("#module-btn").removeClass("btn-light");
|
||||
$("#module-btn").addClass("btn-primary");
|
||||
}else if((base.getBoundingClientRect().top + base.getBoundingClientRect().height) > 200){
|
||||
}else if(($("#base").offset().top + $("#base").height() - $(window).scrollTop()) > 100){
|
||||
$(".mb-navigation").text(' Base');
|
||||
$("#base-btn").removeClass("btn-light");
|
||||
$("#base-btn").addClass("btn-primary");
|
||||
}else if((unit.getBoundingClientRect().top + unit.getBoundingClientRect().height) > 200){
|
||||
}else if(($("#unit").offset().top + $("#unit").height() - $(window).scrollTop())> 100){
|
||||
$(".mb-navigation").text(' Unit');
|
||||
$("#unit-btn").removeClass("btn-light");
|
||||
$("#unit-btn").addClass("btn-primary");
|
||||
}else if((application.getBoundingClientRect().top + application.getBoundingClientRect().height) > 200){
|
||||
}else if(($("#application").offset().top + $("#application").height() - $(window).scrollTop())> 100){
|
||||
$(".mb-navigation").text(' Application');
|
||||
$("#application-btn").removeClass("btn-light");
|
||||
$("#application-btn").addClass("btn-primary");
|
||||
}else if((accessory.getBoundingClientRect().top + accessory.getBoundingClientRect().height) > 700){
|
||||
}else if(($("#accessory").offset().top + $("#accessory").height() - $(window).scrollTop()) > 800){
|
||||
$(".mb-navigation").text(' Accessory');
|
||||
$("#accessory-btn").removeClass("btn-light");
|
||||
$("#accessory-btn").addClass("btn-primary");
|
||||
}else if((aluminium.getBoundingClientRect().top + aluminium.getBoundingClientRect().height) > 600){
|
||||
}else if(($("#aluminium").offset().top + $("#aluminium").height() - $(window).scrollTop()) > 100){
|
||||
$(".mb-navigation").text(' Aluminium');
|
||||
$("#aluminium-btn").removeClass("btn-light");
|
||||
$("#aluminium-btn").addClass("btn-primary");
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
**[7. 程序库](#程序库)**
|
||||
|
||||
**[8. V-Training](#V-Training)**
|
||||
**[8. V-Training](zh_CN/related_documents/v-training)**
|
||||
|
||||
|
||||
## EasyLoader
|
||||
@@ -184,10 +184,6 @@ Linux命令行给运行权限然后,执行命令
|
||||
<a href="https://github.com/sipeed/MaixPy/tree/master/projects/maixpy_m5stickv"><button type="button" class="btn btn-primary">Github</button></a>
|
||||
|
||||
|
||||
## V-Training
|
||||
|
||||
<a href="#zh_CN/related_documents/v-training"><button type="button" class="btn btn-primary">V-Training使用说明</button></a>
|
||||
|
||||
<style>
|
||||
|
||||
.link a{
|
||||
|
||||
@@ -1,4 +1,265 @@
|
||||
# quick start
|
||||
# UnitV 上手指南 {docsify-ignore-all}
|
||||
|
||||
## 目录
|
||||
|
||||
**[1. 下载固件](#下载固件)**
|
||||
|
||||
**[2. 烧录固件](#烧录固件)**
|
||||
|
||||
**[3. 串口调试工具](#串口调试工具)**
|
||||
|
||||
**[4. 编辑与运行文件](#编辑与运行文件)**
|
||||
|
||||
**[5. MaixPy IDE](#MaixPy-IDE)**
|
||||
|
||||
**[6. V-Training](#V-Training)**
|
||||
|
||||
**[7. 程序库](#程序库)**
|
||||
|
||||
|
||||
lalalal
|
||||
## EasyLoader
|
||||
|
||||
<img src="https://m5stack.oss-cn-shenzhen.aliyuncs.com/image/EasyLoader_logo.png" width="100px" style="margin-top:20px">
|
||||
|
||||
<a href="https://m5stack.oss-cn-shenzhen.aliyuncs.com/EasyLoader/M5Core/M5StickV/EasyLoader_M5StickV_1022_beta.exe"><button type="button" class="btn btn-primary">点击下载EasyLoader</button></a>
|
||||
|
||||
>1.EasyLoader是一个简洁快速的程序烧录器,每一个产品页面里的EasyLoader都提供了一个与产品相关的案例程序,对于不需要对固件进行定制或进行其他操作的用户,使用EasyLoader为UnitV烧录固件,会是一个最简洁的方案(**目前EasyLoader仅适用于Windows操作系统**).
|
||||
|
||||
>2.下载软件后,双击运行应用程序,将M5设备通过数据线连接至电脑,选择端口参数,点击 **"Burn"** 即可开始烧录
|
||||
|
||||
|
||||
## 下载固件
|
||||
|
||||
> 需要指定烧录文件的用户可以选用**Kflash**进行固件烧录.
|
||||
|
||||
<a href="https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/M5StickV_Firmware_1022_beta.kfpkg"><button type="button" class="btn btn-primary">点击下载固件文件</button></a>
|
||||
|
||||
|
||||
## 烧录固件
|
||||
|
||||
>1.点击下方对应自己操作系统的 Kflash_GUI烧录工具进行下载.
|
||||
|
||||
<div class="link">
|
||||
<h4><span>Kflash_GUI:</span></h4>
|
||||
<p>
|
||||
<a href="https://github.com/sipeed/kflash_gui/releases/download/v1.5.3/kflash_gui_v1.5.3_windows.7z" target="_blank" rel="noopener noreferrer"><img src="https://cdn.shopify.com/s/files/1/0056/7689/2250/files/windows_89cc6ea0-2a3c-4327-97e5-8f51f448c38b_icon.png?v=1557026574" alt="">Windows</a>
|
||||
<a href="https://github.com/sipeed/kflash_gui/releases/download/v1.5.2/kflash_gui_v1.5.2_macOS.dmg" target="_blank" rel="noopener noreferrer"><img src="https://cdn.shopify.com/s/files/1/0056/7689/2250/files/mac_large.png?v=1557026570" alt="">MacOS</a>
|
||||
<a href="https://github.com/sipeed/kflash_gui/releases/download/v1.5.3/kflash_gui_v1.5.3_linux.tar.xz" target="_blank" rel="noopener noreferrer"><img src="https://cdn.shopify.com/s/files/1/0056/7689/2250/files/linux_icon.png?v=1557026584" alt="">Linux</a></p>
|
||||
</div>
|
||||
|
||||
>2.将设备通过Tpye-C数据线连接至电脑,双击打开烧录工具**Kflash_GUI**应用程序,选择对应的设备端口、开发板类型(M5StickV)、固件程序、波特率. 点击下载,开始烧录 .
|
||||
|
||||
<img src="assets\img\getting_started_pics\m5stickv\kflash_gui_01.jpg">
|
||||
|
||||
### Kflash
|
||||
|
||||
>3.对于习惯使用命令行操作的用户来说还可以选择Kflash作为固件烧录工具.[点击此处查看详情](https://github.com/kendryte/kflash.py)
|
||||
|
||||
|
||||
## 串口调试工具
|
||||
|
||||
>1.编程UnitV需要使用到串口调试工具,您可以使用Putty作为串口调试工具, [点击此处](https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html)访问Putty资源页面,选择对应自己操作系统Putty进行下载,并安装.
|
||||
|
||||
>2.运行Putty后,将UnitV通过Tpye-C数据线连接至电脑端口,在Putty中设置相应的端口号与波特率,点击"open",开始连接. (你可以通过查看设备管理器得到UnitV所使用的端口号)
|
||||
|
||||
<img src="assets\img\getting_started_pics\m5stickv\putty_01.jpg">
|
||||
|
||||
> 连接成功后,将自动进入,MaixPy 的交互界面. 此时设备正在运行着默认程序,您可以通过按下快捷键"Ctrl+C"中断其运行,并进入命令行.
|
||||
|
||||
<img src="assets\img\getting_started_pics\m5stickv\putty_02.jpg">
|
||||
|
||||
|
||||
|
||||
## 编辑与运行文件
|
||||
|
||||
### 编辑文件
|
||||
|
||||
>在交互解释器(REPL)中,我们能够便捷的输入程序并马上得到运行结果,但这仅适合用作短程序的验证,在实际项目中,庞大代码量使得我们不得不将代码编辑成一个个的文件.
|
||||
|
||||
>在 MaixPy 中,内置了一款编开源编辑器 [Micropython Editor(pye)](https://github.com/robert-hh/Micropython-Editor),这使得我们能够非常方便的修改程序文件.
|
||||
|
||||
使用 `os.listdir()` 可以查看当前目录下的文件,
|
||||
|
||||
使用 `pye("hello.py")` 可以创建文件并进入编辑模式(已存在同名文件,则仅进入编辑), 快捷键等使用说明可以在[这里查看](https://github.com/robert-hh/Micropython-Editor/blob/master/Pyboard%20Editor.pdf)
|
||||
|
||||
在编辑器中完成编辑后,按 `Ctrl+S` > `Enter` 键进行保存, 按 `Ctrl+Q` 退出编辑
|
||||
|
||||
**注意**: 使用这款编辑器对使用的串口工具有一定要求, 必须将 `BackSpace` 按键设置为 `DEL` 功能, 否则按 `BackSpace` 调用的是 `Ctrl+H` 一样的功能(即字符替换)
|
||||
|
||||
|
||||
### 运行文件
|
||||
|
||||
使用 `os.chdir()` 切换当前目录到文件的目录,比如 `os.chdir("/flash")`
|
||||
|
||||
#### 方法一: `import`
|
||||
|
||||
然后执行 `import hello`
|
||||
|
||||
即可看到输出 `hello maixpy`
|
||||
|
||||
使用此方法简单易用,但是需要注意的是, 目前 `import` 只能使用一次, 如果第二次 `import`, 则文件不会再执行, 如果需要多次执行,建议使用下面的方法
|
||||
|
||||
#### 方法二: `exec()`
|
||||
|
||||
使用 `exec()` 函数来执行
|
||||
|
||||
```python
|
||||
with open("hello.py") as f:
|
||||
exec(f.read())
|
||||
|
||||
```
|
||||
|
||||
### 开机自动运行脚本
|
||||
|
||||
系统会在 `/flash` 或者 `/sd` 目录创建 `boot.py` 文件, 开机会自动先执行这个脚本, 编辑这个脚本的内容即可实现开机自启
|
||||
|
||||
|
||||
## MaixPy IDE
|
||||
|
||||
#### 下载MaixPy IDE
|
||||
|
||||
MaixPy IDE能够便捷的实现脚本程序的实时编辑、上传、执行,以及实时监控摄像头图像,文件传输等功能.使用 MaixPy IDE 因为数据的压缩、传输需要耗费一部分资源,所以性能会有所降低,但对性能需求不苛刻,或处于调试阶段的开发者来说这会是一个很不错的开发工具.
|
||||
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown">下载MaixPy IDE v0.2.4</button>
|
||||
<div class="dropdown-menu">
|
||||
<a class="dropdown-item" href="http://dl.cdn.sipeed.com/maixpy-ide-windows-0.2.4-installer-archive.7z">windows-0.2.4-installer-archive.7z</a>
|
||||
<a class="dropdown-item" href="http://dl.cdn.sipeed.com/maixpy-ide-windows-0.2.4.exe">windows-0.2.4.exe</a>
|
||||
<a class="dropdown-item" href="http://dl.cdn.sipeed.com/maixpy-ide-linux-x86_64-0.2.4-installer-archive.7z">linux-x86_64-0.2.4-installer-archive.7z</a>
|
||||
<a class="dropdown-item" href="http://dl.cdn.sipeed.com/maixpy-ide-linux-x86_64-0.2.4.run">linux-x86_64-0.2.4.run</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
#### 安装MaixPy IDE
|
||||
|
||||
Windows平台可直接双击exe文件,运行安装程序.
|
||||
|
||||
Linux命令行给运行权限然后,执行命令
|
||||
|
||||
`chmod +x maixpy-ide-linux-x86_64-0.2.2.run`
|
||||
|
||||
`./maixpy-ide-linux-x86_64-0.2.2.run`
|
||||
|
||||
#### 使用MaixPy IDE
|
||||
|
||||
>运行MaixPy IDE, 点击工具栏,选择开发板的型号.`Tool`-> `Select Board`-> `M5StickV` (工具->选择开发板)
|
||||
|
||||
<img src="assets\img\getting_started_pics\m5stickv\ide_01.jpg" width="70%">
|
||||
|
||||
>点击左下角的连接按钮,并选择正确的连接端口,点击OK.
|
||||
|
||||
<img src="assets\img\getting_started_pics\m5stickv\ide_02.jpg" width="70%">
|
||||
|
||||
>当连接按钮由绿色变为红色的时表示,已经连接成功,你可以在上方的编辑框进行代码编辑,点击左下角的运行按钮能够执行代码,进行验证.
|
||||
|
||||
<img src="assets\img\getting_started_pics\m5stickv\ide_03.jpg" width="70%">
|
||||
|
||||
|
||||
## V-Training
|
||||
|
||||
V-Training 是由M5Stack推出的一个针对K210系列产品而定制的在线识别模型训练服务,以下为使用步骤。
|
||||
|
||||
|
||||
### boot程序
|
||||
|
||||
> boot程序是适用于UnitV的一个图片素材拍摄程序,用于模型训练前期的素材收集。
|
||||
|
||||
<a href="https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/UnitV_boot_v1220.py"><button type="button" class="btn btn-primary">点击下载boot程序</button></a>
|
||||
|
||||
>拍摄的训练素材将默认储存到SD卡,因此在运行boot程序前请将SD卡插入UnitV的卡槽。(注意:UnitV对SD卡的选型有所要求,[点击此处查看支持类型](zh_CN/unit/unitv?id=sd卡测试))
|
||||
|
||||
|
||||
>运行MaixPy IDE,连接UnitV设备.点击"打开文件"选项,打开已经下载的boot.py文件,点击运行按钮。运行成功后,在MaixPy IDE的右上角将实时监视摄像头画面
|
||||
|
||||
>配合IDE上的摄像头画面进行拍摄操作,按下A键进行图片拍摄,B键按键则用于切换Class序号.输出日志将对应每一次操作的Class序号以及拍摄图片数量。点击下方的"串口监视器",查看日志输出。
|
||||
|
||||
<img src="assets\img\getting_started_pics\unitv\unitv_qs1.jpg" width="60%">
|
||||
|
||||
>目前程序一共提供了10组Class供用户拍摄训练素材,每一组Class代表着一种识别对象.<mark>为了获得更好的训练效果,用户必须要拍摄3组以上的Class(三个以上的识别对象).为了保证识别的准确率,每组Class拍摄素材张数需要超过35张,否则在进行云端训练时将不给予通过. 素材的数量越多,识别训练的效果越好,识别率越高</mark>
|
||||
|
||||
<img src="assets\img\getting_started_pics\unitv\unitv_qs2.jpg" width="60%">
|
||||
|
||||
>在拍摄训练素材时,请尽可能保持素材拍摄的环境光线情况与实际识别应用场景一致,拍摄距离建议将识别对象刚好完整填入屏幕,且背景无其他杂物.
|
||||
|
||||
|
||||
### 素材检查与压制
|
||||
|
||||
>素材拍摄完成后,点击IDE中的断开连接选项,取出SD卡,通过读卡器将SD中的图片素材("train"、"vaild"两个文件夹),复制至电脑端.
|
||||
|
||||
|
||||
<img src="assets\img\getting_started_pics\unitv\unitv_qs3.jpg" width="60%">
|
||||
|
||||
>"train"、"vaild"两个文件夹中的Class序号文件夹目录是保持一致的,当切换Class并拍摄素材时,程序将会在"train"、"vaild"中同时创建Class序号一致的文件夹,并按照存放规则将所拍摄的图片分别存储到"train"、"vaild"各自目录下的Class文件夹中.
|
||||
|
||||
><mark>在压制打包前除了检查图片内容的正确性以外,必须确保"train"、"vaild"两个文件夹中同一Class序号目录里的素材图片总和大于35.数量总和小于35时的Class序号目录请自行删除或是备份处理.</mark>完成了检查工作,接下来要做就是素材文件的压制.将"train"、"vaild"两个文件夹通过压制工具压制为"zip"格式的压缩包.
|
||||
|
||||
## 数据上传云端
|
||||
|
||||
>[点击此处访问数据上传页面](http://v-training.m5stack.com/),按照信息提示填写个人邮箱,点击上传文件(上传文件大小控制在200MB以内,且必须为zip格式.)
|
||||
|
||||
<img src="assets\img\related_documents\v-training\6.jpg" width="60%">
|
||||
|
||||
>上传成功后,文件将会进入请求队列,页面的左下方的表格将会显示出当前的队列情况.
|
||||
|
||||
<img src="assets\img\related_documents\v-training\7.jpg" width="60%">
|
||||
|
||||
|
||||
## 下载识别模型
|
||||
|
||||
>等待训练完成,程序文件下载地址将会以邮件的形式发送到上传文件时预留的邮箱中去.复制邮件中的下载地址,下载程序文件到本地进行解压,并复制到SD卡中去.
|
||||
|
||||
<img src="assets\img\related_documents\v-training\8.jpg" width="60%">
|
||||
|
||||
<img src="assets\img\related_documents\v-training\9.jpg" width="60%">
|
||||
|
||||
## 程序修改
|
||||
|
||||
>训练完成后的返回的boot程序仅提供物体识别功能,但并为指定识别或未识别状态的输出内容,因此用户可以根据自己的需求,基于现有程序进行修改。实现识别数据的输出,或是识别成功后相应的执行功能。例如将识别信息通过串口打印出来。
|
||||
|
||||
**以下为添加了串口打印程序的boot程序,仅作部分内容注释,并非完整程序,实际使用请基于训练返回的boot程序文件修改**
|
||||
|
||||
```
|
||||
...
|
||||
|
||||
task = kpu.load("/sd/c33723fb62faf1be_mbnet10_quant.kmodel")//载入模型文件
|
||||
|
||||
labels=["1","2","3","4","5","6"] #该列表对应训练素材时的Class顺序,分别对应每一个识别物,你也可以将列表内的元素,修改成其他字符串字段.
|
||||
|
||||
|
||||
while(True):
|
||||
img = sensor.snapshot()
|
||||
fmap = kpu.forward(task, img)
|
||||
plist=fmap[:]
|
||||
pmax=max(plist)
|
||||
max_index=plist.index(pmax)
|
||||
a = lcd.display(img)
|
||||
if pmax > 0.95://判断对象的识别率是否大于95%
|
||||
lcd.draw_string(40, 60, "Accu:%.2f Type:%s"%(pmax, labels[max_index].strip()))
|
||||
print(labels[max_index])//将所识别的对象名称通过串口打印出来。
|
||||
|
||||
....
|
||||
```
|
||||
|
||||
>UnitV在供电后,会默认运行SD中的boot程序,自动进行识别。添加了串口打印程序后,你可以使用串口调试工具,进行识别信息查看。
|
||||
|
||||
|
||||
## 程序库
|
||||
|
||||
在程序库文档中,你可以找到更多的API,方便你搭建各式各样的应用。
|
||||
|
||||
<a href="https://maixpy.sipeed.com/zh/libs/standard/"><button type="button" class="btn btn-primary">查看更多程序案例</button></a>
|
||||
|
||||
<a href="https://github.com/sipeed/MaixPy/tree/master/projects/maixpy_m5stickv"><button type="button" class="btn btn-primary">Github</button></a>
|
||||
|
||||
|
||||
|
||||
<style>
|
||||
|
||||
.link a{
|
||||
|
||||
padding-left: 13%;
|
||||
|
||||
}
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user