Cov txheej txheem:

Kev Paub Duab Nrog K210 Cov Ntsiab Lus thiab Arduino IDE/Micropython: 6 Cov Kauj Ruam (nrog Duab)
Kev Paub Duab Nrog K210 Cov Ntsiab Lus thiab Arduino IDE/Micropython: 6 Cov Kauj Ruam (nrog Duab)

Video: Kev Paub Duab Nrog K210 Cov Ntsiab Lus thiab Arduino IDE/Micropython: 6 Cov Kauj Ruam (nrog Duab)

Video: Kev Paub Duab Nrog K210 Cov Ntsiab Lus thiab Arduino IDE/Micropython: 6 Cov Kauj Ruam (nrog Duab)
Video: Lub Zog Nruab Nrog (Hmong Dubbed) 2024, Hlis ntuj nqeg
Anonim
Image
Image

Kuv twb tau sau ib tsab xov xwm hais txog yuav ua li cas qhib OpenMV qhov kev qhia ntawm Sipeed Maix Bit thiab tseem tau ua cov vis dis aus ntawm kev tshawb pom qhov khoom ua piv txwv nrog lub rooj tsavxwm no. Ib ntawm ntau cov lus nug tib neeg tau nug yog - kuv tuaj yeem lees paub lub hom phiaj li cas uas neural network tsis tau kawm rau? Hauv lwm lo lus yuav ua li cas thiaj ua rau koj tus kheej cais cov duab thiab khiav nws nrog kho vajtse nrawm.

Nov yog lo lus nug nkag siab, vim rau koj txoj haujlwm koj yuav tsis tas yuav paub qee yam khoom siv dav, xws li miv thiab dev thiab dav hlau. Koj xav paub txog qee yam tshwj xeeb, piv txwv li, yug menyuam dev rau lub qhov rooj tsiaj tsis siv neeg, lossis hom tsiaj rau kev txheeb, lossis lwm yam kev thov tawm uas koj tuaj yeem xav txog!

Kuv tau koj! Hauv kab lus no kuv yuav qhia koj li cas los tsim koj tus kheej kev cais cov duab nrog hloov kev kawm hauv Keras, hloov tus qauv kev kawm rau.kmodel format thiab khiav ntawm Sipeed board (tuaj yeem yog ib lub rooj tsavxwm, Ntsis/Dock lossis Mus) siv Micropython lossis Arduino IDE Cov. Thiab tsuas yog koj lub tswv yim yuav yog qhov txwv rau cov haujlwm koj tuaj yeem ua nrog qhov kev paub no.

Hloov Kho Lub Tsib Hlis 2020: Pom li cas kuv kab lus thiab vis dis aus ntawm Kev Paub Duab nrog K210 cov laug cam tseem nrov heev thiab ntawm cov txiaj ntsig zoo tshaj plaws hauv YouTube thiab Google, Kuv txiav txim siab hloov kho kab lus kom suav nrog cov ntaub ntawv hais txog aXeleRate, Keras-based moj khaum rau AI ntawm Ntug kuv txhim kho.

aXeleRate, qhov tseem ceeb, yog los ntawm kev sau cov ntawv sau uas kuv tau siv rau kev qhia paub lub ntsej muag duab/khoom ntsuas pom - ua ke rau hauv ib lub moj khaum thiab ua kom zoo rau kev ua haujlwm ntawm Google Colab. Nws yooj yim dua rau siv thiab ntau dua.

Txog qhov qub version ntawm tsab xov xwm, koj tseem tuaj yeem pom nws ntawm steemit.com.

Kauj Ruam 1: CNN thiab Hloov Kev Kawm: Qee Qhov Kev Xav

CNN thiab Hloov Kev Kawm: Qee Txoj Kev Xav
CNN thiab Hloov Kev Kawm: Qee Txoj Kev Xav

Convolutional Neural Networks lossis CNN yog chav kawm ntawm kev sib sib zog nqus neural tes hauj lwm, feem ntau siv rau kev tshuaj xyuas cov duab pom. Muaj ntau cov ntaub ntawv hauv internet ntawm cov ncauj lus thiab kuv yuav muab qee qhov txuas hauv ntu kawg ntawm kab lus. Hauv ntej, koj tuaj yeem xav txog CNN raws li cov ntxaij lim dej, siv rau cov duab, txhua lub lim dej tab tom nrhiav qhov tshwj xeeb hauv daim duab - ntawm cov txheej txheej sab saud qis dua cov yam ntxwv feem ntau yog kab thiab cov duab yooj yim thiab ntawm cov txheej txheej siab dua tuaj yeem yog qhov tshwj xeeb, piv txwv lub cev, cov qauv tshwj xeeb, ib feem ntawm cov tsiaj lossis cov nroj tsuag, thiab lwm yam. Tsiaj, ob lub qhov muag thiab lub qhov ntswg dub? Yuav tsum yog miv! Cov nplooj ntsuab, tsob ntoo ntoo? Zoo li tsob ntoo!

Kuv vam tias koj tau txais lub tswv yim hais txog txoj cai ua haujlwm ntawm CNN tam sim no. Feem ntau cov neural sib sib zog nqus xav tau ntau txhiab tus duab thiab teev sijhawm kawm (nyob ntawm kho vajtse koj siv rau kev qhia) kom "txhim kho" cov lim dej uas muaj txiaj ntsig rau kev lees paub hom khoom koj xav tau. Tab sis muaj qhov luv.

Tus qauv kawm paub kom paub ntau yam khoom sib txawv (miv, dev, khoom siv hauv tsev, thauj mus los, thiab lwm yam) twb muaj ntau cov kev lim dej muaj txiaj ntsig "tsim", yog li peb tsis xav tau nws los kawm paub qhov yooj yim thiab cov khoom ntawm cov khoom dua. Peb tsuas tuaj yeem rov qhia ob peb txheej dhau los ntawm lub network kom paub txog cov chav kawm tshwj xeeb ntawm cov khoom, uas yog qhov tseem ceeb rau peb. Qhov no hu ua "hloov kev kawm". Koj xav tau cov ntaub ntawv qhia tsawg dua thiab suav lub sijhawm nrog kev hloov pauv kev kawm, txij li koj tsuas yog kawm ob peb txheej dhau los ntawm lub network, suav nrog tej zaum ob peb puas lub paj hlwb.

Suab txaus, txoj cai? Cia peb pom yuav ua li cas thiaj siv tau nws.

Kauj Ruam 2: Npaj Koj Ib puag ncig

Npaj Koj Ib puag ncig
Npaj Koj Ib puag ncig

Txhawm rau yog ob txoj hauv kev siv aXeleRate: khiav hauv zos ntawm Ubuntu tshuab lossis hauv Google Colab. Txhawm rau khiav hauv Google Colab, saib qhov piv txwv no:

Kev faib duab duab Colab Phau Ntawv

Kev cob qhia koj tus qauv hauv zos thiab xa tawm nws los siv nrog kho vajtse nrawm kuj tseem yooj yim dua tam sim no.

Kuv qhov chaw ua haujlwm yog Ubuntu 16.04, 64 ntsis. Koj tuaj yeem siv Virtual tshuab los khiav Ubuntu duab txij li peb yuav tsis siv GPU rau kev qhia. Nrog qee qhov kev hloov kho koj kuj tseem tuaj yeem sau cov ntawv qhia ntawm Windows, tab sis rau kev hloov pauv qauv koj yuav xav tau siv Linux system. Yog li, qhov ib puag ncig zoo dua rau koj los ua qhov kev qhia no yog Ubuntu 16.04, khiav ib txwm lossis hauv tshuab virtual.

Cia peb pib los ntawm kev txhim kho Miniconda, uas yog tus saib xyuas ib puag ncig rau Python. Peb yuav tsim ib puag ncig ib leeg, yog li peb yuav tsis hloov pauv ib yam dab tsi hauv koj qhov system Python ib puag ncig.

Rub tawm lub installer ntawm no

Tom qab kev teeb tsa tiav, tsim ib puag ncig tshiab:

conda tsim -n ml python = 3.7

Cia peb qhib qhov chaw tshiab

conda ua kom ml

Cov ntawv ua ntej ua ntej koj lub plhaub bash yuav tshwm nrog lub npe ib puag ncig, qhia tias koj ua haujlwm tam sim no hauv ib puag ncig ntawd.

Kauj Ruam 3: Nruab AXeleRate thiab Khiav Tests

Nruab AXeleRate thiab Khiav Tests
Nruab AXeleRate thiab Khiav Tests

Nruab aXeleRate ntawm koj lub tshuab hauv zos nrog

pip nruab git+https://github.com/AIWintermuteAI/aXeleRate

Txhawm rau rub cov piv txwv khiav:

git clone

Koj tuaj yeem ua qhov ntsuas nrawm nrog tests_training.py hauv aXeleRate nplaub tshev. Nws yuav khiav kev qhia paub thiab kev pom zoo rau txhua hom qauv, txuag thiab hloov cov qauv kev kawm. Txij li nws tsuas yog kev qhia rau 5 lub sijhawm thiab cov ntaub ntawv muaj tsawg heev, koj yuav tsis tuaj yeem tau txais cov qauv muaj txiaj ntsig, tab sis tsab ntawv no tsuas yog siv los tshuaj xyuas qhov tsis ua yuam kev.

Kauj Ruam 4: Rov qhia tus Qauv, Hloov Keras Qauv rau.kmodel

Rov qhia tus Qauv, Hloov Keras Qauv rau.kmodel
Rov qhia tus Qauv, Hloov Keras Qauv rau.kmodel

Rau qhov khoom ua piv txwv no peb yuav qhia tus qauv kom paub txog Santa Claus thiab Arduino Uno. Pom tseeb koj tuaj yeem xaiv lwm chav kawm. Download tau cov ntaub ntawv los ntawm no. Tsim ib daim qauv ntawm classifier.json cov ntaub ntawv hauv cov ntawv tais ceev tseg, tom qab ntawd hloov nws raws li, zoo ib yam rau teeb tsa cov ntawv hauv lub screenshot - nco ntsoov tias txoj hauv kev rau kev qhia thiab daim ntawv pov thawj raug yog qhov tseeb!

Khiav cov lus txib hauv qab no los ntawm aXeleRate nplaub tshev:

nab nab axelerate/train.py - c configs/santa_uno.json

Kev cob qhia yuav pib. Yog tias qhov kev lees paub raug (peb qhov ntsuas ntsuas ntsuas) tsis txhim kho rau 20 lub sijhawm, qhov kev qhia yuav nres ua ntej ntxov. Txhua lub sijhawm kev txheeb xyuas qhov tseeb raug txhim kho, qauv raug khaws tseg hauv cov phiaj xwm phiaj xwm. Tom qab kev kawm tiav, aXeleRate tau hloov pauv tus qauv zoo tshaj plaws rau cov qauv tshwj xeeb - koj tuaj yeem xaiv, "tflite", "k210" lossis "edgetpu" raws li tam sim no.

Kauj Ruam 5: Khiav Tus Qauv ntawm Sipeed Maix Bit

Khiav Tus Qauv ntawm Sipeed Maix Bit
Khiav Tus Qauv ntawm Sipeed Maix Bit
Khiav Tus Qauv ntawm Sipeed Maix Bit
Khiav Tus Qauv ntawm Sipeed Maix Bit
Khiav Tus Qauv ntawm Sipeed Maix Bit
Khiav Tus Qauv ntawm Sipeed Maix Bit

Muaj ob txoj hauv kev los ua qauv uas koj muaj tam sim no ntawm Sipeed Maix kho vajtse: micropython firmware thiab Arduino IDE. Micropython kho vajtse yooj yim dua rau siv, tab sis nws muaj qhov tseem ceeb ntawm kev nco, yog li tsis muaj chaw seem tsawg rau tus qauv. Arduino IDE yog tus lej C, uas muaj txiaj ntsig ntau dua thiab muaj lub cim xeeb me me. Kuv tus qauv tsuas yog 1.9Mb, yog li ob qho kev xaiv ua haujlwm rau nws. Koj tuaj yeem siv cov qauv loj li 2.9 Mb nrog Micropython, rau txhua yam loj dua koj yuav tsum txiav txim siab siv Arduino IDE.

Rub tawm OpenMV IDE los ntawm no thiab tsawg kawg micropython firmware los ntawm no.

Hlawv lub firmware nrog kflash_gui cov cuab yeej. Koj kuj tseem tuaj yeem xaiv hlawv cov qauv kev kawm kom nyem ib yam, raws li tau qhia hauv lub screenshot. Los yog theej nws mus rau SD daim npav (qhov xwm txheej ntawd.kmodel rau lub hauv paus ntawm daim npav SD thiab ntxig daim npav SD rau hauv Sipeed Maix Bit)

Qhib OpenMV IDE thiab nias lub pob txuas. Qhib santa_uno.py tsab ntawv los ntawm example_scripts nplaub tshev thiab nias Start khawm. Koj yuav tsum tau pom lub kwj nyob los ntawm lub koob yees duab thiab yog tias koj qhib Serial Terminal koj yuav pom cov duab saum toj kawg nkaus nrog qhov kev ntseeg siab!

Txhawm rau siv nrog Arduino IDE, ua ntej koj yuav tsum ua raws cov txheej txheem rau ntxiv Sipeed boards rau Arduino IDE, uas tau sau tseg ntawm no. Koj li Arduino IDE version yuav tsum muaj tsawg kawg yog 1.8.12. Tom qab koj ntxiv cov laug cam, qhib lub mobilenet_v1_transfer_learning.ino kos duab thiab xa nws mus rau Sipeed Maix Bit. Hloov lub npe ntawm tus qauv ntawm daim npav SD rau "qauv" (lossis luam daim ntawv nrog lub npe no). Koj tuaj yeem hloov daim ntawv lo npe hauv names.cpp. Nws yuav qhia pom lub koob yees duab nyob ntawm Sipeed Maix npo nrog rau cov txiaj ntsig pom duab saum toj kawg nkaus.

Kauj Ruam 6: Cov lus xaus

Nov yog qee cov ntaub ntawv ntxiv los nyeem ntawm lub ncauj lus ntawm CNNs thiab hloov kev kawm:

Hloov Kev Kawm Siv Mobilenet thiab Keras Cov lus piav qhia zoo ntawm Hloov kev kawm, qhov kev qhia no siv qhov hloov pauv ntawm cov cai los ntawm kab ntawv ntawd.

Miv thiab dev thiab kev sib txuas sib txuas neural piav qhia txog qab CNNs thiab pom qee qhov ntawm cov ntxaij lim dej. Nrog miv!

Qhia, Hloov, Khiav MobileNet ntawm Sipeed MaixPy thiab MaixDuino! Kev qhia los ntawm pab pawg Sipeed yuav ua li cas qhia Mobilenet 1000 chav kawm los ntawm kos (tsis hloov pauv kev kawm). Koj tuaj yeem rub tawm lawv cov qauv kawm ua ntej thiab sim nws!

Vam tias koj tuaj yeem siv kev paub uas koj muaj tam sim no los tsim qee qhov haujlwm txaus nrog lub zeem muag tshuab! Koj tuaj yeem yuav Sipeed boards ntawm no, lawv yog cov kev xaiv uas pheej yig tshaj rau ML ntawm cov kab ke.

Pom zoo: