Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
21_22-J-02
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
21_22-J-02
21_22-J-02
Commits
42e7069c
Commit
42e7069c
authored
Apr 19, 2022
by
NaweenTharuka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated Audio testing file
parent
8d7ce0c8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
10 deletions
+3
-10
Presently/presently/users/audioemotiontest.py
Presently/presently/users/audioemotiontest.py
+3
-10
No files found.
Presently/presently/users/audioemotiontest.py
View file @
42e7069c
...
@@ -18,18 +18,9 @@ import time
...
@@ -18,18 +18,9 @@ import time
from
os
import
path
from
os
import
path
from
pydub
import
AudioSegment
from
pydub
import
AudioSegment
#convert video files to .wav format
# src = input("In: ")
# dst = input("Out: ")
# src = input("F:\\CDAP-PRESENTLY\\21_22-j-02\\Presently\\presently\\users\\media\\video\\22")
# dst = input("F:\\CDAP-PRESENTLY\\21_22-j-02\\Presently\\presently\\users\\media\\audio")
# sound = AudioSegment.from_mp3(src)
# sound.export(dst, format="wav")
saved_model_path
=
"F:
\\
CDAP-PRESENTLY
\\
21_22-j-02
\\
Presently
\\
presently
\\
users
\\
models
\\
model8723.json"
saved_model_path
=
"F:
\\
CDAP-PRESENTLY
\\
21_22-j-02
\\
Presently
\\
presently
\\
users
\\
models
\\
model8723.json"
saved_weights_path
=
"F:
\\
CDAP-PRESENTLY
\\
21_22-j-02
\\
Presently
\\
presently
\\
users
\\
models
\\
model8723_weights.h5"
saved_weights_path
=
"F:
\\
CDAP-PRESENTLY
\\
21_22-j-02
\\
Presently
\\
presently
\\
users
\\
models
\\
model8723_weights.h5"
audio_file
=
"F:
\\
CDAP-PRESENTLY
\\
21_22-j-02
\\
Presently
\\
presently
\\
media
\\
audio
\\
fearful
.wav"
audio_file
=
"F:
\\
CDAP-PRESENTLY
\\
21_22-j-02
\\
Presently
\\
presently
\\
media
\\
audio
\\
publicspeech
.wav"
with
open
(
saved_model_path
,
'r'
)
as
json_file
:
with
open
(
saved_model_path
,
'r'
)
as
json_file
:
json_savedModel
=
json_file
.
read
()
json_savedModel
=
json_file
.
read
()
...
@@ -126,6 +117,7 @@ fig = plt.figure(figsize = (10, 2))
...
@@ -126,6 +117,7 @@ fig = plt.figure(figsize = (10, 2))
plt
.
bar
(
emo_list
,
pred_np
,
color
=
'darkturquoise'
)
plt
.
bar
(
emo_list
,
pred_np
,
color
=
'darkturquoise'
)
plt
.
ylabel
(
"Probabilty (
%
)"
)
plt
.
ylabel
(
"Probabilty (
%
)"
)
plt
.
show
()
plt
.
show
()
print
(
emo_list
,
pred_np
)
max_emo
=
np
.
argmax
(
predictions
)
max_emo
=
np
.
argmax
(
predictions
)
print
(
'max emotion:'
,
emotions
.
get
(
max_emo
,
-
1
))
print
(
'max emotion:'
,
emotions
.
get
(
max_emo
,
-
1
))
...
@@ -145,5 +137,6 @@ plt.bar(emo_list, total_predictions_np, color = 'indigo')
...
@@ -145,5 +137,6 @@ plt.bar(emo_list, total_predictions_np, color = 'indigo')
plt
.
ylabel
(
"Mean probabilty (
%
)"
)
plt
.
ylabel
(
"Mean probabilty (
%
)"
)
plt
.
title
(
"Session Summary"
)
plt
.
title
(
"Session Summary"
)
plt
.
show
()
plt
.
show
()
print
(
emo_list
,
total_predictions
)
print
(
f
"Emotions analyzed for: {(toc - tic):0.4f} seconds"
)
print
(
f
"Emotions analyzed for: {(toc - tic):0.4f} seconds"
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment