Spaces:
Sleeping
Sleeping
Nischal Suresh commited on
Commit ·
04be3e3
1
Parent(s): 4e14437
Updating CSV file
Browse files- app.py +13 -3
- density_veytel.csv +44 -0
app.py
CHANGED
|
@@ -159,6 +159,10 @@ with gr.Blocks() as demo:
|
|
| 159 |
dense_2 = np.where(((textured_cxr<scaled_thresh3) & (textured_cxr>=scaled_thresh2)), textured_cxr, 0)
|
| 160 |
dense_3 = np.where(((textured_cxr<255) & (textured_cxr>=scaled_thresh3)), textured_cxr, 0)
|
| 161 |
# open csv in append mode
|
|
|
|
|
|
|
|
|
|
|
|
|
| 162 |
with gr.Row():
|
| 163 |
with gr.Column():
|
| 164 |
im1 = gr.Image(cxr, label="Original CXR")
|
|
@@ -168,9 +172,7 @@ with gr.Blocks() as demo:
|
|
| 168 |
im3 = gr.Image(lung_noised, label="Synthetic CXR")
|
| 169 |
with gr.Column():
|
| 170 |
label1 = gr.Label("Completed! Please close window", visible=False)
|
| 171 |
-
|
| 172 |
-
button1 = gr.Button(value="Save & continue", visible=True)
|
| 173 |
-
|
| 174 |
with gr.Row():
|
| 175 |
with gr.Column():
|
| 176 |
dense0 = gr.Image(dense_0, label="Dense 0")
|
|
@@ -185,6 +187,11 @@ with gr.Blocks() as demo:
|
|
| 185 |
max_dense_1 = gr.Slider(0, 255, value=100, step = 1, label="Max")
|
| 186 |
max_dense_0.change(set_min_dense_1, inputs=max_dense_0, outputs=[min_dense_1, dense0, dense1]).then(set_min_dense_1, inputs=max_dense_0, outputs=[min_dense_1, dense0, dense1])
|
| 187 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 188 |
with gr.Column():
|
| 189 |
dense2 = gr.Image(dense_2, label="Dense 2")
|
| 190 |
with gr.Row():
|
|
@@ -199,6 +206,9 @@ with gr.Blocks() as demo:
|
|
| 199 |
max_dense_3 = gr.Textbox(value='255', label="Max")
|
| 200 |
max_dense_2.change(set_min_dense_3, inputs=max_dense_2, outputs=[min_dense_3, dense2, dense3]).then(set_min_dense_3, inputs=max_dense_2, outputs=[min_dense_3, dense2, dense3])
|
| 201 |
|
|
|
|
|
|
|
|
|
|
| 202 |
button1.click(new__cxr, inputs = [max_dense_0, max_dense_1, max_dense_2], outputs = [im1, im2, im3, dense0, dense1, dense2, dense3, progress_log])
|
| 203 |
button1.click(change_vis,outputs=[label1, button1])
|
| 204 |
|
|
|
|
| 159 |
dense_2 = np.where(((textured_cxr<scaled_thresh3) & (textured_cxr>=scaled_thresh2)), textured_cxr, 0)
|
| 160 |
dense_3 = np.where(((textured_cxr<255) & (textured_cxr>=scaled_thresh3)), textured_cxr, 0)
|
| 161 |
# open csv in append mode
|
| 162 |
+
# add title
|
| 163 |
+
with gr.Row():
|
| 164 |
+
label_title = gr.Label("VeyTel Density Mapper", visible=True)
|
| 165 |
+
|
| 166 |
with gr.Row():
|
| 167 |
with gr.Column():
|
| 168 |
im1 = gr.Image(cxr, label="Original CXR")
|
|
|
|
| 172 |
im3 = gr.Image(lung_noised, label="Synthetic CXR")
|
| 173 |
with gr.Column():
|
| 174 |
label1 = gr.Label("Completed! Please close window", visible=False)
|
| 175 |
+
|
|
|
|
|
|
|
| 176 |
with gr.Row():
|
| 177 |
with gr.Column():
|
| 178 |
dense0 = gr.Image(dense_0, label="Dense 0")
|
|
|
|
| 187 |
max_dense_1 = gr.Slider(0, 255, value=100, step = 1, label="Max")
|
| 188 |
max_dense_0.change(set_min_dense_1, inputs=max_dense_0, outputs=[min_dense_1, dense0, dense1]).then(set_min_dense_1, inputs=max_dense_0, outputs=[min_dense_1, dense0, dense1])
|
| 189 |
|
| 190 |
+
with gr.Column():
|
| 191 |
+
progress_log = gr.Slider(1, 30, value=1, step = 1, label="progress")
|
| 192 |
+
button1 = gr.Button(value="Save & continue", visible=True)
|
| 193 |
+
|
| 194 |
+
with gr.Row():
|
| 195 |
with gr.Column():
|
| 196 |
dense2 = gr.Image(dense_2, label="Dense 2")
|
| 197 |
with gr.Row():
|
|
|
|
| 206 |
max_dense_3 = gr.Textbox(value='255', label="Max")
|
| 207 |
max_dense_2.change(set_min_dense_3, inputs=max_dense_2, outputs=[min_dense_3, dense2, dense3]).then(set_min_dense_3, inputs=max_dense_2, outputs=[min_dense_3, dense2, dense3])
|
| 208 |
|
| 209 |
+
with gr.Column(): # creting blank image to manage the layout
|
| 210 |
+
blank = gr.Image(np.zeros((512,512)), label="Blank", visible=False)
|
| 211 |
+
|
| 212 |
button1.click(new__cxr, inputs = [max_dense_0, max_dense_1, max_dense_2], outputs = [im1, im2, im3, dense0, dense1, dense2, dense3, progress_log])
|
| 213 |
button1.click(change_vis,outputs=[label1, button1])
|
| 214 |
|
density_veytel.csv
CHANGED
|
@@ -11,3 +11,47 @@ count,thresh_1,thresh_2,thresh_3
|
|
| 11 |
count,thresh_1,thresh_2,thresh_3
|
| 12 |
|
| 13 |
count,thresh_1,thresh_2,thresh_3
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
count,thresh_1,thresh_2,thresh_3
|
| 12 |
|
| 13 |
count,thresh_1,thresh_2,thresh_3
|
| 14 |
+
1,50,100,150
|
| 15 |
+
|
| 16 |
+
count,thresh_1,thresh_2,thresh_3
|
| 17 |
+
|
| 18 |
+
count,thresh_1,thresh_2,thresh_3
|
| 19 |
+
|
| 20 |
+
count,thresh_1,thresh_2,thresh_3
|
| 21 |
+
|
| 22 |
+
count,thresh_1,thresh_2,thresh_3
|
| 23 |
+
|
| 24 |
+
count,thresh_1,thresh_2,thresh_3
|
| 25 |
+
|
| 26 |
+
count,thresh_1,thresh_2,thresh_3
|
| 27 |
+
|
| 28 |
+
count,thresh_1,thresh_2,thresh_3
|
| 29 |
+
|
| 30 |
+
count,thresh_1,thresh_2,thresh_3
|
| 31 |
+
|
| 32 |
+
count,thresh_1,thresh_2,thresh_3
|
| 33 |
+
|
| 34 |
+
count,thresh_1,thresh_2,thresh_3
|
| 35 |
+
|
| 36 |
+
count,thresh_1,thresh_2,thresh_3
|
| 37 |
+
1,50,100,150
|
| 38 |
+
2,50,100,150
|
| 39 |
+
3,50,100,150
|
| 40 |
+
4,50,100,150
|
| 41 |
+
5,50,100,150
|
| 42 |
+
|
| 43 |
+
count,thresh_1,thresh_2,thresh_3
|
| 44 |
+
|
| 45 |
+
count,thresh_1,thresh_2,thresh_3
|
| 46 |
+
|
| 47 |
+
count,thresh_1,thresh_2,thresh_3
|
| 48 |
+
|
| 49 |
+
count,thresh_1,thresh_2,thresh_3
|
| 50 |
+
|
| 51 |
+
count,thresh_1,thresh_2,thresh_3
|
| 52 |
+
|
| 53 |
+
count,thresh_1,thresh_2,thresh_3
|
| 54 |
+
|
| 55 |
+
count,thresh_1,thresh_2,thresh_3
|
| 56 |
+
|
| 57 |
+
count,thresh_1,thresh_2,thresh_3
|