I made a watch to your movement and cheer.
My name is Cheering watch!!
Imaging acceleration dataThe acceleration of M5StickV is imaged.Acceleration is entered in 8x8 RGB with x = R, y = G, z = B.This is necessary because KPU only supports images.
The data output from the MPU needs to be converted because the minus is a complement.
accel = i2c.readfrom_mem(MPU6886_ADDRESS, MPU6886_ACCEL_XOUT_H, 6)
accel_x = (accel[0]<<8|accel[1])
accel_y = (accel[2]<<8|accel[3])
accel_z = (accel[4]<<8|accel[5])
if accel_x>32768:
accel_x=accel_x-65536
if accel_y>32768:
accel_y=accel_y-65536
if accel_z>32768:
accel_z=accel_z-65536
The dynamic motion of acceleration appears as moire.After proceeding 8 dots in the X direction, proceed in the Y dot direction.Interference fringes occur due to the number of vertical and horizontal pixels in the image, the sampling rate of the sensor, and the periodicity of hand movement.
Save image data to SD card.
Install TensorFlow / Keras for Ubuntu
This session use Ubuntu18.04 or Windows Subsystem for Linux.
Install Miniconda and create a Python environment. The Miniconda installer is downloaded from the Miniconda website.
Miniconda:https://docs.conda.io/en/latest/miniconda.html
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
sh https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
Install Python, TensorFlow, Keras, etc. on Miniconda.
conda create -n ml python=3.6 tensorflow=1.14 keras pillow \
numpy pydot graphviz
Activate conda.
conda activate ml
Install kendryte nncasenncase converts learning data created with Keras or TensorFlow into KPU learning data kmodels.
nncase github: https://github.com/kendryte/nncase/
mkdir ./ncc
cd ./ncc
wget https://github.com/kendryte/nncase/releases/download/v0.1.0-rc5/
ncc-linux-x86_64.tar.xz
tar -Jxf ncc-linux-x86_64.tar.xz
Keras learningA model of acceleration is created by deep learning. Acceleration images are classified into M5StickV SD cards for each activity. Learn with Keras from classification and images at CNN. The learning results are saved with Kmodel.
Run the PYTHON program on Ubuntu as follows command.
python keras_motion_larning_191030.py
https://github.com/anoken/CheeringWatch_M5StickC-V/blob/master/keras/keras_motion_larning_191030.py
"my_model.kmodel"file named A is generated.
Kflash GUIWrite m5stickv firmware and kmodel with tools.
A friendly face is displayed to help you.This face rotates like a gimbal to the tilt. In addition, audio is output according to the motion.
m5stickv cannot be connected to the Internet. So connect it to M5StickC and connect to the Internet. Send motion data to an ambient cloud service in Japan.
The m5stickc software creates programming with arduino.Receive from URT and send to AMBIENT.It also gets the current time from the network and displays the time.
Comments