Spaces:
Sleeping
Sleeping
Upload 2 files
Browse files- index.html +13 -5
- main.py +5 -3
index.html
CHANGED
|
@@ -2710,11 +2710,13 @@
|
|
| 2710 |
<table class="report-table">
|
| 2711 |
<thead>
|
| 2712 |
<tr>
|
| 2713 |
-
<th style="width:
|
| 2714 |
-
<th style="width:
|
| 2715 |
-
<th style="width: 15%;">
|
| 2716 |
-
<th style="width: 15%;">
|
| 2717 |
-
<th style="width:
|
|
|
|
|
|
|
| 2718 |
</tr>
|
| 2719 |
</thead>
|
| 2720 |
<tbody id="report-items-tbody">
|
|
@@ -4025,6 +4027,12 @@
|
|
| 4025 |
<td data-label="Description">
|
| 4026 |
<span>${item.desc}</span>
|
| 4027 |
</td>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4028 |
<td data-label="Type">
|
| 4029 |
<span class="status-badge ${typeBadgeColor}">
|
| 4030 |
<i data-lucide="${typeIcon}" style="width:14px;height:14px;"></i>
|
|
|
|
| 2710 |
<table class="report-table">
|
| 2711 |
<thead>
|
| 2712 |
<tr>
|
| 2713 |
+
<th style="width: 15%;">Area / Room</th>
|
| 2714 |
+
<th style="width: 25%;">Item & Issue Description</th>
|
| 2715 |
+
<th style="width: 15%;">Before Image</th>
|
| 2716 |
+
<th style="width: 15%;">After Image</th>
|
| 2717 |
+
<th style="width: 10%;">Type</th>
|
| 2718 |
+
<th style="width: 10%;">Severity</th>
|
| 2719 |
+
<th style="width: 10%;">Cost ($)</th>
|
| 2720 |
</tr>
|
| 2721 |
</thead>
|
| 2722 |
<tbody id="report-items-tbody">
|
|
|
|
| 4027 |
<td data-label="Description">
|
| 4028 |
<span>${item.desc}</span>
|
| 4029 |
</td>
|
| 4030 |
+
<td data-label="Before Image" style="text-align: center;">
|
| 4031 |
+
${item.before_crop ? `<img src="${item.before_crop}" style="max-height: 60px; max-width: 100%; border-radius: 4px; object-fit: contain;" alt="Before">` : '<span style="color:#888; font-size: 0.85rem; font-weight: 600;">No Image</span>'}
|
| 4032 |
+
</td>
|
| 4033 |
+
<td data-label="After Image" style="text-align: center;">
|
| 4034 |
+
${item.after_crop ? `<img src="${item.after_crop}" style="max-height: 60px; max-width: 100%; border-radius: 4px; object-fit: contain;" alt="After">` : '<span style="color:#888; font-size: 0.85rem; font-weight: 600;">No Image</span>'}
|
| 4035 |
+
</td>
|
| 4036 |
<td data-label="Type">
|
| 4037 |
<span class="status-badge ${typeBadgeColor}">
|
| 4038 |
<i data-lucide="${typeIcon}" style="width:14px;height:14px;"></i>
|
main.py
CHANGED
|
@@ -396,8 +396,8 @@ async def run_video_report(req: VideoReportRequest):
|
|
| 396 |
# Lazy initialization
|
| 397 |
global _evaluator_instance
|
| 398 |
if '_evaluator_instance' not in globals():
|
| 399 |
-
#
|
| 400 |
-
_evaluator_instance = ApartmentEvaluator(max_size=
|
| 401 |
|
| 402 |
output_dir = os.path.join(DB_DIR, "reports_output")
|
| 403 |
os.makedirs(output_dir, exist_ok=True)
|
|
@@ -440,7 +440,9 @@ async def run_video_report(req: VideoReportRequest):
|
|
| 440 |
"desc": f"{item.get('explanation')} (Match: {item.get('similarity')}%)",
|
| 441 |
"status": mapped_status,
|
| 442 |
"severity": severity,
|
| 443 |
-
"cost": cost
|
|
|
|
|
|
|
| 444 |
}
|
| 445 |
normalized_report.append(normalized_item)
|
| 446 |
|
|
|
|
| 396 |
# Lazy initialization
|
| 397 |
global _evaluator_instance
|
| 398 |
if '_evaluator_instance' not in globals():
|
| 399 |
+
# Increased max_size and fps to improve tracking and avoid hallucination
|
| 400 |
+
_evaluator_instance = ApartmentEvaluator(max_size=512, fps=2.0)
|
| 401 |
|
| 402 |
output_dir = os.path.join(DB_DIR, "reports_output")
|
| 403 |
os.makedirs(output_dir, exist_ok=True)
|
|
|
|
| 440 |
"desc": f"{item.get('explanation')} (Match: {item.get('similarity')}%)",
|
| 441 |
"status": mapped_status,
|
| 442 |
"severity": severity,
|
| 443 |
+
"cost": cost,
|
| 444 |
+
"before_crop": item.get("before_crop"),
|
| 445 |
+
"after_crop": item.get("after_crop")
|
| 446 |
}
|
| 447 |
normalized_report.append(normalized_item)
|
| 448 |
|