Update index.html
Browse files- index.html +32 -37
index.html
CHANGED
|
@@ -85,7 +85,7 @@
|
|
| 85 |
<div class="text-center mb-8">
|
| 86 |
<div class="w-12 h-12 border-4 border-blue-500/20 border-t-blue-500 rounded-full animate-spin mx-auto mb-6"></div>
|
| 87 |
<p class="text-2xl font-semibold text-gray-100">Analyzing file</p>
|
| 88 |
-
<p class="text-gray-500 mt-2 text-sm">Running
|
| 89 |
</div>
|
| 90 |
<div class="w-full bg-gray-800 rounded-lg h-2.5 overflow-hidden">
|
| 91 |
<div id="progressBar" class="progress-bar bg-blue-600 h-2.5 w-0"></div>
|
|
@@ -98,7 +98,7 @@
|
|
| 98 |
<div class="result-card rounded-2xl p-8 md:p-12">
|
| 99 |
|
| 100 |
<!-- Verdict -->
|
| 101 |
-
<div class="flex items-start mb-
|
| 102 |
<div id="resultIcon" class="w-12 h-12 rounded-lg flex items-center justify-center text-xl mr-4 flex-shrink-0 mt-1"></div>
|
| 103 |
<div>
|
| 104 |
<h3 id="resultTitle" class="text-2xl font-bold text-gray-100"></h3>
|
|
@@ -106,6 +106,9 @@
|
|
| 106 |
</div>
|
| 107 |
</div>
|
| 108 |
|
|
|
|
|
|
|
|
|
|
| 109 |
<!-- Authenticity / Fake scores -->
|
| 110 |
<div class="grid grid-cols-2 gap-4 mb-10">
|
| 111 |
<div class="text-center p-5 bg-gray-900/50 rounded-xl border border-gray-700">
|
|
@@ -118,18 +121,12 @@
|
|
| 118 |
</div>
|
| 119 |
</div>
|
| 120 |
|
| 121 |
-
<!--
|
| 122 |
<div class="mb-10">
|
| 123 |
<h4 class="text-sm font-semibold text-gray-400 uppercase tracking-wider mb-4">Model Breakdown</h4>
|
| 124 |
<div id="modelBreakdown" class="space-y-4"></div>
|
| 125 |
</div>
|
| 126 |
|
| 127 |
-
<!-- ✅ NEW: Raw label breakdown -->
|
| 128 |
-
<div class="mb-10">
|
| 129 |
-
<h4 class="text-sm font-semibold text-gray-400 uppercase tracking-wider mb-4">Label Analysis</h4>
|
| 130 |
-
<div id="labelBreakdown" class="space-y-3"></div>
|
| 131 |
-
</div>
|
| 132 |
-
|
| 133 |
<!-- Forensic details -->
|
| 134 |
<div class="p-5 bg-gray-900/50 rounded-xl border border-gray-700 mb-10 text-sm text-gray-400 space-y-2">
|
| 135 |
<h4 class="text-sm font-semibold text-gray-400 uppercase tracking-wider mb-3">Forensic Details</h4>
|
|
@@ -209,7 +206,7 @@ analyzeBtn.addEventListener('click', async () => {
|
|
| 209 |
|
| 210 |
let progress = 0;
|
| 211 |
const interval = setInterval(() => {
|
| 212 |
-
progress +=
|
| 213 |
if (progress > 90) progress = 90;
|
| 214 |
document.getElementById('progressBar').style.width = progress + '%';
|
| 215 |
document.getElementById('progressText').textContent = progress + '%';
|
|
@@ -247,9 +244,23 @@ function showResults(data) {
|
|
| 247 |
section.scrollIntoView({ behavior: 'smooth' });
|
| 248 |
|
| 249 |
const isAuthentic = data.authenticity > 50;
|
| 250 |
-
|
| 251 |
-
// Verdict
|
| 252 |
const iconEl = document.getElementById('resultIcon');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 253 |
if (isAuthentic) {
|
| 254 |
iconEl.innerHTML = '<i class="fas fa-check text-green-500 text-2xl"></i>';
|
| 255 |
document.getElementById('resultTitle').textContent = 'Authentic Media Detected';
|
|
@@ -260,33 +271,32 @@ function showResults(data) {
|
|
| 260 |
document.getElementById('resultSubtitle').textContent = 'Signs of fabrication detected.';
|
| 261 |
}
|
| 262 |
|
| 263 |
-
//
|
| 264 |
document.getElementById('scoreReal').textContent = Math.round(data.authenticity) + '%';
|
| 265 |
document.getElementById('scoreFake').textContent = Math.round(data.fake) + '%';
|
| 266 |
|
| 267 |
-
//
|
| 268 |
document.getElementById('hashValue').textContent = data.sha256;
|
| 269 |
document.getElementById('metadataRisk').textContent = data.details.metadata_risk;
|
| 270 |
document.getElementById('modelsUsed').textContent = (data.models_used || []).join(', ');
|
| 271 |
|
| 272 |
-
//
|
| 273 |
const modelDiv = document.getElementById('modelBreakdown');
|
| 274 |
modelDiv.innerHTML = '';
|
| 275 |
-
const localScore = data.details.local_score;
|
| 276 |
-
const cloudScore = data.details.cloud_score;
|
| 277 |
-
|
| 278 |
[
|
| 279 |
-
|
| 280 |
-
{ name: 'prithivMLmods Detector', score: data.details.model2_score }
|
|
|
|
| 281 |
].forEach(({ name, score }) => {
|
| 282 |
const isUnavailable = score === 'unavailable' || score === null;
|
| 283 |
const pct = isUnavailable ? 0 : Math.round(score * 100);
|
| 284 |
const color = isUnavailable ? 'bg-gray-600' : score > 0.5 ? 'bg-red-500' : 'bg-green-500';
|
|
|
|
| 285 |
modelDiv.innerHTML += `
|
| 286 |
<div class="p-4 bg-gray-900/50 rounded-xl border border-gray-700">
|
| 287 |
<div class="flex justify-between items-center mb-2">
|
| 288 |
<span class="text-sm text-gray-300 font-medium">${name}</span>
|
| 289 |
-
<span class="text-sm font-bold ${
|
| 290 |
${isUnavailable ? 'Unavailable' : pct + '% fake'}
|
| 291 |
</span>
|
| 292 |
</div>
|
|
@@ -295,22 +305,6 @@ function showResults(data) {
|
|
| 295 |
</div>
|
| 296 |
</div>`;
|
| 297 |
});
|
| 298 |
-
|
| 299 |
-
// ✅ Raw label breakdown from local model
|
| 300 |
-
const labelDiv = document.getElementById('labelBreakdown');
|
| 301 |
-
labelDiv.innerHTML = '';
|
| 302 |
-
const labels = data.details.local_model_labels || {};
|
| 303 |
-
Object.entries(labels).forEach(([label, prob]) => {
|
| 304 |
-
const pct = Math.round(prob * 100);
|
| 305 |
-
labelDiv.innerHTML += `
|
| 306 |
-
<div class="flex items-center gap-3">
|
| 307 |
-
<span class="text-gray-400 text-sm w-32 flex-shrink-0">${label}</span>
|
| 308 |
-
<div class="flex-1 bg-gray-800 rounded-full h-2">
|
| 309 |
-
<div class="bg-blue-500 h-2 rounded-full" style="width: ${pct}%"></div>
|
| 310 |
-
</div>
|
| 311 |
-
<span class="text-gray-300 text-sm w-10 text-right">${pct}%</span>
|
| 312 |
-
</div>`;
|
| 313 |
-
});
|
| 314 |
}
|
| 315 |
|
| 316 |
// ---------------- RESET ----------------
|
|
@@ -323,6 +317,7 @@ function resetUI() {
|
|
| 323 |
analyzeBtn.style.display = '';
|
| 324 |
document.getElementById('progressBar').style.width = '0%';
|
| 325 |
document.getElementById('progressText').textContent = '0%';
|
|
|
|
| 326 |
fileInput.value = '';
|
| 327 |
}
|
| 328 |
</script>
|
|
|
|
| 85 |
<div class="text-center mb-8">
|
| 86 |
<div class="w-12 h-12 border-4 border-blue-500/20 border-t-blue-500 rounded-full animate-spin mx-auto mb-6"></div>
|
| 87 |
<p class="text-2xl font-semibold text-gray-100">Analyzing file</p>
|
| 88 |
+
<p class="text-gray-500 mt-2 text-sm">Running triple-model forensic analysis...</p>
|
| 89 |
</div>
|
| 90 |
<div class="w-full bg-gray-800 rounded-lg h-2.5 overflow-hidden">
|
| 91 |
<div id="progressBar" class="progress-bar bg-blue-600 h-2.5 w-0"></div>
|
|
|
|
| 98 |
<div class="result-card rounded-2xl p-8 md:p-12">
|
| 99 |
|
| 100 |
<!-- Verdict -->
|
| 101 |
+
<div class="flex items-start mb-6">
|
| 102 |
<div id="resultIcon" class="w-12 h-12 rounded-lg flex items-center justify-center text-xl mr-4 flex-shrink-0 mt-1"></div>
|
| 103 |
<div>
|
| 104 |
<h3 id="resultTitle" class="text-2xl font-bold text-gray-100"></h3>
|
|
|
|
| 106 |
</div>
|
| 107 |
</div>
|
| 108 |
|
| 109 |
+
<!-- Confidence warning -->
|
| 110 |
+
<div id="confidenceWarning" class="hidden mb-6 p-4 rounded-xl border text-sm font-medium"></div>
|
| 111 |
+
|
| 112 |
<!-- Authenticity / Fake scores -->
|
| 113 |
<div class="grid grid-cols-2 gap-4 mb-10">
|
| 114 |
<div class="text-center p-5 bg-gray-900/50 rounded-xl border border-gray-700">
|
|
|
|
| 121 |
</div>
|
| 122 |
</div>
|
| 123 |
|
| 124 |
+
<!-- Model Breakdown -->
|
| 125 |
<div class="mb-10">
|
| 126 |
<h4 class="text-sm font-semibold text-gray-400 uppercase tracking-wider mb-4">Model Breakdown</h4>
|
| 127 |
<div id="modelBreakdown" class="space-y-4"></div>
|
| 128 |
</div>
|
| 129 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 130 |
<!-- Forensic details -->
|
| 131 |
<div class="p-5 bg-gray-900/50 rounded-xl border border-gray-700 mb-10 text-sm text-gray-400 space-y-2">
|
| 132 |
<h4 class="text-sm font-semibold text-gray-400 uppercase tracking-wider mb-3">Forensic Details</h4>
|
|
|
|
| 206 |
|
| 207 |
let progress = 0;
|
| 208 |
const interval = setInterval(() => {
|
| 209 |
+
progress += 3;
|
| 210 |
if (progress > 90) progress = 90;
|
| 211 |
document.getElementById('progressBar').style.width = progress + '%';
|
| 212 |
document.getElementById('progressText').textContent = progress + '%';
|
|
|
|
| 244 |
section.scrollIntoView({ behavior: 'smooth' });
|
| 245 |
|
| 246 |
const isAuthentic = data.authenticity > 50;
|
|
|
|
|
|
|
| 247 |
const iconEl = document.getElementById('resultIcon');
|
| 248 |
+
|
| 249 |
+
// confidence warning
|
| 250 |
+
const warningEl = document.getElementById('confidenceWarning');
|
| 251 |
+
if (data.confidence_level === 'low') {
|
| 252 |
+
warningEl.classList.remove('hidden');
|
| 253 |
+
warningEl.className = 'mb-6 p-4 rounded-xl border text-sm font-medium bg-yellow-900/30 border-yellow-700 text-yellow-400';
|
| 254 |
+
warningEl.innerHTML = '<i class="fas fa-triangle-exclamation mr-2"></i>Low confidence — models could not confidently determine authenticity. Result may not be reliable.';
|
| 255 |
+
} else if (data.confidence_level === 'medium') {
|
| 256 |
+
warningEl.classList.remove('hidden');
|
| 257 |
+
warningEl.className = 'mb-6 p-4 rounded-xl border text-sm font-medium bg-blue-900/30 border-blue-700 text-blue-400';
|
| 258 |
+
warningEl.innerHTML = '<i class="fas fa-circle-info mr-2"></i>Medium confidence — result is moderately reliable.';
|
| 259 |
+
} else {
|
| 260 |
+
warningEl.classList.add('hidden');
|
| 261 |
+
}
|
| 262 |
+
|
| 263 |
+
// verdict
|
| 264 |
if (isAuthentic) {
|
| 265 |
iconEl.innerHTML = '<i class="fas fa-check text-green-500 text-2xl"></i>';
|
| 266 |
document.getElementById('resultTitle').textContent = 'Authentic Media Detected';
|
|
|
|
| 271 |
document.getElementById('resultSubtitle').textContent = 'Signs of fabrication detected.';
|
| 272 |
}
|
| 273 |
|
| 274 |
+
// scores
|
| 275 |
document.getElementById('scoreReal').textContent = Math.round(data.authenticity) + '%';
|
| 276 |
document.getElementById('scoreFake').textContent = Math.round(data.fake) + '%';
|
| 277 |
|
| 278 |
+
// forensic details
|
| 279 |
document.getElementById('hashValue').textContent = data.sha256;
|
| 280 |
document.getElementById('metadataRisk').textContent = data.details.metadata_risk;
|
| 281 |
document.getElementById('modelsUsed').textContent = (data.models_used || []).join(', ');
|
| 282 |
|
| 283 |
+
// model breakdown — now 3 models
|
| 284 |
const modelDiv = document.getElementById('modelBreakdown');
|
| 285 |
modelDiv.innerHTML = '';
|
|
|
|
|
|
|
|
|
|
| 286 |
[
|
| 287 |
+
{ name: 'Ateeqq Detector', score: data.details.model1_score },
|
| 288 |
+
{ name: 'prithivMLmods Detector', score: data.details.model2_score },
|
| 289 |
+
{ name: 'Groq Llama 4 Vision', score: data.details.groq_score }
|
| 290 |
].forEach(({ name, score }) => {
|
| 291 |
const isUnavailable = score === 'unavailable' || score === null;
|
| 292 |
const pct = isUnavailable ? 0 : Math.round(score * 100);
|
| 293 |
const color = isUnavailable ? 'bg-gray-600' : score > 0.5 ? 'bg-red-500' : 'bg-green-500';
|
| 294 |
+
const textColor = isUnavailable ? 'text-gray-500' : score > 0.5 ? 'text-red-400' : 'text-green-400';
|
| 295 |
modelDiv.innerHTML += `
|
| 296 |
<div class="p-4 bg-gray-900/50 rounded-xl border border-gray-700">
|
| 297 |
<div class="flex justify-between items-center mb-2">
|
| 298 |
<span class="text-sm text-gray-300 font-medium">${name}</span>
|
| 299 |
+
<span class="text-sm font-bold ${textColor}">
|
| 300 |
${isUnavailable ? 'Unavailable' : pct + '% fake'}
|
| 301 |
</span>
|
| 302 |
</div>
|
|
|
|
| 305 |
</div>
|
| 306 |
</div>`;
|
| 307 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 308 |
}
|
| 309 |
|
| 310 |
// ---------------- RESET ----------------
|
|
|
|
| 317 |
analyzeBtn.style.display = '';
|
| 318 |
document.getElementById('progressBar').style.width = '0%';
|
| 319 |
document.getElementById('progressText').textContent = '0%';
|
| 320 |
+
document.getElementById('confidenceWarning').classList.add('hidden');
|
| 321 |
fileInput.value = '';
|
| 322 |
}
|
| 323 |
</script>
|