Update app.py
Browse files
app.py
CHANGED
|
@@ -162,13 +162,14 @@ class Visualization:
|
|
| 162 |
|
| 163 |
plt.tight_layout()
|
| 164 |
|
| 165 |
-
#
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
|
|
|
| 169 |
plt.close(fig)
|
| 170 |
|
| 171 |
-
return
|
| 172 |
|
| 173 |
def download_dataset():
|
| 174 |
"""Download the dataset using kagglehub"""
|
|
|
|
| 162 |
|
| 163 |
plt.tight_layout()
|
| 164 |
|
| 165 |
+
# Save to BytesIO and convert to PIL Image
|
| 166 |
+
buf = BytesIO()
|
| 167 |
+
fig.savefig(buf, format='png', dpi=100, bbox_inches='tight')
|
| 168 |
+
buf.seek(0)
|
| 169 |
+
img = Image.open(buf)
|
| 170 |
plt.close(fig)
|
| 171 |
|
| 172 |
+
return img
|
| 173 |
|
| 174 |
def download_dataset():
|
| 175 |
"""Download the dataset using kagglehub"""
|