Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -41,12 +41,12 @@ def main():
|
|
| 41 |
|
| 42 |
# Proportional scaling to fit within the target size
|
| 43 |
target_size = (800, 600) # Maximum width and height
|
| 44 |
-
background.thumbnail(target_size, Image.
|
| 45 |
|
| 46 |
except FileNotFoundError:
|
| 47 |
st.sidebar.error(f"Could not find background image '{score}.png'. Using default background.")
|
| 48 |
background = Image.open("default_background.png").convert("RGBA")
|
| 49 |
-
background.thumbnail(target_size, Image.
|
| 50 |
except ValueError:
|
| 51 |
st.sidebar.error(f"Invalid score '{model_data['score']}'. Score must be an integer.")
|
| 52 |
return
|
|
|
|
| 41 |
|
| 42 |
# Proportional scaling to fit within the target size
|
| 43 |
target_size = (800, 600) # Maximum width and height
|
| 44 |
+
background.thumbnail(target_size, Image.Resampling.LANCZOS)
|
| 45 |
|
| 46 |
except FileNotFoundError:
|
| 47 |
st.sidebar.error(f"Could not find background image '{score}.png'. Using default background.")
|
| 48 |
background = Image.open("default_background.png").convert("RGBA")
|
| 49 |
+
background.thumbnail(target_size, Image.Resampling.LANCZOS) # Resize default image proportionally
|
| 50 |
except ValueError:
|
| 51 |
st.sidebar.error(f"Invalid score '{model_data['score']}'. Score must be an integer.")
|
| 52 |
return
|