kayaen / Finger_Classification

Classify the myo armband data using matlab nntool and use the coefficient of the result of classification as a multiplier to obtain real time result
0 stars 3 forks source link

Problem with python #2

Open atfresh279 opened 7 years ago

atfresh279 commented 7 years ago

Hello, sorry for not responding on the last post, its been really hectic on my end. I did what you said, but still get an similar error.

Python 2.7.13 |Anaconda 4.3.1 (64-bit)| (default, Dec 19 2016, 13:29:36) [MSC v.1500 64 bit (AMD64)] Type "copyright", "credits" or "license" for more information.

IPython 5.1.0 -- An enhanced Interactive Python. ? -> Introduction and overview of IPython's features. %quickref -> Quick reference. help -> Python's own help system. object? -> Details about 'object', use 'object??' for extra details.

runfile('C:/Users/atfre/Downloads/Finger_Classification-master/Finger_Classification-master/data_record.py', wdir='C:/Users/atfre/Downloads/Finger_Classification-master/Finger_Classification-master') Traceback (most recent call last):

File "", line 1, in runfile('C:/Users/atfre/Downloads/Finger_Classification-master/Finger_Classification-master/data_record.py', wdir='C:/Users/atfre/Downloads/Finger_Classification-master/Finger_Classification-master')

File "C:\Users\atfre\Anaconda2\lib\site-packages\spyder\utils\site\sitecustomize.py", line 866, in runfile execfile(filename, namespace)

File "C:\Users\atfre\Anaconda2\lib\site-packages\spyder\utils\site\sitecustomize.py", line 87, in execfile exec(compile(scripttext, filename, 'exec'), glob, loc)

File "C:/Users/atfre/Downloads/Finger_Classification-master/Finger_Classification-master/data_record.py", line 2, in from Myo_python.Myo import MyoRaw

File "Myo_python\Myo.py", line 2, in from bt import BT

File "Myo_python\bt.py", line 1, in import serial

ImportError: No module named serial

atfresh279 commented 7 years ago

UPDATE 4/11/17 I have now fixed this problem by installing pyserial. I seem to have another problem now. After reading the data from rest position and first finger, the connection between Bluetooth and myo band seems to disconnect and it will stop recording the data. There is no error message. Also as soon as I remove the Bluetooth dongle an error message pops up. This is weird because there is no light on the myo band, saying that it is connected.

atfresh279 commented 7 years ago

UPDATE 4/12/17 I figured out how to go around the problem by using my other computer. But now when I run the third program it gives me this error message import pywt; ImportError: No module named pywt thanks

kayaen commented 7 years ago

Hello, in your last case pywt is a library related with the Wavelet transforms. So you can install it by using pip. in iPython console you can type: "!pip install pywt" or "!pip install PyWavelets" without using "

atfresh279 commented 7 years ago

Hi, thanks that worked. I actually got to the end of the process, but the analysis on which finger was moving was not very accurate. Is there a certain teqnique/way I should be recording the data, thanks.

kayaen commented 7 years ago

It is good to hear you achieve to work with code :)
You can try to classify different hand postures. For example, instead of the finger movements, the default 4 movement (fist, finger spread,wave in, wave out) of the myo armband can easily be classified using my code. But some of the other movement cannot be exact as that much. The input signal can be effected various things like human skin, muscle intencity, tiredness... To classify the finger movements, while i was doing movement, i touched to my palm with the my fingertip. So mostly it worked for me, you can also try it but we can not be sure. Can you share with me the result of the your experiment? (will it works or not?)

According the code, it can classify the movements using their wavelet transforms as feature of the signal and NN as a classification algorithm. I am still working on to develop more accurate algorithms. Best regards.