Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -112,9 +112,9 @@ def server(input, output, session: Session):
|
|
| 112 |
def plot_prediction():
|
| 113 |
fig, ax = plt.subplots()
|
| 114 |
|
| 115 |
-
ax = plt.Axes(fig, [0., 0., 1., 1.])
|
| 116 |
-
ax.set_axis_off()
|
| 117 |
-
fig.add_axes(ax)
|
| 118 |
|
| 119 |
v = Visualizer(r["image"][:, :, ::-1],
|
| 120 |
scale=1, instance_mode=ColorMode.SEGMENTATION, font_size_scale=1)
|
|
@@ -131,7 +131,7 @@ def server(input, output, session: Session):
|
|
| 131 |
out = v.overlay_instances(masks = r["instances"].pred_masks.to("cpu"),
|
| 132 |
assigned_colors = colours,
|
| 133 |
alpha = input[id]())
|
| 134 |
-
|
| 135 |
ax.imshow(cv2.cvtColor(out.get_image()[:, :, ::-1], cv2.COLOR_BGR2RGB))
|
| 136 |
|
| 137 |
return fig
|
|
|
|
| 112 |
def plot_prediction():
|
| 113 |
fig, ax = plt.subplots()
|
| 114 |
|
| 115 |
+
# ax = plt.Axes(fig, [0., 0., 1., 1.])
|
| 116 |
+
# ax.set_axis_off()
|
| 117 |
+
# fig.add_axes(ax)
|
| 118 |
|
| 119 |
v = Visualizer(r["image"][:, :, ::-1],
|
| 120 |
scale=1, instance_mode=ColorMode.SEGMENTATION, font_size_scale=1)
|
|
|
|
| 131 |
out = v.overlay_instances(masks = r["instances"].pred_masks.to("cpu"),
|
| 132 |
assigned_colors = colours,
|
| 133 |
alpha = input[id]())
|
| 134 |
+
|
| 135 |
ax.imshow(cv2.cvtColor(out.get_image()[:, :, ::-1], cv2.COLOR_BGR2RGB))
|
| 136 |
|
| 137 |
return fig
|