Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -83,9 +83,10 @@ def process_image(input_img, brightness_threshold=150):
|
|
| 83 |
|
| 84 |
annotated_img_rgb = cv2.cvtColor(annotated_img, cv2.COLOR_BGR2RGB)
|
| 85 |
|
| 86 |
-
|
| 87 |
-
report_text
|
| 88 |
-
|
|
|
|
| 89 |
|
| 90 |
os.unlink(temp_img_file.name)
|
| 91 |
|
|
@@ -99,7 +100,7 @@ iface = gr.Interface(
|
|
| 99 |
],
|
| 100 |
outputs=[
|
| 101 |
gr.Image(type="numpy", label="Annotated Image"),
|
| 102 |
-
gr.Textbox(label="UV Sterilization Report", lines=
|
| 103 |
gr.File(label="Download PDF Report")
|
| 104 |
],
|
| 105 |
title="UV Sterilization Coverage Analyzer",
|
|
|
|
| 83 |
|
| 84 |
annotated_img_rgb = cv2.cvtColor(annotated_img, cv2.COLOR_BGR2RGB)
|
| 85 |
|
| 86 |
+
# Hide extracted texts in output; show only coverage percentage
|
| 87 |
+
report_text = f"UV Sterilization Coverage: {coverage_percent:.2f}%"
|
| 88 |
+
# Optionally include OCR processing time
|
| 89 |
+
# report_text += f"\n\nOCR Processing Time: {ocr_time:.2f} seconds"
|
| 90 |
|
| 91 |
os.unlink(temp_img_file.name)
|
| 92 |
|
|
|
|
| 100 |
],
|
| 101 |
outputs=[
|
| 102 |
gr.Image(type="numpy", label="Annotated Image"),
|
| 103 |
+
gr.Textbox(label="UV Sterilization Report", lines=5),
|
| 104 |
gr.File(label="Download PDF Report")
|
| 105 |
],
|
| 106 |
title="UV Sterilization Coverage Analyzer",
|