Commit a26144b2 authored by okiss's avatar okiss
Browse files

Delete preprocessing.py

parent 0fd06fe9
import numpy as np
import torch
import scipy
import pandas as pd
from scipy.io import loadmat
path_EGG='/Users/oki/Master/Deep_Learning/Project/EEG/AA0/'
path_EYE='/Users/oki/Master/Deep_Learning/Project/EYE/AA0/'
EYE=loadmat(path_EYE+'AA0_AS_EYE.mat')['EYE']
def EYE_to_label(EYE,n_width,n_high,name):
w_pixel=800
h_pixel=400
w=(np.arange(n_width)+1)*w_pixel/n_width
h=(np.arange(n_high)+1)*h_pixel/n_high
index=[]
for i in range(np.shape(EYE)[1]):
if EYE[0,i]==0:
continue
if EYE[0,i]!=0 :
index.append(i)
pos1=(EYE[1,i]<w)
x1=np.argmax(pos1)
EYE[1,i]=x1
pos2=(EYE[2,i]<h)
x2=np.argmax(pos2)
EYE[2,i]=x2
data=pd.DataFrame(EYE.T[index,:3])
data.to_csv(path_EYE+name+'.csv')
EYE_to_label(EYE,3,1,'AA0_AS_EY')
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment