Update app.py
Browse files
app.py
CHANGED
|
@@ -51,31 +51,24 @@ def predict_category(text):
|
|
| 51 |
category_idx = np.argmax(prediction, axis=1)[0]
|
| 52 |
return label_encoder.inverse_transform([category_idx])[0]
|
| 53 |
|
| 54 |
-
# ✅
|
| 55 |
-
image_path = "
|
| 56 |
|
| 57 |
-
|
| 58 |
-
page_bg_img = f'''
|
| 59 |
<style>
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
background: url("{image_path}") no-repeat center center fixed;
|
| 63 |
background-size: cover;
|
| 64 |
-
|
| 65 |
-
top: 0;
|
| 66 |
-
left: 0;
|
| 67 |
-
width: 100%;
|
| 68 |
-
height: 100%;
|
| 69 |
-
z-index: -1;
|
| 70 |
-
filter: blur(10px); /* Adjust blur intensity */
|
| 71 |
}}
|
| 72 |
-
|
| 73 |
-
|
|
|
|
| 74 |
padding: 20px;
|
| 75 |
border-radius: 10px;
|
| 76 |
}}
|
| 77 |
</style>
|
| 78 |
-
|
| 79 |
|
| 80 |
st.markdown(page_bg_img, unsafe_allow_html=True)
|
| 81 |
|
|
|
|
| 51 |
category_idx = np.argmax(prediction, axis=1)[0]
|
| 52 |
return label_encoder.inverse_transform([category_idx])[0]
|
| 53 |
|
| 54 |
+
# ✅ Set Background Image with Blur Effect
|
| 55 |
+
image_path = "News image 2.png" # Ensure this image is inside the app directory
|
| 56 |
|
| 57 |
+
page_bg_img = f"""
|
|
|
|
| 58 |
<style>
|
| 59 |
+
.stApp {{
|
| 60 |
+
background: url('{image_path}') no-repeat center center fixed;
|
|
|
|
| 61 |
background-size: cover;
|
| 62 |
+
filter: blur(8px); /* Adjust blur level */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 63 |
}}
|
| 64 |
+
|
| 65 |
+
.st-emotion-cache-10trblm {{
|
| 66 |
+
background: rgba(255, 255, 255, 0.8); /* Makes content readable */
|
| 67 |
padding: 20px;
|
| 68 |
border-radius: 10px;
|
| 69 |
}}
|
| 70 |
</style>
|
| 71 |
+
"""
|
| 72 |
|
| 73 |
st.markdown(page_bg_img, unsafe_allow_html=True)
|
| 74 |
|