Update app.py
Browse files
app.py
CHANGED
|
@@ -1,6 +1,7 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
import matplotlib.pyplot as plt
|
| 3 |
from io import BytesIO
|
|
|
|
| 4 |
|
| 5 |
# Define the 44 BFI questions
|
| 6 |
questions = [
|
|
@@ -178,7 +179,9 @@ def compute_bfi_scores(*args):
|
|
| 178 |
plt.savefig(buf, format='png')
|
| 179 |
buf.seek(0)
|
| 180 |
plt.close(fig)
|
| 181 |
-
|
|
|
|
|
|
|
| 182 |
|
| 183 |
markdown_output += "### **Trait Scores Visualization**\n\n"
|
| 184 |
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import matplotlib.pyplot as plt
|
| 3 |
from io import BytesIO
|
| 4 |
+
from PIL import Image as PILImage
|
| 5 |
|
| 6 |
# Define the 44 BFI questions
|
| 7 |
questions = [
|
|
|
|
| 179 |
plt.savefig(buf, format='png')
|
| 180 |
buf.seek(0)
|
| 181 |
plt.close(fig)
|
| 182 |
+
# Convert bytes to PIL Image
|
| 183 |
+
image = PILImage.open(buf)
|
| 184 |
+
buf.close()
|
| 185 |
|
| 186 |
markdown_output += "### **Trait Scores Visualization**\n\n"
|
| 187 |
|