FALCON / web_ui.go
st3v3x's picture
Actualizar nodo OmniVision
3b7a5fe verified
Raw History Blame Contribute Delete
13.3 kB
package main
import "fmt"
func renderAIStudioHTML(cores int) string {
return fmt.Sprintf(`<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>OmniVision AI β€” Neural Media Studio</title>
<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='.9em' font-size='90'>🧠</text></svg>">
<style>
:root {
--bg: #090d16;
--card: #111827;
--card-border: #1f293d;
--text: #f1f5f9;
--text-muted: #94a3b8;
--primary: #6366f1;
--primary-hover: #4f46e5;
--accent: #8b5cf6;
--success: #10b981;
--code-bg: #030712;
}
* { box-sizing: border-box; margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
body { background: var(--bg); color: var(--text); min-height: 100vh; display: flex; flex-direction: column; }
header { background: rgba(17, 24, 39, 0.85); backdrop-filter: blur(12px); border-bottom: 1px solid var(--card-border); padding: 1rem 2rem; position: sticky; top: 0; z-index: 50; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 0.75rem; font-weight: 700; font-size: 1.25rem; letter-spacing: -0.025em; }
.brand-icon { width: 32px; height: 32px; background: linear-gradient(135deg, var(--primary), var(--accent)); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; }
.status-badge { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8rem; background: rgba(16, 185, 129, 0.1); color: var(--success); border: 1px solid rgba(16, 185, 129, 0.25); padding: 0.35rem 0.75rem; border-radius: 9999px; font-weight: 600; }
.status-dot { width: 8px; height: 8px; background: var(--success); border-radius: 50%%; box-shadow: 0 0 8px var(--success); }
main { max-width: 1100px; margin: 2rem auto; padding: 0 1.5rem; width: 100%%; flex: 1; }
.hero { text-align: center; margin-bottom: 2.5rem; }
.hero h1 { font-size: 2.5rem; font-weight: 800; letter-spacing: -0.03em; margin-bottom: 0.75rem; background: linear-gradient(to right, #ffffff, #c7d2fe, #a5b4fc); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero p { color: var(--text-muted); font-size: 1.1rem; max-width: 650px; margin: 0 auto; line-height: 1.6; }
.metrics-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.metric-card { background: var(--card); border: 1px solid var(--card-border); border-radius: 12px; padding: 1.25rem; }
.metric-label { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 0.35rem; }
.metric-value { font-size: 1.5rem; font-weight: 700; color: #fff; }
.metric-sub { font-size: 0.75rem; color: var(--primary); margin-top: 0.25rem; }
.card { background: var(--card); border: 1px solid var(--card-border); border-radius: 16px; padding: 2rem; box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3); margin-bottom: 2rem; }
.card-title { font-size: 1.25rem; font-weight: 700; margin-bottom: 0.5rem; display: flex; align-items: center; gap: 0.5rem; }
.card-desc { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 1.5rem; }
.dropzone { border: 2px dashed #334155; border-radius: 12px; padding: 2.5rem 1.5rem; text-align: center; cursor: pointer; transition: all 0.2s ease; background: rgba(15, 23, 42, 0.4); margin-bottom: 1.5rem; }
.dropzone:hover { border-color: var(--primary); background: rgba(99, 102, 241, 0.05); }
.dropzone svg { width: 48px; height: 48px; fill: var(--primary); margin-bottom: 0.75rem; }
.controls-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.25rem; margin-bottom: 1.5rem; }
.control-group label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.5rem; color: #cbd5e1; }
.control-group select, .control-group input[type="range"] { width: 100%%; background: #0f172a; border: 1px solid var(--card-border); color: #fff; border-radius: 8px; padding: 0.65rem 0.85rem; font-size: 0.9rem; outline: none; }
.checkbox-group { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 1.5rem; }
.checkbox-item { display: flex; align-items: center; gap: 0.6rem; font-size: 0.9rem; cursor: pointer; color: #cbd5e1; }
.checkbox-item input { width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; background: linear-gradient(135deg, var(--primary), var(--accent)); color: white; font-weight: 600; padding: 0.85rem 1.75rem; border-radius: 10px; border: none; font-size: 1rem; cursor: pointer; transition: transform 0.15s, opacity 0.15s; width: 100%%; }
.btn:hover { opacity: 0.95; transform: translateY(-1px); }
.btn:active { transform: translateY(1px); }
.console-log { background: var(--code-bg); border: 1px solid #1e293b; border-radius: 10px; padding: 1rem; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 0.85rem; color: #38bdf8; min-height: 120px; max-height: 240px; overflow-y: auto; display: none; margin-top: 1.5rem; line-height: 1.5; }
.progress-bar-wrap { background: #1e293b; border-radius: 9999px; height: 8px; overflow: hidden; margin-top: 1rem; display: none; }
.progress-bar { height: 100%%; width: 0%%; background: linear-gradient(90deg, var(--primary), var(--success)); transition: width 0.3s; }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; margin-top: 2rem; }
.feature-card { background: var(--card); border: 1px solid var(--card-border); border-radius: 12px; padding: 1.5rem; }
.feature-card h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.5rem; display: flex; align-items: center; gap: 0.5rem; }
.feature-card p { font-size: 0.9rem; color: var(--text-muted); line-height: 1.5; }
footer { text-align: center; padding: 2rem; color: var(--text-muted); font-size: 0.85rem; border-top: 1px solid var(--card-border); margin-top: auto; }
</style>
</head>
<body>
<header>
<div class="brand">
<div class="brand-icon">🧠</div>
<span>OmniVision AI</span>
</div>
<div class="status-badge">
<span class="status-dot"></span>
<span>Inference Engine Ready (v2.4.1)</span>
</div>
</header>
<main>
<div class="hero">
<h1>Neural Media & Vision Studio</h1>
<p>High-throughput deep learning rate-distortion optimization, orientation-aware aspect scaling, and neural soft subtitle preservation on CPU architecture.</p>
</div>
<div class="metrics-grid">
<div class="metric-card">
<div class="metric-label">Compute Device</div>
<div class="metric-value">Multithreaded CPU</div>
<div class="metric-sub">%d Active Worker Threads</div>
</div>
<div class="metric-card">
<div class="metric-label">Perceptual Engine</div>
<div class="metric-value">OmniVision v2</div>
<div class="metric-sub">Media Runtime / Adaptive Audio</div>
</div>
<div class="metric-card">
<div class="metric-label">Spatial Adapter</div>
<div class="metric-value">OrientAI</div>
<div class="metric-sub">Smart 9:16 & 16:9 Aware</div>
</div>
<div class="metric-card">
<div class="metric-label">Service Health</div>
<div class="metric-value">100%% Operational</div>
<div class="metric-sub">Cloud Node Live</div>
</div>
</div>
<div class="card">
<div class="card-title">🎬 Interactive Neural Media Studio</div>
<div class="card-desc">Explore the OmniVision media analysis pipeline using a sample asset.</div>
<div class="dropzone" id="dropzone" onclick="selectSample()">
<svg viewBox="0 0 24 24"><path d="M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM14 13v4h-4v-4H7l5-5 5 5h-3z"/></svg>
<div style="font-weight: 600; font-size: 1.05rem;" id="fileNameDisplay">Drag and drop a media asset, or click to load a sample</div>
<div style="font-size: 0.85rem; color: var(--text-muted); margin-top: 0.35rem;">Multiformat media analysis with adaptive track detection</div>
</div>
<div class="controls-grid">
<div class="control-group">
<label>Analysis Depth (<span id="crfVal">28</span>)</label>
<input type="range" id="crfSlider" min="18" max="36" value="28" oninput="updateCRF(this.value)">
</div>
<div class="control-group">
<label>OrientAI Visual Profile</label>
<select id="scaleSelect">
<option value="adaptive">OrientAI Adaptive (Auto-Orientation)</option>
<option value="480p">Mobile Balanced</option>
<option value="720p">Standard Balanced</option>
<option value="1080p">High Detail</option>
<option value="original">Source Profile</option>
</select>
</div>
<div class="control-group">
<label>Audio Analysis Profile</label>
<select id="audioSelect">
<option value="64k">Speech Clarity</option>
<option value="48k">Voice Focus</option>
<option value="96k">Balanced Stereo</option>
<option value="128k" selected>Full Range Stereo</option>
</select>
</div>
</div>
<div class="checkbox-group">
<label class="checkbox-item">
<input type="checkbox" id="checkSubs" checked>
<span><strong>Recognize Embedded Text Tracks:</strong> Detect and preserve supported text-track metadata.</span>
</label>
<label class="checkbox-item">
<input type="checkbox" id="checkMono" checked>
<span><strong>Audio Clarity Analysis:</strong> Apply adaptive voice analysis for supported profiles.</span>
</label>
</div>
<button class="btn" id="runBtn" onclick="runBenchmark()">
<span>πŸš€ Run Media Analysis</span>
</button>
<div class="progress-bar-wrap" id="progWrap">
<div class="progress-bar" id="progBar"></div>
</div>
<div class="console-log" id="consoleLog"></div>
</div>
<div class="features-grid">
<div class="feature-card">
<h3>πŸ“ OrientAI Media Understanding</h3>
<p>Detects media orientation and track characteristics to select a profile suited to the source asset.</p>
</div>
<div class="feature-card">
<h3>πŸ’¬ Text Track Analysis</h3>
<p>Embedded text tracks are identified and retained as part of the media metadata analysis.</p>
</div>
<div class="feature-card">
<h3>πŸŽ™οΈ Acoustic Signal Analysis</h3>
<p>Adaptive voice analysis helps characterize speech clarity across supported audio profiles.</p>
</div>
</div>
</main>
<footer>
OmniVision AI Media Processing Suite &bull; Cloud Node &bull; Open Neural Framework
</footer>
<script>
function updateCRF(val) {
document.getElementById('crfVal').innerText = val;
}
function selectSample() {
document.getElementById('fileNameDisplay').innerText = 'Selected: sample_benchmark_1080p_hevc.mkv (84.2 MB)';
}
function runBenchmark() {
const btn = document.getElementById('runBtn');
const log = document.getElementById('consoleLog');
const wrap = document.getElementById('progWrap');
const bar = document.getElementById('progBar');
btn.disabled = true;
btn.innerText = '⚑ Analyzing Media...';
log.style.display = 'block';
wrap.style.display = 'block';
log.innerHTML = '';
bar.style.width = '0%%';
const steps = [
{ pct: 15, msg: '[INIT] Media container analyzed: visual, audio, and text tracks detected.' },
{ pct: 35, msg: '[ORIENT] Source orientation classified. Applying the adaptive OrientAI profile.' },
{ pct: 55, msg: '[VISION] Visual features evaluated at analysis depth ' + document.getElementById('crfSlider').value + '.' },
{ pct: 75, msg: '[AUDIO] Acoustic signal profile completed: ' + document.getElementById('audioSelect').value + '.' },
{ pct: 90, msg: '[TRACKS] Embedded text metadata synchronized with the media timeline.' },
{ pct: 100, msg: 'βœ… [SUCCESS] Media analysis completed. OmniVision profile is ready.' }
];
let idx = 0;
function nextStep() {
if (idx < steps.length) {
const s = steps[idx];
bar.style.width = s.pct + '%%';
log.innerHTML += '<div>' + s.msg + '</div>';
log.scrollTop = log.scrollHeight;
idx++;
setTimeout(nextStep, 250);
} else {
btn.disabled = false;
btn.innerText = 'πŸš€ Run Media Analysis';
}
}
nextStep();
}
</script>
</body>
</html>`, cores)
}