Skip to content

Commit

Permalink
🎨 improve structure
Browse files Browse the repository at this point in the history
  • Loading branch information
tongplw committed Jul 9, 2020
1 parent f6091f2 commit b04648b
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 6 deletions.
7 changes: 3 additions & 4 deletions tester.py → dev.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@
import matplotlib.pyplot as plt

from tqdm import tqdm
from muse import MuseMonitor

from src.muse import MuseMonitor

if __name__ == "__main__":

headset = MuseMonitor(debug=True)
df = pd.read_csv('data.csv', header=None).iloc[:, 1:]
df = pd.read_csv('res/data.csv', header=None).iloc[:, 1:]
df.columns = ['delta', 'theta', 'low-alpha', 'high-alpha', 'low-beta', 'high-beta', 'low-gamma', 'mid-gamma']

atts = []
Expand All @@ -19,6 +18,6 @@
waves = df.iloc[i].to_dict()
attention = headset._attention(waves)
atts += [attention]

plt.hist(atts, bins=200)
plt.show()
Empty file added graph.py
Empty file.
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import time
import pandas as pd
from muse import MuseMonitor
from src.muse import MuseMonitor
from datetime import datetime


Expand Down
Empty file added requirements.txt
Empty file.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion muse.py → src/muse.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def __init__(self, server=None, port=None, debug=False):
self._buffer = []
self._attention_buff = [.5, .5, .5, .5, .5]
self._attention_history = []
self.scaler = joblib.load('scaler')
self.scaler = joblib.load('res/scaler')

self.raw = Value('d', 0)
self.attention = Value('d', 0)
Expand Down

0 comments on commit b04648b

Please sign in to comment.