Spaces:
Build error
Build error
Commit
•
92bb01c
1
Parent(s):
7551cd5
update reqs
Browse files- app.py +3 -4
- requirements.txt +2 -1
app.py
CHANGED
@@ -8,13 +8,12 @@ from utils.audio import load_spectrograms
|
|
8 |
from utils.compute_args import compute_args
|
9 |
from utils.tokenize import tokenize, create_dict, sent_to_ix, cmumosei_2, cmumosei_7, pad_feature
|
10 |
from model_LA import Model_LA
|
|
|
11 |
|
12 |
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
|
13 |
|
14 |
-
working_dir = "."
|
15 |
-
|
16 |
# load model
|
17 |
-
ckpts_path =
|
18 |
model_name = "Model_LA_e"
|
19 |
# Listing sorted checkpoints
|
20 |
ckpts = sorted(glob.glob(os.path.join(ckpts_path, model_name,'best*')), reverse=True)
|
@@ -63,7 +62,7 @@ def inference(video_path, text):
|
|
63 |
pred = net(x, y, z).cpu().data.numpy()
|
64 |
label_to_ix = ['happy', 'sad', 'angry', 'fear', 'disgust', 'surprise']
|
65 |
result_dict = dict(zip(label_to_ix, pred[0]))
|
66 |
-
return
|
67 |
|
68 |
|
69 |
title="Emotion Recognition"
|
|
|
8 |
from utils.compute_args import compute_args
|
9 |
from utils.tokenize import tokenize, create_dict, sent_to_ix, cmumosei_2, cmumosei_7, pad_feature
|
10 |
from model_LA import Model_LA
|
11 |
+
import gradio as gr
|
12 |
|
13 |
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
|
14 |
|
|
|
|
|
15 |
# load model
|
16 |
+
ckpts_path = 'ckpt'
|
17 |
model_name = "Model_LA_e"
|
18 |
# Listing sorted checkpoints
|
19 |
ckpts = sorted(glob.glob(os.path.join(ckpts_path, model_name,'best*')), reverse=True)
|
|
|
62 |
pred = net(x, y, z).cpu().data.numpy()
|
63 |
label_to_ix = ['happy', 'sad', 'angry', 'fear', 'disgust', 'surprise']
|
64 |
result_dict = dict(zip(label_to_ix, pred[0]))
|
65 |
+
return result_dict
|
66 |
|
67 |
|
68 |
title="Emotion Recognition"
|
requirements.txt
CHANGED
@@ -1,2 +1,3 @@
|
|
1 |
https://github.com/explosion/spacy-models/releases/download/en_vectors_web_lg-2.1.0/en_vectors_web_lg-2.1.0.tar.gz
|
2 |
-
torch==1.9.1
|
|
|
|
1 |
https://github.com/explosion/spacy-models/releases/download/en_vectors_web_lg-2.1.0/en_vectors_web_lg-2.1.0.tar.gz
|
2 |
+
torch==1.9.1
|
3 |
+
librosa
|