xjjak / LapCal

Building gloves that enable typing on a 34-key keyboard without an actual physical keyboard using IMUs and machine learning.
Other
2 stars 0 forks source link

[FEATURE] Modular live preview #15

Closed palisn closed 6 months ago

palisn commented 6 months ago

There is a simple test script reading values and giving live feedback using the explicitly loaded model. This is rather ugly though and I would like to separate the serial input, the feature extraction and prediction. Thus I will add a modular mechanism that includes the serial input but provides interfaces for external feature extraction from the input and the prediction mechanism.

palisn commented 6 months ago

First idea is to separate the live preview into three parts:

  1. A class that reads the input from serial and feeds it to the FeatureExtractor (2.) and requests a prediction from the Model (3.). (LivePreview)
  2. A class that takes the serial input and converts it into features the model can use. This will wait for as much serial input it needs to build a full feature set. (FeatureExtractor)
  3. A class that takes a feature set from the FeatureExtractor and runs its underlying model providing a prediction for the given input. (Model)

The first class should not require any adjustment after it has been established, while the second and third one will have to be customized to the way the input data will be handled and the kind of underlying model. Further, the second and third classes will have to be compatible both in feature dimension and in input semantics.