Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -10,7 +10,17 @@ def classify_audio(filepath):
|
|
10 |
preds = pipe(filepath)
|
11 |
outputs = {}
|
12 |
for p in preds:
|
13 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
return outputs
|
15 |
|
16 |
# Streamlit app layout
|
|
|
10 |
preds = pipe(filepath)
|
11 |
outputs = {}
|
12 |
for p in preds:
|
13 |
+
label = p["label"].replace('_', ' ')
|
14 |
+
# Simplify the labels as required
|
15 |
+
if "artifact" in label:
|
16 |
+
label = "artifact"
|
17 |
+
elif "murmur" in label:
|
18 |
+
label = "murmur"
|
19 |
+
elif "extra" in label:
|
20 |
+
label = "normal"
|
21 |
+
elif "normal" in label:
|
22 |
+
label = "normal"
|
23 |
+
outputs[label] = p["score"]
|
24 |
return outputs
|
25 |
|
26 |
# Streamlit app layout
|