Update app.py
Browse files
app.py
CHANGED
@@ -74,7 +74,7 @@ def show_mask_on_image(raw_image, mask, return_image=False):
|
|
74 |
fig = plt.gcf()
|
75 |
fig.canvas.draw()
|
76 |
# Convert plot to image
|
77 |
-
img = np.frombuffer(fig.canvas.
|
78 |
img = img.reshape(fig.canvas.get_width_height()[::-1] + (3,))
|
79 |
img = Image.fromarray(img)
|
80 |
plt.close(fig)
|
|
|
74 |
fig = plt.gcf()
|
75 |
fig.canvas.draw()
|
76 |
# Convert plot to image
|
77 |
+
img = np.frombuffer(fig.canvas.tostring_argb(), dtype=np.uint8)
|
78 |
img = img.reshape(fig.canvas.get_width_height()[::-1] + (3,))
|
79 |
img = Image.fromarray(img)
|
80 |
plt.close(fig)
|