Spaces:
Runtime error
Runtime error
AbdullaShafeeg
commited on
Commit
·
8cd428d
1
Parent(s):
ab9c217
big update
Browse files
app.py
CHANGED
@@ -11,6 +11,7 @@ import io
|
|
11 |
from scipy.io import wavfile
|
12 |
import pydub
|
13 |
import time
|
|
|
14 |
|
15 |
# MODEL LOADING and INITIALISATION
|
16 |
model = torch.jit.load("snorenetv1_small.ptl")
|
@@ -59,7 +60,12 @@ if uploaded_file is not None:
|
|
59 |
endReached = True
|
60 |
|
61 |
# PERCENTAGE OF SNORING PLOT
|
62 |
-
|
|
|
|
|
|
|
|
|
|
|
63 |
total = snore + other
|
64 |
snore_percentage = (snore / total) * 100
|
65 |
other_percentage = (other / total) * 100
|
|
|
11 |
from scipy.io import wavfile
|
12 |
import pydub
|
13 |
import time
|
14 |
+
import os
|
15 |
|
16 |
# MODEL LOADING and INITIALISATION
|
17 |
model = torch.jit.load("snorenetv1_small.ptl")
|
|
|
60 |
endReached = True
|
61 |
|
62 |
# PERCENTAGE OF SNORING PLOT
|
63 |
+
|
64 |
+
filename = uploaded_file.name
|
65 |
+
cwdir = os.getcwd()
|
66 |
+
file_path = os.path.join(cwdir, filename)
|
67 |
+
|
68 |
+
if os.path.exists(file_path):
|
69 |
total = snore + other
|
70 |
snore_percentage = (snore / total) * 100
|
71 |
other_percentage = (other / total) * 100
|