DebasishDhal99 commited on
Commit
0dd565d
·
1 Parent(s): f89a787

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -3
app.py CHANGED
@@ -4,7 +4,7 @@ import matplotlib.colors as mcolors
4
  import cv2
5
  import gradio as gr
6
 
7
- from channel_functions import individual_channel_image, channel_distribution_plotter, which_channel_dominates
8
  description1 = '''This tab shows which channel dominates which part of an image\n
9
  Upload an image or drag an online image to the upload section. Bring it to the rectangular area. Release it when the border becomes red'''
10
 
@@ -12,6 +12,9 @@ original_image_plot = gr.Radio(['yes','no'], label = "Do you want the original i
12
  original_image_opacity = gr.Slider(0,1, value = 0.3, label = "Opacity of the original image")
13
  channel_opacity = gr.Slider(0,1, value = 0.7, label = "Opacity of the output channel-domination image")
14
 
 
 
 
15
  iface1 = gr.Interface(
16
  fn = which_channel_dominates,
17
  inputs = [gr.Image(), original_image_plot, original_image_opacity, channel_opacity],
@@ -28,7 +31,13 @@ iface2 = gr.Interface(
28
  description = 'Something random'
29
  )
30
 
 
 
 
 
 
 
 
31
 
32
- combinedInterface = gr.TabbedInterface([iface1, iface2],['Channel domination', 'Channel distribution'])
33
  combinedInterface.launch(share=False)
34
-
 
4
  import cv2
5
  import gradio as gr
6
 
7
+ from channel_functions import individual_channel_image_final, individual_channel_image, channel_distribution_plotter, which_channel_dominates
8
  description1 = '''This tab shows which channel dominates which part of an image\n
9
  Upload an image or drag an online image to the upload section. Bring it to the rectangular area. Release it when the border becomes red'''
10
 
 
12
  original_image_opacity = gr.Slider(0,1, value = 0.3, label = "Opacity of the original image")
13
  channel_opacity = gr.Slider(0,1, value = 0.7, label = "Opacity of the output channel-domination image")
14
 
15
+
16
+ individual_channel_choice = gr.Radio(['Red','Green','Blue', 'All'], label = 'Which channel do you want to see the image in?')
17
+
18
  iface1 = gr.Interface(
19
  fn = which_channel_dominates,
20
  inputs = [gr.Image(), original_image_plot, original_image_opacity, channel_opacity],
 
31
  description = 'Something random'
32
  )
33
 
34
+ iface3 = gr.Interface(
35
+ fn = individual_channel_image_final,
36
+ inputs = [gr.Image(), individual_channel_choice],
37
+ outputs = "image" ,
38
+ title = "Images in individual channels",
39
+ description = "Something random"
40
+ )
41
 
42
+ combinedInterface = gr.TabbedInterface([iface1, iface2, iface3],['Channel domination', 'Channel distribution', "Individual channel"])
43
  combinedInterface.launch(share=False)