Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1272,6 +1272,35 @@ from PIL import Image
|
|
1272 |
import requests
|
1273 |
from io import BytesIO
|
1274 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1275 |
# Preprocess the uploaded image
|
1276 |
def preprocess_image(uploaded_image):
|
1277 |
image = Image.open(uploaded_image)
|
|
|
1272 |
import requests
|
1273 |
from io import BytesIO
|
1274 |
|
1275 |
+
|
1276 |
+
|
1277 |
+
|
1278 |
+
def set_bg_hack_url():
|
1279 |
+
'''
|
1280 |
+
A function to unpack an image from url and set as bg.
|
1281 |
+
Returns
|
1282 |
+
-------
|
1283 |
+
The background.
|
1284 |
+
'''
|
1285 |
+
st.markdown(
|
1286 |
+
f"""
|
1287 |
+
<style>
|
1288 |
+
.stApp {{
|
1289 |
+
background-image: url("https://images.unsplash.com/photo-1500468415400-191607326b6a?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=2070&q=80");
|
1290 |
+
background-size: 100% 100%;
|
1291 |
+
background-repeat: no-repeat;
|
1292 |
+
background-position: center center;
|
1293 |
+
width: 100%;
|
1294 |
+
height: 100%;
|
1295 |
+
}}
|
1296 |
+
</style>
|
1297 |
+
""",
|
1298 |
+
unsafe_allow_html=True
|
1299 |
+
)
|
1300 |
+
|
1301 |
+
|
1302 |
+
print(set_bg_hack_url())
|
1303 |
+
|
1304 |
# Preprocess the uploaded image
|
1305 |
def preprocess_image(uploaded_image):
|
1306 |
image = Image.open(uploaded_image)
|