Merge pull request #12 from andreped/linting-fix
Browse files- demo/src/gui.py +8 -5
demo/src/gui.py
CHANGED
@@ -1,7 +1,6 @@
|
|
1 |
import os
|
2 |
|
3 |
import gradio as gr
|
4 |
-
|
5 |
from gradio_shinymodel3d import ShinyModel3D
|
6 |
|
7 |
from .convert import nifti_to_obj
|
@@ -52,7 +51,7 @@ class WebUI:
|
|
52 |
step=1,
|
53 |
label="Which 2D slice to show",
|
54 |
)
|
55 |
-
#self.volume_renderer = gr.Model3D(
|
56 |
self.volume_renderer = ShinyModel3D()
|
57 |
|
58 |
def set_class_name(self, value):
|
@@ -88,7 +87,11 @@ class WebUI:
|
|
88 |
|
89 |
def get_img_pred_pair(self, k):
|
90 |
k = int(k)
|
91 |
-
out = gr.AnnotatedImage(
|
|
|
|
|
|
|
|
|
92 |
return out
|
93 |
|
94 |
def toggle_sidebar(self, state):
|
@@ -108,9 +111,9 @@ class WebUI:
|
|
108 |
autoscroll=True,
|
109 |
elem_id="logs",
|
110 |
show_copy_button=True,
|
111 |
-
#scroll_to_output=False,
|
112 |
container=True,
|
113 |
-
#line_breaks=True,
|
114 |
)
|
115 |
demo.load(read_logs, None, logs, every=1)
|
116 |
|
|
|
1 |
import os
|
2 |
|
3 |
import gradio as gr
|
|
|
4 |
from gradio_shinymodel3d import ShinyModel3D
|
5 |
|
6 |
from .convert import nifti_to_obj
|
|
|
51 |
step=1,
|
52 |
label="Which 2D slice to show",
|
53 |
)
|
54 |
+
# self.volume_renderer = gr.Model3D(
|
55 |
self.volume_renderer = ShinyModel3D()
|
56 |
|
57 |
def set_class_name(self, value):
|
|
|
87 |
|
88 |
def get_img_pred_pair(self, k):
|
89 |
k = int(k)
|
90 |
+
out = gr.AnnotatedImage(
|
91 |
+
self.combine_ct_and_seg(self.images[k], self.pred_images[k]),
|
92 |
+
visible=True,
|
93 |
+
elem_id="model-2d",
|
94 |
+
)
|
95 |
return out
|
96 |
|
97 |
def toggle_sidebar(self, state):
|
|
|
111 |
autoscroll=True,
|
112 |
elem_id="logs",
|
113 |
show_copy_button=True,
|
114 |
+
# scroll_to_output=False,
|
115 |
container=True,
|
116 |
+
# line_breaks=True,
|
117 |
)
|
118 |
demo.load(read_logs, None, logs, every=1)
|
119 |
|