srijaydeshpande commited on
Commit
4f1cad7
·
verified ·
1 Parent(s): dfa1834

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -3
app.py CHANGED
@@ -270,7 +270,7 @@ def segment_image(image):
270
 
271
  return image, legend, stats, superimposed_image
272
 
273
- def superimpose_images(image1, image2, alpha=0.5):
274
 
275
  if image1.dtype != np.uint8:
276
  image1 = (image1 * 255).astype(np.uint8) if image1.max() <= 1 else image1.astype(np.uint8)
@@ -295,12 +295,25 @@ examples = [
295
  ["sample1.png"],
296
  ["sample2.png"]
297
  ]
 
 
 
 
 
 
 
 
 
 
 
 
 
298
 
299
  demo = gr.Interface(
300
  segment_image,
301
  inputs=gr.Image(),
302
- examples=examples,
303
- outputs=["image", "image", "image", "image"],
304
  title="Breast Cancer Semantic Segmentation"
305
  )
306
 
 
270
 
271
  return image, legend, stats, superimposed_image
272
 
273
+ def superimpose_images(image1, image2, alpha=0.8):
274
 
275
  if image1.dtype != np.uint8:
276
  image1 = (image1 * 255).astype(np.uint8) if image1.max() <= 1 else image1.astype(np.uint8)
 
295
  ["sample1.png"],
296
  ["sample2.png"]
297
  ]
298
+
299
+ with gr.Row():
300
+ # First column: Input and first output
301
+ with gr.Column():
302
+ input_image = gr.Image(label="Input Image") # Input image
303
+ output1 = gr.Image(label="Output 1") # First output
304
+
305
+ # Second column: Remaining three outputs
306
+ with gr.Column():
307
+ output2 = gr.Image(label="Output 2") # Second output
308
+ output3 = gr.Image(label="Output 3") # Third output
309
+ output4 = gr.Image(label="Output 4") # Fourth output
310
+
311
 
312
  demo = gr.Interface(
313
  segment_image,
314
  inputs=gr.Image(),
315
+ examples=input_image,
316
+ outputs=[output1, output2, output3, output4],
317
  title="Breast Cancer Semantic Segmentation"
318
  )
319