How to identify the number of certain movements from the sensor data with Python SDK?

Hi,

I’m making a gym training app and I’m trying to figure out how to detect the number of repetitions from the saved accelerometer data. I’m using Python SDK and .eim file. The problem is that I can only give the model a certain amount of data and it usually doesn’t correspond to the number of repetitions done, because the repetitions can start and end at any point in the exercise.

For example, from this sample I would like to recognize that there are 4 repetitions:
bench

There is a way I try. I’m be able to get only very rough results:

data = [9.76,-0.83,1.11,9.75,-0.82,1.12 … ]

while len(data) == 0:

# Takes length of the data that the model requires
expected_feature_count = model_info['model_parameters']['input_features_count']
chunk = features[:expected_feature_count]

# Remove a chunk from original data
features = features[expected_feature_count:]

# The last chunk is filled with zeros
if len(chunk) < expected_feature_count:
    while len(chunk) < expected_feature_count:
        chunk.append(0)

result = runner.classify(chunk)

# If the chunk matches the bench press, the variable is increased
if result['result']['classification']["bench_press"] > 0.8:
    bench_press_count += 1