Spaces:
Running
Running
fix and info
Browse files- frontend/vehicles.html +111 -34
frontend/vehicles.html
CHANGED
|
@@ -38,6 +38,53 @@
|
|
| 38 |
::-webkit-scrollbar-thumb:hover {
|
| 39 |
background: #94a3b8;
|
| 40 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
</style>
|
| 42 |
</head>
|
| 43 |
|
|
@@ -111,9 +158,12 @@
|
|
| 111 |
|
| 112 |
<!-- Congestion Index -->
|
| 113 |
<div class="col-span-2 bg-white rounded-xl p-5 border border-slate-200 shadow-sm flex flex-col">
|
| 114 |
-
<div class="flex justify-between items-center mb-2">
|
| 115 |
-
<h3 class="font-bold text-slate-900 text-sm">Congestion Index
|
| 116 |
-
|
|
|
|
|
|
|
|
|
|
| 117 |
</div>
|
| 118 |
<div class="flex-1 relative w-full min-h-0">
|
| 119 |
<canvas id="congestionChart"></canvas>
|
|
@@ -151,17 +201,24 @@
|
|
| 151 |
<!-- Vehicle Classification Breakdown -->
|
| 152 |
<div
|
| 153 |
class="col-span-1 bg-white rounded-xl p-5 border border-slate-200 shadow-sm flex flex-col overflow-hidden">
|
| 154 |
-
<div class="flex justify-between items-center mb-1">
|
| 155 |
-
<h3 class="font-bold text-slate-900 text-sm
|
|
|
|
|
|
|
|
|
|
|
|
|
| 156 |
</div>
|
| 157 |
-
<div class="text-[10px] text-slate-400 mb-3">
|
| 158 |
<div class="flex-1 overflow-y-auto pr-3 space-y-2" id="class-breakdown"></div>
|
| 159 |
</div>
|
| 160 |
|
| 161 |
<!-- Class Dominance -->
|
| 162 |
<div class="col-span-2 bg-white rounded-xl p-5 border border-slate-200 shadow-sm flex flex-col">
|
| 163 |
-
<div class="flex justify-between items-center mb-2">
|
| 164 |
-
<h3 class="font-bold text-slate-900 text-sm">Class Dominance
|
|
|
|
|
|
|
|
|
|
| 165 |
<span class="text-[10px] text-slate-500 font-bold uppercase tracking-wider">Grouped
|
| 166 |
Categories</span>
|
| 167 |
</div>
|
|
@@ -172,8 +229,12 @@
|
|
| 172 |
|
| 173 |
<!-- Traffic Flow Over Time -->
|
| 174 |
<div class="col-span-2 bg-white rounded-xl p-5 border border-slate-200 shadow-sm flex flex-col">
|
| 175 |
-
<div class="flex justify-between items-center mb-2">
|
| 176 |
-
<h3 class="font-bold text-slate-900 text-sm">Traffic Flow
|
|
|
|
|
|
|
|
|
|
|
|
|
| 177 |
<span class="text-[10px] text-slate-500 font-bold uppercase tracking-wider">Vehicles / Sec</span>
|
| 178 |
</div>
|
| 179 |
<div class="flex-1 w-full relative min-h-0">
|
|
@@ -239,6 +300,18 @@
|
|
| 239 |
</main>
|
| 240 |
|
| 241 |
<script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 242 |
// =========== Tab switching ===========
|
| 243 |
function switchTab(tab) {
|
| 244 |
document.getElementById('tab-overview').classList.toggle('hidden', tab !== 'overview');
|
|
@@ -256,7 +329,7 @@
|
|
| 256 |
}
|
| 257 |
}
|
| 258 |
|
| 259 |
-
// =========== Run Details
|
| 260 |
function detailRow(label, value, extra) {
|
| 261 |
extra = extra || '';
|
| 262 |
return `<div class="flex justify-between items-center border-b border-slate-50 pb-2">
|
|
@@ -265,6 +338,17 @@
|
|
| 265 |
</div>`;
|
| 266 |
}
|
| 267 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 268 |
function boolBadge(val) {
|
| 269 |
if (val) return `<span class="inline-flex items-center bg-green-50 text-green-700 text-[10px] font-bold px-2 py-0.5 rounded border border-green-200"><i class="fa-solid fa-check mr-1"></i>TRUE</span>`;
|
| 270 |
return `<span class="text-[10px] font-bold text-slate-300">FALSE</span>`;
|
|
@@ -282,8 +366,11 @@
|
|
| 282 |
|
| 283 |
const cpuPct = Math.min(100, Math.round((c.cpu_score / 10) * 100));
|
| 284 |
document.getElementById('panel-perf').innerHTML =
|
| 285 |
-
`<div class="flex justify-between items-center border-b border-slate-50 pb-2">
|
| 286 |
-
<span class="text-xs font-medium text-slate-500 mono-font">cpu_score
|
|
|
|
|
|
|
|
|
|
| 287 |
<div class="flex items-center">
|
| 288 |
<span class="text-sm font-bold text-slate-800 mr-2">${c.cpu_score}</span>
|
| 289 |
<div class="w-16 h-1.5 bg-slate-100 rounded-full overflow-hidden">
|
|
@@ -291,34 +378,24 @@
|
|
| 291 |
</div>
|
| 292 |
</div>
|
| 293 |
</div>` +
|
| 294 |
-
|
| 295 |
-
|
| 296 |
-
`<div class="flex justify-between items-center pt-1">
|
| 297 |
-
<span class="text-xs font-medium text-slate-500 mono-font">realtime_possible</span>
|
| 298 |
-
${boolBadge(c.realtime_possible)}
|
| 299 |
-
</div>`;
|
| 300 |
|
| 301 |
document.getElementById('panel-model').innerHTML =
|
| 302 |
`<div class="flex justify-between items-center border-b border-slate-50 pb-2">
|
| 303 |
<span class="text-xs font-medium text-slate-500 mono-font">model</span>
|
| 304 |
-
<
|
| 305 |
</div>` +
|
| 306 |
detailRow('task', 'detect') +
|
| 307 |
detailRow('tracker', 'ByteTrack');
|
| 308 |
|
| 309 |
document.getElementById('panel-infer').innerHTML =
|
| 310 |
-
|
| 311 |
-
|
| 312 |
-
|
| 313 |
-
|
| 314 |
-
|
| 315 |
-
|
| 316 |
-
<span class="text-[10px] font-bold text-slate-400">TRUE</span>
|
| 317 |
-
</div>` +
|
| 318 |
-
`<div class="flex justify-between items-center border-b border-slate-50 pb-2">
|
| 319 |
-
<span class="text-xs font-medium text-slate-500 mono-font">verbose</span>
|
| 320 |
-
${boolBadge(false)}
|
| 321 |
-
</div>`;
|
| 322 |
}
|
| 323 |
|
| 324 |
// =========== Charts ===========
|
|
@@ -476,8 +553,8 @@
|
|
| 476 |
|
| 477 |
document.getElementById('panel-proc-results').innerHTML =
|
| 478 |
detailRow('processing_time', d.processing_time + ' sec') +
|
| 479 |
-
|
| 480 |
-
|
| 481 |
return;
|
| 482 |
}
|
| 483 |
|
|
|
|
| 38 |
::-webkit-scrollbar-thumb:hover {
|
| 39 |
background: #94a3b8;
|
| 40 |
}
|
| 41 |
+
|
| 42 |
+
.info-wrap {
|
| 43 |
+
position: relative;
|
| 44 |
+
display: inline-flex;
|
| 45 |
+
align-items: center;
|
| 46 |
+
margin-left: 6px;
|
| 47 |
+
}
|
| 48 |
+
|
| 49 |
+
.info-btn {
|
| 50 |
+
display: inline-flex;
|
| 51 |
+
align-items: center;
|
| 52 |
+
justify-content: center;
|
| 53 |
+
width: 15px;
|
| 54 |
+
height: 15px;
|
| 55 |
+
border-radius: 50%;
|
| 56 |
+
background: #94a3b8;
|
| 57 |
+
color: #fff;
|
| 58 |
+
font-size: 8px;
|
| 59 |
+
cursor: default;
|
| 60 |
+
flex-shrink: 0;
|
| 61 |
+
transition: background 0.15s;
|
| 62 |
+
}
|
| 63 |
+
|
| 64 |
+
.info-wrap:hover .info-btn {
|
| 65 |
+
background: #64748b;
|
| 66 |
+
}
|
| 67 |
+
|
| 68 |
+
.info-tip {
|
| 69 |
+
display: none;
|
| 70 |
+
position: fixed;
|
| 71 |
+
z-index: 9999;
|
| 72 |
+
background: #0f172a;
|
| 73 |
+
color: #e2e8f0;
|
| 74 |
+
font-size: 11px;
|
| 75 |
+
font-weight: 400;
|
| 76 |
+
line-height: 1.4;
|
| 77 |
+
padding: 8px 12px;
|
| 78 |
+
border-radius: 8px;
|
| 79 |
+
max-width: 280px;
|
| 80 |
+
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
|
| 81 |
+
white-space: normal;
|
| 82 |
+
pointer-events: none;
|
| 83 |
+
}
|
| 84 |
+
|
| 85 |
+
.info-wrap:hover .info-tip {
|
| 86 |
+
display: block;
|
| 87 |
+
}
|
| 88 |
</style>
|
| 89 |
</head>
|
| 90 |
|
|
|
|
| 158 |
|
| 159 |
<!-- Congestion Index -->
|
| 160 |
<div class="col-span-2 bg-white rounded-xl p-5 border border-slate-200 shadow-sm flex flex-col">
|
| 161 |
+
<div class="flex justify-between items-center mb-2 relative">
|
| 162 |
+
<h3 class="font-bold text-slate-900 text-sm flex items-center">Congestion Index
|
| 163 |
+
<span class="info-wrap"><span class="info-btn"><i class="fa-solid fa-info"></i></span>
|
| 164 |
+
<span class="info-tip">Count of active tracked vehicles visible in each processed
|
| 165 |
+
frame.</span></span>
|
| 166 |
+
</h3>
|
| 167 |
</div>
|
| 168 |
<div class="flex-1 relative w-full min-h-0">
|
| 169 |
<canvas id="congestionChart"></canvas>
|
|
|
|
| 201 |
<!-- Vehicle Classification Breakdown -->
|
| 202 |
<div
|
| 203 |
class="col-span-1 bg-white rounded-xl p-5 border border-slate-200 shadow-sm flex flex-col overflow-hidden">
|
| 204 |
+
<div class="flex justify-between items-center mb-1 relative">
|
| 205 |
+
<h3 class="font-bold text-slate-900 text-sm flex items-center">Classification
|
| 206 |
+
<span class="info-wrap"><span class="info-btn"><i class="fa-solid fa-info"></i></span>
|
| 207 |
+
<span class="info-tip">Per-class vehicle distribution with directional split across the
|
| 208 |
+
counting line.</span></span>
|
| 209 |
+
</h3>
|
| 210 |
</div>
|
| 211 |
+
<div class="text-[10px] text-slate-400 mb-3">By vehicle subclass</div>
|
| 212 |
<div class="flex-1 overflow-y-auto pr-3 space-y-2" id="class-breakdown"></div>
|
| 213 |
</div>
|
| 214 |
|
| 215 |
<!-- Class Dominance -->
|
| 216 |
<div class="col-span-2 bg-white rounded-xl p-5 border border-slate-200 shadow-sm flex flex-col">
|
| 217 |
+
<div class="flex justify-between items-center mb-2 relative">
|
| 218 |
+
<h3 class="font-bold text-slate-900 text-sm flex items-center">Class Dominance
|
| 219 |
+
<span class="info-wrap"><span class="info-btn"><i class="fa-solid fa-info"></i></span>
|
| 220 |
+
<span class="info-tip">Aggregated vehicle count grouped by business category.</span></span>
|
| 221 |
+
</h3>
|
| 222 |
<span class="text-[10px] text-slate-500 font-bold uppercase tracking-wider">Grouped
|
| 223 |
Categories</span>
|
| 224 |
</div>
|
|
|
|
| 229 |
|
| 230 |
<!-- Traffic Flow Over Time -->
|
| 231 |
<div class="col-span-2 bg-white rounded-xl p-5 border border-slate-200 shadow-sm flex flex-col">
|
| 232 |
+
<div class="flex justify-between items-center mb-2 relative">
|
| 233 |
+
<h3 class="font-bold text-slate-900 text-sm flex items-center">Traffic Flow
|
| 234 |
+
<span class="info-wrap"><span class="info-btn"><i class="fa-solid fa-info"></i></span>
|
| 235 |
+
<span class="info-tip">Number of vehicles crossing the counting line, binned per second of
|
| 236 |
+
video duration.</span></span>
|
| 237 |
+
</h3>
|
| 238 |
<span class="text-[10px] text-slate-500 font-bold uppercase tracking-wider">Vehicles / Sec</span>
|
| 239 |
</div>
|
| 240 |
<div class="flex-1 w-full relative min-h-0">
|
|
|
|
| 300 |
</main>
|
| 301 |
|
| 302 |
<script>
|
| 303 |
+
// =========== Tooltip ===========
|
| 304 |
+
// Position tooltip near the icon using fixed positioning to avoid clipping
|
| 305 |
+
document.addEventListener('mouseover', e => {
|
| 306 |
+
const wrap = e.target.closest('.info-wrap');
|
| 307 |
+
if (!wrap) return;
|
| 308 |
+
const tip = wrap.querySelector('.info-tip');
|
| 309 |
+
if (!tip) return;
|
| 310 |
+
const rect = wrap.getBoundingClientRect();
|
| 311 |
+
tip.style.top = (rect.bottom + 6) + 'px';
|
| 312 |
+
tip.style.left = Math.min(rect.left, window.innerWidth - 300) + 'px';
|
| 313 |
+
});
|
| 314 |
+
|
| 315 |
// =========== Tab switching ===========
|
| 316 |
function switchTab(tab) {
|
| 317 |
document.getElementById('tab-overview').classList.toggle('hidden', tab !== 'overview');
|
|
|
|
| 329 |
}
|
| 330 |
}
|
| 331 |
|
| 332 |
+
// =========== Run Details helpers ===========
|
| 333 |
function detailRow(label, value, extra) {
|
| 334 |
extra = extra || '';
|
| 335 |
return `<div class="flex justify-between items-center border-b border-slate-50 pb-2">
|
|
|
|
| 338 |
</div>`;
|
| 339 |
}
|
| 340 |
|
| 341 |
+
function infoRow(label, value, tip, extra) {
|
| 342 |
+
extra = extra || '';
|
| 343 |
+
return `<div class="flex justify-between items-center border-b border-slate-50 pb-2 relative">
|
| 344 |
+
<span class="text-xs font-medium text-slate-500 mono-font flex items-center">${label}
|
| 345 |
+
<span class="info-wrap"><span class="info-btn"><i class="fa-solid fa-info"></i></span>
|
| 346 |
+
<span class="info-tip">${tip}</span></span>
|
| 347 |
+
</span>
|
| 348 |
+
<span class="text-sm font-bold text-slate-800">${value}${extra}</span>
|
| 349 |
+
</div>`;
|
| 350 |
+
}
|
| 351 |
+
|
| 352 |
function boolBadge(val) {
|
| 353 |
if (val) return `<span class="inline-flex items-center bg-green-50 text-green-700 text-[10px] font-bold px-2 py-0.5 rounded border border-green-200"><i class="fa-solid fa-check mr-1"></i>TRUE</span>`;
|
| 354 |
return `<span class="text-[10px] font-bold text-slate-300">FALSE</span>`;
|
|
|
|
| 366 |
|
| 367 |
const cpuPct = Math.min(100, Math.round((c.cpu_score / 10) * 100));
|
| 368 |
document.getElementById('panel-perf').innerHTML =
|
| 369 |
+
`<div class="flex justify-between items-center border-b border-slate-50 pb-2 relative">
|
| 370 |
+
<span class="text-xs font-medium text-slate-500 mono-font flex items-center">cpu_score
|
| 371 |
+
<span class="info-wrap"><span class="info-btn"><i class="fa-solid fa-info"></i></span>
|
| 372 |
+
<span class="info-tip">Available CPU core count used for throughput estimation.</span></span>
|
| 373 |
+
</span>
|
| 374 |
<div class="flex items-center">
|
| 375 |
<span class="text-sm font-bold text-slate-800 mr-2">${c.cpu_score}</span>
|
| 376 |
<div class="w-16 h-1.5 bg-slate-100 rounded-full overflow-hidden">
|
|
|
|
| 378 |
</div>
|
| 379 |
</div>
|
| 380 |
</div>` +
|
| 381 |
+
infoRow('model_fps_est', c.model_fps_est, 'Estimated model inference throughput based on CPU benchmark.', ' <span class="text-xs text-slate-400 font-normal">fps</span>') +
|
| 382 |
+
infoRow('effective_fps', c.effective_fps_est, 'Adjusted throughput accounting for frame stride.', ' <span class="text-xs text-slate-400 font-normal">fps</span>');
|
|
|
|
|
|
|
|
|
|
|
|
|
| 383 |
|
| 384 |
document.getElementById('panel-model').innerHTML =
|
| 385 |
`<div class="flex justify-between items-center border-b border-slate-50 pb-2">
|
| 386 |
<span class="text-xs font-medium text-slate-500 mono-font">model</span>
|
| 387 |
+
<a href="https://huggingface.co/Perception365/VehicleNet-Y26s" target="_blank" class="text-sm font-bold text-blue-600 bg-blue-50 px-2 py-0.5 rounded border border-blue-100 mono-font hover:bg-blue-100 transition">Perception365/VehicleNet-Y26s <i class="fa-solid fa-arrow-up-right-from-square text-[9px] ml-1"></i></a>
|
| 388 |
</div>` +
|
| 389 |
detailRow('task', 'detect') +
|
| 390 |
detailRow('tracker', 'ByteTrack');
|
| 391 |
|
| 392 |
document.getElementById('panel-infer').innerHTML =
|
| 393 |
+
infoRow('imgsz', c.imgsz, 'Input image resolution for model inference.') +
|
| 394 |
+
infoRow('detect_stride', c.detect_stride, 'Frames skipped between consecutive detections.') +
|
| 395 |
+
infoRow('conf', c.conf || 0.12, 'Minimum confidence threshold for valid detections.') +
|
| 396 |
+
infoRow('iou', c.iou || 0.60, 'Intersection-over-Union threshold for non-max suppression.') +
|
| 397 |
+
infoRow('stream', 'TRUE', 'Frame-by-frame processing for constant memory usage.') +
|
| 398 |
+
infoRow('verbose', 'FALSE', 'Console logging suppressed during inference.');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 399 |
}
|
| 400 |
|
| 401 |
// =========== Charts ===========
|
|
|
|
| 553 |
|
| 554 |
document.getElementById('panel-proc-results').innerHTML =
|
| 555 |
detailRow('processing_time', d.processing_time + ' sec') +
|
| 556 |
+
infoRow('actual_fps', d.actual_fps, 'Measured frame throughput during processing.', ' <span class="text-xs text-slate-400 font-normal">fps</span>') +
|
| 557 |
+
infoRow('speed_vs_realtime', d.speed_vs_realtime + 'x', 'Processing speed relative to video playback rate.');
|
| 558 |
return;
|
| 559 |
}
|
| 560 |
|