kebincontreras commited on
Commit
fb712ac
verified
1 Parent(s): 5954157

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +26 -4
app.py CHANGED
@@ -46,11 +46,9 @@ def process_image(image, model_id, image_size, conf_threshold, correction, sat_f
46
 
47
  recon_annotated, recon_detections = yolov10_inference(recon_image_np, model_id, image_size, conf_threshold)
48
 
49
- metrics_clip = calculate_detection_metrics(original_detections, clipped_detections)
50
- metrics_wrap = calculate_detection_metrics(original_detections, wrapped_detections)
51
- metrics_recons = calculate_detection_metrics(original_detections, recon_detections)
52
 
53
- return original_annotated, clipped_annotated, wrapped_annotated, recon_annotated, metrics_clip, metrics_wrap, metrics_recons
 
54
 
55
 
56
 
@@ -144,6 +142,28 @@ def app():
144
  output_wrap = gr.Image(label="Wrapped")
145
  output_recons = gr.Image(label="Reconstructed")
146
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
147
  # A帽adir bot贸n que despliega c贸mo citar el art铆culo en formato BibTeX
148
  def show_bibtex_citation():
149
  bibtex_citation = '''@inproceedings{contreras2024modulo,
@@ -168,6 +188,8 @@ def app():
168
  citation_button.click(show_bibtex_citation, outputs=[citation_text])
169
  copy_button.click(lambda x: x, inputs=citation_text, outputs=citation_text)
170
 
 
 
171
  return demo
172
 
173
 
 
46
 
47
  recon_annotated, recon_detections = yolov10_inference(recon_image_np, model_id, image_size, conf_threshold)
48
 
 
 
 
49
 
50
+
51
+ return original_annotated, clipped_annotated, wrapped_annotated, recon_annotated,
52
 
53
 
54
 
 
142
  output_wrap = gr.Image(label="Wrapped")
143
  output_recons = gr.Image(label="Reconstructed")
144
 
145
+
146
+
147
+
148
+
149
+ process_button.click(
150
+ fn=process_image,
151
+ inputs=[image, model_id, image_size, conf_threshold, correction, sat_factor, kernel_size, DO, t, vertical],
152
+ outputs=[output_original, output_clip, output_wrap, output_recons]
153
+ )
154
+
155
+
156
+
157
+
158
+
159
+
160
+
161
+
162
+
163
+
164
+
165
+
166
+
167
  # A帽adir bot贸n que despliega c贸mo citar el art铆culo en formato BibTeX
168
  def show_bibtex_citation():
169
  bibtex_citation = '''@inproceedings{contreras2024modulo,
 
188
  citation_button.click(show_bibtex_citation, outputs=[citation_text])
189
  copy_button.click(lambda x: x, inputs=citation_text, outputs=citation_text)
190
 
191
+
192
+
193
  return demo
194
 
195