Update app.py
Browse files
app.py
CHANGED
|
@@ -4,6 +4,59 @@ import torch.nn as nn
|
|
| 4 |
from torchvision import transforms, datasets, models
|
| 5 |
from PIL import Image
|
| 6 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
# Title
|
| 8 |
st.title("Brain Tumor Classification")
|
| 9 |
|
|
|
|
| 4 |
from torchvision import transforms, datasets, models
|
| 5 |
from PIL import Image
|
| 6 |
|
| 7 |
+
st.markdown(
|
| 8 |
+
"""
|
| 9 |
+
<style>
|
| 10 |
+
/* Set background image for the entire app */
|
| 11 |
+
.stApp {
|
| 12 |
+
background: url('https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSmgSUM3cbGaWX4tPdO2TGEX0x52TkjyuhfaA&sahttps://wp.technologyreview.com/wp-content/uploads/2023/04/brain-decode2.jpeg') no-repeat center center fixed;
|
| 13 |
+
background-size: cover;
|
| 14 |
+
}
|
| 15 |
+
.stApp h1 {
|
| 16 |
+
background-color: rgba(0, 0, 128, 0.7);
|
| 17 |
+
color: #ffffff;
|
| 18 |
+
padding: 10px;
|
| 19 |
+
border-radius: 5px;
|
| 20 |
+
font-size: 2.2em;
|
| 21 |
+
text-align: center;
|
| 22 |
+
white-space: nowrap; /* Prevents line break */
|
| 23 |
+
overflow: hidden;
|
| 24 |
+
text-overflow: ellipsis;
|
| 25 |
+
max-width: 100%;
|
| 26 |
+
margin: 0 auto;
|
| 27 |
+
}
|
| 28 |
+
/* Style for the button */
|
| 29 |
+
.stButton>button {
|
| 30 |
+
background-color: #4CAF50; /* Green */
|
| 31 |
+
color: white;
|
| 32 |
+
font-size: 1.2em;
|
| 33 |
+
border-radius: 10px;
|
| 34 |
+
padding: 10px 24px;
|
| 35 |
+
border: none;
|
| 36 |
+
}
|
| 37 |
+
/* Center the button */
|
| 38 |
+
.stButton {
|
| 39 |
+
display: flex;
|
| 40 |
+
justify-content: center;
|
| 41 |
+
}
|
| 42 |
+
/* Style for the output container */
|
| 43 |
+
.output-container {
|
| 44 |
+
background-color: lightpink;
|
| 45 |
+
color: black;
|
| 46 |
+
font-size: 1.5em;
|
| 47 |
+
padding: 15px;
|
| 48 |
+
border-radius: 10px;
|
| 49 |
+
margin-top: 20px;
|
| 50 |
+
box-shadow: 0 4px 8px rgba(0,0,0,0.1);
|
| 51 |
+
width: 200%;
|
| 52 |
+
margin-left: auto;
|
| 53 |
+
margin-right: auto;
|
| 54 |
+
text-align: center;
|
| 55 |
+
}
|
| 56 |
+
</style>
|
| 57 |
+
""",
|
| 58 |
+
unsafe_allow_html=True
|
| 59 |
+
)
|
| 60 |
# Title
|
| 61 |
st.title("Brain Tumor Classification")
|
| 62 |
|