Skip to content

Commit 4dfb78f

Browse files
author
alice.e.baird@gmail.com
committed
model fix
1 parent e22b677 commit 4dfb78f

File tree

3 files changed

+57
-8
lines changed

3 files changed

+57
-8
lines changed

live_prediction_send_osc.py

+5-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# emoIntercept - classify audio emotion
2-
# aeb 2019
1+
# classify audio - wind or no wind
2+
33

44
#librosa == 0.5.1
55

@@ -17,11 +17,10 @@
1717
warnings.simplefilter(action='ignore', category=FutureWarning)
1818
warnings.simplefilter(action='ignore', category=DeprecationWarning)
1919

20-
ifttt_event = 'Emointerception | aeb2019'
20+
ifttt_event = 'wind or no wind | brahman'
2121
ifttt_key = '*********************'
2222
ifttt_url = 'https://maker.ifttt.com/trigger/{event}/with/key/{key}'.format(
2323
event=ifttt_event, key=ifttt_key)
24-
2524
def make_web_request(label):
2625
data = {}
2726
data['value1'] = label
@@ -32,7 +31,7 @@ def make_web_request(label):
3231
print('Failed to make a web request')
3332

3433

35-
sr = 16000
34+
sr = 16000 # make sure this is same as trained audio
3635
chunk = 1 * sr
3736
ffs_sz = 256
3837
threshold = 0.2
@@ -83,7 +82,7 @@ def make_web_request(label):
8382
predictions_in_60_sec = np.vstack([predictions_in_60_sec, predictions])
8483
count = count + 1
8584

86-
# ~ here for osc message
85+
#here for sending osc message
8786
if LABELS[predictions_mean.argmax()] == 'wind':
8887
print('its windy!')
8988
from oscpy.client import OSCClient
@@ -95,7 +94,6 @@ def make_web_request(label):
9594
print('osc sending')
9695

9796

98-
# ~ print(LABELS[predictions_mean.argmax()])
9997
elapsed_time = time.time() - start
10098

10199
localtime = '{0.tm_hour:02d}:{0.tm_min:02d}:{0.tm_sec:02d}'.format(

requirements.txt

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
absl-py==0.9.0
2+
astor==0.8.1
3+
audioread==2.1.8
4+
cachetools==4.0.0
5+
certifi==2019.11.28
6+
chardet==3.0.4
7+
decorator==4.4.2
8+
gast==0.2.2
9+
get==2019.4.13
10+
google-auth==1.11.2
11+
google-auth-oauthlib==0.4.1
12+
google-pasta==0.1.8
13+
grpcio==1.27.2
14+
h5py==2.10.0
15+
idna==2.9
16+
joblib==0.14.1
17+
Keras==2.3.1
18+
Keras-Applications==1.0.8
19+
Keras-Preprocessing==1.1.0
20+
librosa==0.5.1
21+
llvmlite==0.31.0
22+
Markdown==3.2.1
23+
numba==0.48.0
24+
numpy==1.18.1
25+
oauthlib==3.1.0
26+
opt-einsum==3.2.0
27+
oscpy==0.5.0
28+
post==2019.4.13
29+
protobuf==3.11.3
30+
public==2019.4.13
31+
pyasn1==0.4.8
32+
pyasn1-modules==0.2.8
33+
PyAudio==0.2.11
34+
PyYAML==5.3
35+
query-string==2019.4.13
36+
request==2019.4.13
37+
requests==2.23.0
38+
requests-oauthlib==1.3.0
39+
resampy==0.2.2
40+
rsa==4.0
41+
scikit-learn==0.22.2.post1
42+
scipy==1.4.1
43+
six==1.14.0
44+
sockets==1.0.0
45+
tensorboard==2.1.1
46+
tensorflow==2.1.0
47+
tensorflow-estimator==2.1.0
48+
termcolor==1.1.0
49+
urllib3==1.25.8
50+
Werkzeug==1.0.0
51+
wrapt==1.12.0

trainmodel.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
warnings.simplefilter(action='ignore', category=FutureWarning)
1414

15-
SAMPLING_RATE = 44000
15+
SAMPLING_RATE = 16000
1616
FFT_SIZE = 256
1717
STFT_MATRIX_SIZE = 1 + FFT_SIZE // 2
1818

0 commit comments

Comments
 (0)