Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -33,20 +33,7 @@ def stream_data(value1,path,value2):
|
|
33 |
|
34 |
|
35 |
disease_classes = ['COPD','Healthy', 'Other']
|
36 |
-
import base64
|
37 |
|
38 |
-
background_image = """
|
39 |
-
<style>
|
40 |
-
[data-testid="stAppViewContainer"] > .main {
|
41 |
-
background-image: url("https://drive.usercontent.google.com/download?id=1zlU0ccwqMWiJON5NnPuD_WrcnJB084GD");
|
42 |
-
background-size: 100vw 100vh; # This sets the size to cover 100% of the viewport width and height
|
43 |
-
background-position: center;
|
44 |
-
background-repeat: no-repeat;
|
45 |
-
}
|
46 |
-
</style>
|
47 |
-
"""
|
48 |
-
|
49 |
-
st.markdown(background_image, unsafe_allow_html=True)
|
50 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
51 |
processor = AutoProcessor.from_pretrained("MIT/ast-finetuned-audioset-10-10-0.4593")
|
52 |
model = ASTModel.from_pretrained("MIT/ast-finetuned-audioset-10-10-0.4593")# audio file is decoded on the fly
|
@@ -76,6 +63,21 @@ def extract_features(path, device):
|
|
76 |
last_hidden_states = outputs.last_hidden_state.squeeze().mean(axis=0).to("cpu").numpy()
|
77 |
return last_hidden_states
|
78 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
79 |
st.title('One-Step Respiratory Disease Classifier using Digital Stethoscope Sound')
|
80 |
|
81 |
|
|
|
33 |
|
34 |
|
35 |
disease_classes = ['COPD','Healthy', 'Other']
|
|
|
36 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
38 |
processor = AutoProcessor.from_pretrained("MIT/ast-finetuned-audioset-10-10-0.4593")
|
39 |
model = ASTModel.from_pretrained("MIT/ast-finetuned-audioset-10-10-0.4593")# audio file is decoded on the fly
|
|
|
63 |
last_hidden_states = outputs.last_hidden_state.squeeze().mean(axis=0).to("cpu").numpy()
|
64 |
return last_hidden_states
|
65 |
|
66 |
+
|
67 |
+
|
68 |
+
|
69 |
+
background_image = """
|
70 |
+
<style>
|
71 |
+
[data-testid="stAppViewContainer"] > .main {
|
72 |
+
background-image: url("https://i.imghippo.com/files/VPJrh1723986413.jpg");
|
73 |
+
background-size: 100vw 100vh; # This sets the size to cover 100% of the viewport width and height
|
74 |
+
background-position: center;
|
75 |
+
background-repeat: no-repeat;
|
76 |
+
}
|
77 |
+
</style>
|
78 |
+
"""
|
79 |
+
|
80 |
+
st.markdown(background_image, unsafe_allow_html=True)
|
81 |
st.title('One-Step Respiratory Disease Classifier using Digital Stethoscope Sound')
|
82 |
|
83 |
|