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