Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -60,12 +60,6 @@ def plot_ui():
|
|
| 60 |
|
| 61 |
@module.server
|
| 62 |
def plot_server(input, output, session, r):
|
| 63 |
-
# opacity = reactive.value(0.5)
|
| 64 |
-
|
| 65 |
-
# @reactive.effect
|
| 66 |
-
# @reactive.event(input.opacity_slider)
|
| 67 |
-
# def _():
|
| 68 |
-
# opacity.set(input.opacity_slider())
|
| 69 |
|
| 70 |
@render.plot
|
| 71 |
def plot_prediction():
|
|
@@ -77,7 +71,7 @@ def plot_server(input, output, session, r):
|
|
| 77 |
# fig.add_axes(ax)
|
| 78 |
|
| 79 |
v = Visualizer(r["image"][:, :, ::-1],
|
| 80 |
-
scale=1, instance_mode=ColorMode.SEGMENTATION, font_size_scale=1)
|
| 81 |
|
| 82 |
colours = []
|
| 83 |
for cls in r["instances"].pred_classes:
|
|
@@ -126,6 +120,7 @@ def server(input, output, session: Session):
|
|
| 126 |
prediction = predictor(im)
|
| 127 |
|
| 128 |
if input.cls_agnostic_nms():
|
|
|
|
| 129 |
prediction = apply_nms(prediction)
|
| 130 |
|
| 131 |
classes = prediction["instances"].pred_classes.tolist()
|
|
|
|
| 60 |
|
| 61 |
@module.server
|
| 62 |
def plot_server(input, output, session, r):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 63 |
|
| 64 |
@render.plot
|
| 65 |
def plot_prediction():
|
|
|
|
| 71 |
# fig.add_axes(ax)
|
| 72 |
|
| 73 |
v = Visualizer(r["image"][:, :, ::-1],
|
| 74 |
+
scale=1.2, instance_mode=ColorMode.SEGMENTATION, font_size_scale=1)
|
| 75 |
|
| 76 |
colours = []
|
| 77 |
for cls in r["instances"].pred_classes:
|
|
|
|
| 120 |
prediction = predictor(im)
|
| 121 |
|
| 122 |
if input.cls_agnostic_nms():
|
| 123 |
+
print(input.cls_agnostic_nms())
|
| 124 |
prediction = apply_nms(prediction)
|
| 125 |
|
| 126 |
classes = prediction["instances"].pred_classes.tolist()
|