Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -90,8 +90,9 @@ def predict_and_monitor(version, image):
|
|
| 90 |
plt.savefig(buf, format='png')
|
| 91 |
plt.close()
|
| 92 |
buf.seek(0)
|
| 93 |
-
|
| 94 |
-
|
|
|
|
| 95 |
except Exception as e:
|
| 96 |
# show exception message
|
| 97 |
raise gr.Error(f"Tahmin hatası: {e}")
|
|
|
|
| 90 |
plt.savefig(buf, format='png')
|
| 91 |
plt.close()
|
| 92 |
buf.seek(0)
|
| 93 |
+
# Convert buffer to PIL Image for Gradio
|
| 94 |
+
buf_image = Image.open(buf)
|
| 95 |
+
return pred_dict, metrics, buf_image
|
| 96 |
except Exception as e:
|
| 97 |
# show exception message
|
| 98 |
raise gr.Error(f"Tahmin hatası: {e}")
|