Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -14,6 +14,22 @@ model = AutoModel.from_pretrained('dhhd255/parkinsons_pred0.1')
|
|
14 |
# Move the model to the device
|
15 |
model = model.to(device)
|
16 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
st.title("Parkinson's Disease Prediction")
|
18 |
|
19 |
uploaded_file = st.file_uploader("Choose an image...", type=["png", "jpg", "jpeg"])
|
@@ -44,6 +60,6 @@ if uploaded_file is not None:
|
|
44 |
logits = feature_reducer(logits)
|
45 |
predicted_class = torch.argmax(logits, dim=1).item()
|
46 |
if(predicted_class == 0):
|
47 |
-
col2.
|
48 |
else:
|
49 |
-
col2.
|
|
|
14 |
# Move the model to the device
|
15 |
model = model.to(device)
|
16 |
|
17 |
+
# Add custom CSS to use the Inter font and define custom classes for healthy and parkinsons results
|
18 |
+
st.markdown("""
|
19 |
+
<style>
|
20 |
+
@import url('https://fonts.googleapis.com/css2?family=Inter&display=swap');
|
21 |
+
body {
|
22 |
+
font-family: 'Inter', sans-serif;
|
23 |
+
}
|
24 |
+
.healthy {
|
25 |
+
color: #007E3F;
|
26 |
+
}
|
27 |
+
.parkinsons {
|
28 |
+
color: #C30000;
|
29 |
+
}
|
30 |
+
</style>
|
31 |
+
""", unsafe_allow_html=True)
|
32 |
+
|
33 |
st.title("Parkinson's Disease Prediction")
|
34 |
|
35 |
uploaded_file = st.file_uploader("Choose an image...", type=["png", "jpg", "jpeg"])
|
|
|
60 |
logits = feature_reducer(logits)
|
61 |
predicted_class = torch.argmax(logits, dim=1).item()
|
62 |
if(predicted_class == 0):
|
63 |
+
col2.markdown('<span class="parkinsons">Predicted class: Parkinson\'s</span>', unsafe_allow_html=True)
|
64 |
else:
|
65 |
+
col2.markdown('<span class="healthy">Predicted class: Healthy</span>', unsafe_allow_html=True)
|