Rahatara commited on
Commit
9cd5d62
·
verified ·
1 Parent(s): 627a208

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -0
app.py CHANGED
@@ -120,6 +120,23 @@ with gr.Blocks() as app:
120
  outputs=gallery
121
  )
122
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
123
  with gr.Tab("Inpaint Defect"):
124
  image_input = gr.Image(label="Upload Image")
125
  inpaint_prompt_input = gr.Textbox(label="Describe the defect")
 
120
  outputs=gallery
121
  )
122
 
123
+ with gr.Tab("Custom Defect"):
124
+ with gr.Row():
125
+ custom_prompt_input = gr.Textbox(label="Custom Defect")
126
+ number_input_custom = gr.Number(label="Number of images to generate", value=1, minimum=1, maximum=10)
127
+ submit_button_custom = gr.Button("Generate")
128
+ image_outputs_custom = gr.Gallery()
129
+
130
+ def on_submit_click_custom(custom_prompt, number_of_images):
131
+ images = process_railway_defects(custom_prompt, number_of_images)
132
+ return images
133
+
134
+ submit_button_custom.click(
135
+ fn=on_submit_click_custom,
136
+ inputs=[custom_prompt_input, number_input_custom],
137
+ outputs=image_outputs_custom
138
+ )
139
+
140
  with gr.Tab("Inpaint Defect"):
141
  image_input = gr.Image(label="Upload Image")
142
  inpaint_prompt_input = gr.Textbox(label="Describe the defect")