Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -69,10 +69,6 @@ def plot_server(input, output, session, r):
|
|
| 69 |
@render.plot
|
| 70 |
def plot_prediction():
|
| 71 |
fig, ax = plt.subplots()
|
| 72 |
-
|
| 73 |
-
# ax = plt.Axes(fig, [0., 0., 1., 1.])
|
| 74 |
-
ax.set_axis_off()
|
| 75 |
-
# fig.add_axes(ax)
|
| 76 |
|
| 77 |
v = Visualizer(r["image"][:, :, ::-1],
|
| 78 |
scale=1, instance_mode=ColorMode.SEGMENTATION, font_size_scale=1)
|
|
@@ -90,9 +86,13 @@ def plot_server(input, output, session, r):
|
|
| 90 |
assigned_colors = colours,
|
| 91 |
alpha = opacity())
|
| 92 |
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
fig.
|
|
|
|
|
|
|
|
|
|
|
|
|
| 96 |
|
| 97 |
def server(input, output, session: Session):
|
| 98 |
analysis_results = reactive.Value([])
|
|
|
|
| 69 |
@render.plot
|
| 70 |
def plot_prediction():
|
| 71 |
fig, ax = plt.subplots()
|
|
|
|
|
|
|
|
|
|
|
|
|
| 72 |
|
| 73 |
v = Visualizer(r["image"][:, :, ::-1],
|
| 74 |
scale=1, instance_mode=ColorMode.SEGMENTATION, font_size_scale=1)
|
|
|
|
| 86 |
assigned_colors = colours,
|
| 87 |
alpha = opacity())
|
| 88 |
|
| 89 |
+
# ax = plt.Axes(fig, [0., 0., 1., 1.])
|
| 90 |
+
ax.set_axis_off()
|
| 91 |
+
# fig.add_axes(ax)
|
| 92 |
+
|
| 93 |
+
ax.imshow(cv2.cvtColor(out.get_image()[:, :, ::-1], cv2.COLOR_BGR2RGB))
|
| 94 |
+
# fig.canvas.draw()
|
| 95 |
+
# fig.canvas.flush_events()
|
| 96 |
|
| 97 |
def server(input, output, session: Session):
|
| 98 |
analysis_results = reactive.Value([])
|