kerzel commited on
Commit
4774301
·
1 Parent(s): 19f9fd2

try to fix startup issue

Browse files
Files changed (1) hide show
  1. app.py +2 -31
app.py CHANGED
@@ -136,14 +136,6 @@ def damage_classification(SEM_image,image_threshold, model1_threshold, model2_th
136
 
137
  return image# , image_path, csv_path
138
 
139
-
140
- def get_image_file():
141
- return IMAGE_PATH
142
-
143
- def get_csv_file():
144
- return CSV_PATH
145
-
146
-
147
  ## ---------------------------------------------------------------------------------------------------------------
148
  ## main app interface
149
  ## -----------------------------------------------------------------------------------------------------------------
@@ -170,21 +162,10 @@ with gr.Blocks() as app:
170
  button = gr.Button("Classify")
171
  output_image = gr.Image()
172
 
 
 
173
 
174
 
175
- with gr.Row():
176
- #download_image = gr.DownloadButton(label='Download Image')
177
- #download_csv = gr.DownloadButton(label='Download Damage List')
178
- download_image_btn = gr.DownloadButton(label="Download Image")
179
- download_csv_btn = gr.DownloadButton(label="Download Damage List")
180
- #download_image = gr.File(label='Download Image',interactive=False)
181
- #download_csv = gr.File(label='Download Damage List',interactive=False)
182
-
183
-
184
-
185
- # button.click(damage_classification,
186
- # inputs=[image_input, cluster_threshold_input, model1_threshold_input, model2_threshold_input],
187
- # outputs=[output_image, download_image, download_csv])
188
 
189
  button.click(
190
  damage_classification,
@@ -192,17 +173,7 @@ with gr.Blocks() as app:
192
  outputs=[output_image]
193
  )
194
 
195
- download_image_btn.click(
196
- get_image_file,
197
- inputs=[],
198
- outputs=[download_image_btn]
199
- )
200
 
201
- download_csv_btn.click(
202
- get_csv_file,
203
- inputs=[],
204
- outputs=[download_csv_btn]
205
- )
206
 
207
 
208
 
 
136
 
137
  return image# , image_path, csv_path
138
 
 
 
 
 
 
 
 
 
139
  ## ---------------------------------------------------------------------------------------------------------------
140
  ## main app interface
141
  ## -----------------------------------------------------------------------------------------------------------------
 
162
  button = gr.Button("Classify")
163
  output_image = gr.Image()
164
 
165
+ download_image_btn = gr.DownloadButton(label="Download Image", value=IMAGE_PATH, interactive=False)
166
+ download_csv_btn = gr.DownloadButton(label="Download Damage List", value=CSV_PATH, interactive=False)
167
 
168
 
 
 
 
 
 
 
 
 
 
 
 
 
 
169
 
170
  button.click(
171
  damage_classification,
 
173
  outputs=[output_image]
174
  )
175
 
 
 
 
 
 
176
 
 
 
 
 
 
177
 
178
 
179