Update app.py
Browse files
app.py
CHANGED
|
@@ -59,8 +59,12 @@ def process_image(images, project_name, project_type):
|
|
| 59 |
output_html += f"<p><strong>Project Record Created:</strong> {project_name} - {dominant_milestone or 'No milestone'} (Highest: {max_percent_complete}%, Average: {average_percent_complete}%, Milestones: {all_milestones_str})</p>"
|
| 60 |
output_html += "</div>"
|
| 61 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 62 |
print("Finished process_image at", datetime.now(pytz.timezone("Asia/Kolkata")).strftime("%Y-%m-%d %H:%M:%S IST"))
|
| 63 |
-
return output_html, "Success", dominant_milestone or "",
|
| 64 |
|
| 65 |
# Gradio UI
|
| 66 |
with gr.Blocks(css="""
|
|
|
|
| 59 |
output_html += f"<p><strong>Project Record Created:</strong> {project_name} - {dominant_milestone or 'No milestone'} (Highest: {max_percent_complete}%, Average: {average_percent_complete}%, Milestones: {all_milestones_str})</p>"
|
| 60 |
output_html += "</div>"
|
| 61 |
|
| 62 |
+
# Fixed confidence score logic
|
| 63 |
+
confidence_scores = [0.90] if not all_percentages else [0.90 for _ in all_milestones] # Default to 0.90
|
| 64 |
+
max_confidence = str(max(confidence_scores))
|
| 65 |
+
|
| 66 |
print("Finished process_image at", datetime.now(pytz.timezone("Asia/Kolkata")).strftime("%Y-%m-%d %H:%M:%S IST"))
|
| 67 |
+
return output_html, "Success", dominant_milestone or "", max_confidence, f"{max_percent_complete}%"
|
| 68 |
|
| 69 |
# Gradio UI
|
| 70 |
with gr.Blocks(css="""
|