Spaces:
Runtime error
Runtime error
PedroMartelleto
commited on
Commit
•
e90a667
1
Parent(s):
35677f0
Deploying to HF
Browse files
app.py
CHANGED
@@ -48,7 +48,7 @@ class Explainer:
|
|
48 |
|
49 |
def convert_fig_to_pil(self, fig):
|
50 |
fig.canvas.draw()
|
51 |
-
data = np.
|
52 |
data = data.reshape(fig.canvas.get_width_height()[::-1] + (3,))
|
53 |
return PIL.Image.fromarray(data)
|
54 |
|
|
|
48 |
|
49 |
def convert_fig_to_pil(self, fig):
|
50 |
fig.canvas.draw()
|
51 |
+
data = np.frombuffer(fig.canvas.tostring_rgb(), dtype=np.uint8, sep='')
|
52 |
data = data.reshape(fig.canvas.get_width_height()[::-1] + (3,))
|
53 |
return PIL.Image.fromarray(data)
|
54 |
|