Moved final conclusion tab to the right side of analyze tab
Browse filesFiles changed (2)
- .gitignoreAdded+8
- frontend/pages/analyze.jsx+44-33
12345678# Node / Next.js frontendfrontend/node_modules/frontend/.next/frontend/out/
# Python / venvs (optional, extend as needed)venv/.env100 unmodified lines10110210310410410510610710710810911077 unmodified lines18818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423514 unmodified lines250251252211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241253254255100 unmodified lines </header>
<main className="max-w-7xl mx-auto px-4 py-6 space-y-8 text-emerald-50"> <section className="flex justify-center animate-fade-in-up"> <section className="grid gap-6 lg:grid-cols-[minmax(0,2fr)_minmax(0,1.4fr)] items-start animate-fade-in-up"> <form onSubmit={onSubmit} className="w-full max-w-2xl bg-slate-950 border border-emerald-900 rounded-2xl p-6 md:p-7 shadow-md shadow-emerald-900/40 flex flex-col gap-5 items-stretch text-center md:text-left" className="w-full max-w-2xl bg-slate-950 border border-emerald-900 rounded-2xl p-6 md:p-7 shadow-md shadow-emerald-900/40 flex flex-col gap-5 items-stretch text-center md:text-left mx-auto" > <div className="flex items-center justify-between text-[11px] font-mono text-emerald-300/80"> <span className="uppercase tracking-[0.2em] text-emerald-400/80">Upload & analyze</span>77 unmodified lines </div> </div> </form>
<div className="w-full max-w-md lg:max-w-none mx-auto bg-slate-950 border border-emerald-900 rounded-2xl p-5 shadow-md shadow-emerald-900/40 animate-fade-in-scale"> <h2 className="text-lg font-semibold mb-2">Final conclusion</h2> <p className="text-sm text-emerald-200/80 mb-3">Overall confidence based on all faces found.</p> {result ? ( (() => { const fakeProb = typeof result.final_score === "number" ? result.final_score : 0; const realProb = 1 - fakeProb; const isFake = result.final_label === "fake"; const percent = Math.round((isFake ? fakeProb : realProb) * 100); const labelText = isFake ? "FAKE" : "REAL"; const barColor = isFake ? "bg-red-500" : "bg-emerald-500"; return ( <div className="space-y-3"> <div className="flex items-center justify-between text-xs font-mono text-emerald-200/80"> <span>{labelText} confidence</span> <span>{percent}%</span> </div> <div className="flex items-end gap-4 h-24"> <div className="flex-1 flex items-end justify-center"> <div className="h-full w-4 rounded-full bg-slate-800 overflow-hidden border border-slate-700"> <div className={`${barColor} w-full transition-all`} style={{ height: `${percent}%` }} /> </div> </div> <div className="text-[11px] text-emerald-200/80 space-y-1"> <div>REAL: {realProb.toFixed(3)}</div> <div>FAKE: {fakeProb.toFixed(3)}</div> </div> </div> <p className="text-xs text-emerald-300/80"> Taller bar means stronger confidence that this video is {labelText.toLowerCase()}. </p> </div> ); })() ) : ( <div className="text-sm text-emerald-300/70">Run an analysis to see the final confidence here.</div> )} </div> </section>
{result && (14 unmodified lines /> </div> </div>
<div className="bg-slate-950 border border-emerald-900 rounded-xl p-5 shadow-md shadow-emerald-900/40 animate-fade-in-scale"> <h2 className="text-lg font-semibold mb-2">Final conclusion</h2> <p className="text-sm text-emerald-200/80 mb-3">Overall confidence based on all faces found.</p> {(() => { const fakeProb = typeof result.final_score === "number" ? result.final_score : 0; const realProb = 1 - fakeProb; const isFake = result.final_label === "fake"; const percent = Math.round((isFake ? fakeProb : realProb) * 100); const labelText = isFake ? "FAKE" : "REAL"; const barColor = isFake ? "bg-red-500" : "bg-emerald-500"; return ( <div className="space-y-2"> <div className="flex items-center justify-between text-xs font-mono text-emerald-200/80"> <span>{labelText} confidence</span> <span>{percent}%</span> </div> <div className="h-2 w-full rounded-full bg-slate-800 overflow-hidden"> <div className={`${barColor} h-full transition-all`} style={{ width: `${percent}%` }} /> </div> <p className="text-xs text-emerald-300/80"> This bar shows how strongly the model leans toward {labelText.toLowerCase()} for this video. </p> </div> ); })()} </div> </section> )} </main>.gitignoreAdded+8
frontend/pages/analyze.jsx+44-33