Spaces:
Sleeping
Sleeping
File size: 9,433 Bytes
41c0a9e | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
<title>GharScan β Wall Defect Inspector</title>
<link rel="stylesheet" href="/static/styles.css" />
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet" />
</head>
<body>
<!-- ββββββββββββββββββββββββββββββββ -->
<!-- β HEADER β -->
<!-- ββββββββββββββββββββββββββββββββ -->
<header class="site-header">
<div class="header-inner">
<div class="brand">
<span class="brand-icon">ποΈ</span>
<div>
<h1 class="brand-name">GharScan</h1>
<p class="brand-tagline">AI Building Defect Inspector Β· India</p>
</div>
</div>
<div class="model-badge">
<span class="model-dot"></span>
<span class="mono">MiniCPM-V 2.0 Β· 2.8B</span>
</div>
</div>
</header>
<!-- ββββββββββββββββββββββββββββββββ -->
<!-- β CAPTURE ZONE β -->
<!-- ββββββββββββββββββββββββββββββββ -->
<main class="app-main">
<section class="capture-section" id="captureSection">
<p class="section-label mono">// STEP 1 β PHOTOGRAPH THE DEFECT</p>
<div class="capture-card" id="dropZone">
<div class="capture-preview" id="capturePreview">
<div class="capture-placeholder" id="capturePlaceholder">
<span class="placeholder-icon">π·</span>
<p>Point at any crack, stain, or damage on your wall, ceiling, or floor</p>
</div>
<img id="previewImg" class="preview-image hidden" alt="Uploaded defect image" />
</div>
<div class="capture-actions">
<!-- Mobile: opens rear camera directly via capture="environment" -->
<label class="btn btn-primary" for="cameraInput">
<span>πΈ</span> Take Photo
</label>
<input
type="file"
id="cameraInput"
accept="image/*"
capture="environment"
hidden
/>
<label class="btn btn-secondary" for="uploadInput">
<span>π</span> Upload Image
</label>
<input
type="file"
id="uploadInput"
accept="image/jpeg,image/png,image/webp"
hidden
/>
</div>
<div class="language-toggle">
<span class="toggle-label">Output language:</span>
<button class="lang-btn active" data-lang="en" onclick="setLang('en')">English</button>
<button class="lang-btn" data-lang="hi" onclick="setLang('hi')">ΰ€Ήΰ€Ώΰ€ΰ€¦ΰ₯</button>
</div>
</div>
<button class="btn btn-analyze" id="analyzeBtn" disabled onclick="runAnalysis()">
<span id="analyzeBtnIcon">π</span>
<span id="analyzeBtnText">Analyse Defect</span>
</button>
</section>
<!-- ββββββββββββββββββββββββββββββββ -->
<!-- β LOADING STATE β -->
<!-- ββββββββββββββββββββββββββββββββ -->
<section class="loading-section hidden" id="loadingSection">
<div class="loading-card">
<div class="loading-spinner"></div>
<p class="loading-title" id="loadingTitle">Initialising inspectorβ¦</p>
<p class="loading-sub mono" id="loadingSub">Step 1 of 3: Classifying defect type</p>
<div class="loading-steps">
<div class="load-step" id="step1" data-active="true">π Defect Classification</div>
<div class="load-step" id="step2">π Severity Assessment</div>
<div class="load-step" id="step3">βΉ Cost Estimation</div>
</div>
</div>
</section>
<!-- ββββββββββββββββββββββββββββββββ -->
<!-- β INSPECTION REPORT β -->
<!-- ββββββββββββββββββββββββββββββββ -->
<section class="report-section hidden" id="reportSection">
<p class="section-label mono">// INSPECTION REPORT</p>
<!-- Structural risk banner (shown only when is_structural = true) -->
<div class="structural-banner danger hidden" id="structuralBanner">
<span class="banner-icon">β οΈ</span>
<div>
<strong>STRUCTURAL RISK DETECTED</strong>
<p id="structuralReasoning"></p>
</div>
</div>
<!-- Safe banner (shown when is_structural = false) -->
<div class="structural-banner safe hidden" id="safeBanner">
<span class="banner-icon">β
</span>
<strong>Not Structural β No Immediate Safety Risk</strong>
</div>
<!-- Main report card -->
<div class="report-card">
<!-- Header row: defect label + severity chip -->
<div class="report-header">
<div>
<span class="defect-label" id="defectLabel">Settlement Crack</span>
<span class="defect-type-sub mono" id="defectTypeSub"></span>
</div>
<div class="severity-chip" id="severityChip">
<span class="severity-num" id="severityNum">2</span>
<span class="severity-word" id="severityWord">Minor</span>
</div>
</div>
<!-- Severity meter bar -->
<div class="severity-meter-wrap">
<div class="severity-track">
<div class="severity-fill" id="severityFill"></div>
</div>
<div class="severity-ticks">
<span>Cosmetic</span><span></span><span>Moderate</span><span></span><span>Critical</span>
</div>
</div>
<div class="report-divider"></div>
<!-- Description row -->
<div class="report-row">
<span class="row-key mono">WHAT IT IS</span>
<span class="row-val" id="defectDescription"></span>
</div>
<div class="report-row">
<span class="row-key mono">WHY IT HAPPENS</span>
<span class="row-val" id="primaryCause"></span>
</div>
<div class="report-divider"></div>
<!-- Action row (highlighted) -->
<div class="report-row action-highlight">
<span class="row-key mono">WHAT TO DO</span>
<span class="row-val action-text" id="immediateAction"></span>
</div>
<div class="report-row">
<span class="row-key mono">WHEN TO ACT</span>
<span class="row-val urgency-text" id="urgencyDisplay"></span>
</div>
<div class="report-divider"></div>
<!-- Cost + Professional -->
<div class="cost-block">
<div class="cost-main">
<span class="cost-rupee">βΉ</span>
<span class="cost-range" id="costRange"></span>
</div>
<div class="professional-line">
<span class="pro-icon">π·</span>
<span id="professionalDisplay">Licensed Mason</span>
</div>
</div>
<!-- Monsoon risk flag -->
<div class="monsoon-warning hidden" id="monsoonWarning">
π§οΈ <strong>Monsoon Risk:</strong> This defect worsens significantly during heavy rainfall.
Address before June if possible.
</div>
</div><!-- end report-card -->
<!-- Liability disclaimer β ALWAYS shown for Severity 4-5 (Watch-Out 2) -->
<div class="liability-banner hidden" id="liabilityBanner">
<span>β οΈ</span>
<p id="liabilityText"></p>
</div>
<!-- Defect-specific disclaimer -->
<div class="disclaimer-card hidden" id="disclaimerCard">
<p id="disclaimerText"></p>
</div>
<!-- Scan again -->
<button class="btn btn-secondary btn-full" onclick="resetToCapture()">
πΈ Scan Another Defect
</button>
</section><!-- end report-section -->
<!-- ββββββββββββββββββββββββββββββββ -->
<!-- β ERROR STATE β -->
<!-- ββββββββββββββββββββββββββββββββ -->
<section class="error-section hidden" id="errorSection">
<div class="error-card">
<span class="error-icon">π·</span>
<p class="error-title">Analysis Incomplete</p>
<p class="error-msg" id="errorMsg">Please retake the photo with better lighting.</p>
<button class="btn btn-secondary" onclick="resetToCapture()">Try Again</button>
</div>
</section>
</main>
<!-- ββββββββββββββββββββββββββββββββ -->
<!-- β FOOTER β -->
<!-- ββββββββββββββββββββββββββββββββ -->
<footer class="site-footer">
<p class="mono">MiniCPM-V 2.0 by OpenBMB Β· Fine-tuned for Indian residential defects</p>
<p>ποΈ Built for <a href="https://huggingface.co/build-small-hackathon" target="_blank">Build Small Hackathon 2026</a> Β· Track: Backyard AI</p>
<p class="disclaimer-footer">GharScan is a triage aid, not a substitute for professional structural assessment.</p>
</footer>
<script src="/static/app.js" type="module"></script>
</body>
</html>
|