0% found this document useful (0 votes)
19 views14 pages

AI by M5 STICK

Uploaded by

tan.tantham.tan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views14 pages

AI by M5 STICK

Uploaded by

tan.tantham.tan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

AI by M5 STICK

2023 MARCH
SATIT PIM
Prerequisite Hardware &Program
• M5 STICKV AI.CAMERA
• EasyLoader v5.1.2
• MaxiPy IDE
M5 STICKV AI.CAMERA

• Face recognition/detection
• Object detection/classification
• Obtaining size and coordinates of the target in real time
• Obtaining a type of detected target in real time
• Shape recognition
• Game simulator

Getting Started with the M5StickV AI + IOT Camera


Hardware features
• SoC – Kendryte K210 dual-core 64-bit RISC-V processor @ 400MHz
with dual independent double-precision FPU, 8MB on-chip SRAM,
Neural Network Processor (KPU) @ 0.8Tops, Field-Programmable IO
Array (FPIOA), and more
• Storage – 16MB flash, microSD card slot
• Display - 1.14″ SPI display with 240×135 resolution ( ST7789 driver)
• Camera – VGA (640×480) camera via OV7740 sensor
• Audio – MAX98357 mono audio amplifier, speaker
• Sensor – MPU6886 3-axis gyroscope, 3-axis accelerometer
• USB – 1x USB-C port for power and programming
• Misc – Front and side buttons (A / B), power button, RGBW LED
• Expansion – 4-pin “CONNEXT” port
• Power Supply
• 200 mAh battery
• AXP192 PMIC
A more detailed specification
M5StickV K210 AI Camera (Without Wifi)
• GETTING STARTED
How to Burn Firmware on M5StickV
For Windows:
• Using EasyLoader tool
• Check the COM port for
your M5StickV at the Device Manager
of Windows.
Example 1: Display English
Print Hello World example on display of
M5StickV
import lcd
lcd.init()
lcd.draw_string(100, 100, "hello world", lcd.RED,
lcd.BLACK)
Example 2: Display picture
import lcd
import image

img = image.Image("/sd/pic.bmp")
lcd.display(img)

Not every SD card work properly


display picture file on M5StickV
Example 3: Display English by displaying
pictures
import lcd
import image

img = image.Image()
img.draw_string(60, 100, "hello maixpy", scale=2)
lcd.display(img)
Example 4:Display the image captured by
the camera in real time
import sensor, lcd

sensor.reset()
sensor.set_pixformat(sensor.RGB565)
sensor.set_framesize(sensor.QVGA)
sensor.run(1)
sensor.skip_frames()
lcd.init()

while(True):
lcd.display(sensor.snapshot())
ถ้าไม่พบรู ปเรี ยลไทม์ คลิ๊กที่ลูกศรนี้
Example : Display fps
import sensor
import image
import lcd
import time

clock = time.clock()
lcd.init()
sensor.reset()
sensor.set_pixformat(sensor.RGB565)
sensor.set_framesize(sensor.QVGA)
sensor.run(1)
sensor.skip_frames(30)
while True:
clock.tick()
img = sensor.snapshot()
fps =clock.fps()
img.draw_string(2,2, ("%2.1ffps" %(fps)), color=(0,128,0),
scale=2)
lcd.display(img)
Example : Face Detection using M5StickV
import sensor
import image
import KPU as kpu
sensor.reset()
sensor.set_pixformat(sensor.RGB565)
sensor.set_framesize(sensor.QVGA)
sensor.run(1)
task = kpu.load(0x300000)
anchor = (1.889, 2.5245, 2.9465, 3.94056, 3.99987, 5.3658,
5.155437, 6.92275, 6.718375, 9.01025)
a = kpu.init_yolo2(task, 0.5, 0.3, 5, anchor)
while(True):
img = sensor.snapshot()
code = kpu.run_yolo2(task, img)
if code:
for i in code:
print(i)
a = img.draw_rectangle(i.rect())
a = kpu.deinit(task)
• https://www.youtube.com/watch?v=1chWkfX9lpY

You might also like