Inference of motion by classify.py in custom folder edge impulse linux sdk

I am using an mpu6050 to get acceleration data to cla@ify hand motion. I have trained the model and deployed to raspberry pi 4 in edge impulse linux sdk but where it will get mpu data. I guess from features.txt file . How to give data to features.txt to classify hand motion.

Project ID: 166082

Hand motion gesture control drone

What tutorial or example are you following?

Regarding Features take a look at this.

i am not using any tutorial right now. I downloaded the .eim model and put it inside edge impulse linux sdk (python) and i also put a features.txt file and ran the classify.py in the custom folder. It wants 375 features so i copied the features from studio of one of the hand motion and pasted it inside the features.txt and it classified it successfully but how to convert the acceleration data of mpu to features live and store it to features.txt repeatedly so that i can classify hand motions live.

Replace the python code that is reading features.txt with something like:

import time
# Collect new data every 16 ms.
INTERVAL_S = 0.016 ← Match to how your Impulse is setup.

# Collect 2 seconds of data at a frequency defined by INTERVAL_MS.
freq =2/INTERVAL_S ← Match to how your Impulse is setup.

features_list=[]

for i in range (int(round(freq,0))):
      accX,accY,accZ = readYourSensor(); <–Depends on what library you are using with your sensor on the RPi.
      features_list.append([accX,accY,accZ]);
      time.sleep(INTERVAL_S);

features = features_list;

2 Likes