Spaces:
Running on Zero
Running on Zero
minimal redesign
Browse files- app.py +5 -3
- index.html +209 -281
app.py
CHANGED
|
@@ -353,7 +353,6 @@ SAFETY_MARGIN = 25
|
|
| 353 |
EST_SECONDS_PER_FRAME = 20
|
| 354 |
|
| 355 |
|
| 356 |
-
@spaces.GPU(duration=GPU_HARD_LIMIT_IMAGE)
|
| 357 |
def run_image_gpu_api(
|
| 358 |
image_path: str, category: str, model_mode: str, temp: float, top_p: float, top_k: int,
|
| 359 |
short_size: int | None, question_override: str | None
|
|
@@ -400,7 +399,6 @@ def run_image_gpu_api(
|
|
| 400 |
return out_img_path, stats, output_text, detections_summary
|
| 401 |
|
| 402 |
|
| 403 |
-
@spaces.GPU(duration=GPU_HARD_LIMIT_VIDEO)
|
| 404 |
def run_video_gpu_api(
|
| 405 |
video_path: str, category: str, model_mode: str, temp: float, top_p: float, top_k: int,
|
| 406 |
short_size: int | None, question_override: str | None, max_video_frames: int
|
|
@@ -570,6 +568,7 @@ async def homepage():
|
|
| 570 |
|
| 571 |
|
| 572 |
@app.api(name="run_inference")
|
|
|
|
| 573 |
def run_inference_api(
|
| 574 |
input_type: str,
|
| 575 |
image_file: FileData | None,
|
|
@@ -584,7 +583,10 @@ def run_inference_api(
|
|
| 584 |
question_override: str | None = None,
|
| 585 |
max_video_frames: int = 4
|
| 586 |
) -> tuple[FileData | None, FileData | None, dict]:
|
| 587 |
-
"""Exposed Gradio Queueing Endpoint for custom frontend interactions.
|
|
|
|
|
|
|
|
|
|
| 588 |
try:
|
| 589 |
if not category:
|
| 590 |
category = "objects"
|
|
|
|
| 353 |
EST_SECONDS_PER_FRAME = 20
|
| 354 |
|
| 355 |
|
|
|
|
| 356 |
def run_image_gpu_api(
|
| 357 |
image_path: str, category: str, model_mode: str, temp: float, top_p: float, top_k: int,
|
| 358 |
short_size: int | None, question_override: str | None
|
|
|
|
| 399 |
return out_img_path, stats, output_text, detections_summary
|
| 400 |
|
| 401 |
|
|
|
|
| 402 |
def run_video_gpu_api(
|
| 403 |
video_path: str, category: str, model_mode: str, temp: float, top_p: float, top_k: int,
|
| 404 |
short_size: int | None, question_override: str | None, max_video_frames: int
|
|
|
|
| 568 |
|
| 569 |
|
| 570 |
@app.api(name="run_inference")
|
| 571 |
+
@spaces.GPU(duration=240)
|
| 572 |
def run_inference_api(
|
| 573 |
input_type: str,
|
| 574 |
image_file: FileData | None,
|
|
|
|
| 583 |
question_override: str | None = None,
|
| 584 |
max_video_frames: int = 4
|
| 585 |
) -> tuple[FileData | None, FileData | None, dict]:
|
| 586 |
+
"""Exposed Gradio Queueing Endpoint for custom frontend interactions.
|
| 587 |
+
|
| 588 |
+
ZeroGPU allocation is triggered directly at this endpoint boundary.
|
| 589 |
+
"""
|
| 590 |
try:
|
| 591 |
if not category:
|
| 592 |
category = "objects"
|
index.html
CHANGED
|
@@ -3,7 +3,7 @@
|
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8">
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
-
<title>NVIDIA LocateAnything - Fast Vision-Language Grounding
|
| 7 |
|
| 8 |
<!-- Premium Google Fonts -->
|
| 9 |
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
@@ -155,17 +155,6 @@
|
|
| 155 |
transform: translateY(1px);
|
| 156 |
}
|
| 157 |
|
| 158 |
-
.pill-btn-outline {
|
| 159 |
-
background-color: transparent;
|
| 160 |
-
border: 1px solid rgba(255, 255, 255, 0.2);
|
| 161 |
-
transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
|
| 162 |
-
}
|
| 163 |
-
.pill-btn-outline:hover {
|
| 164 |
-
background-color: rgba(255, 255, 255, 0.08);
|
| 165 |
-
border-color: rgba(255, 255, 255, 0.4);
|
| 166 |
-
transform: translateY(-1px);
|
| 167 |
-
}
|
| 168 |
-
|
| 169 |
/* Custom Scrollbar */
|
| 170 |
::-webkit-scrollbar {
|
| 171 |
width: 6px;
|
|
@@ -200,8 +189,8 @@
|
|
| 200 |
<body class="text-slate-100 font-sans min-h-screen pb-16 carbon-grid">
|
| 201 |
|
| 202 |
<!-- NVIDIA Brand Navigation Header -->
|
| 203 |
-
<nav class="bg-white/95 backdrop-blur-md sticky top-0 z-50 px-6 py-3.5 border-b border-slate-200/90 shadow-sm
|
| 204 |
-
<div class="max-w-7xl
|
| 205 |
<div class="flex items-center gap-8">
|
| 206 |
<!-- Official Styled NVIDIA Brand Text Logo -->
|
| 207 |
<a href="#" class="flex items-center gap-1.5 select-none group">
|
|
@@ -217,80 +206,203 @@
|
|
| 217 |
<div class="hidden lg:flex items-center gap-6 text-sm font-semibold text-slate-600">
|
| 218 |
<a href="https://huggingface.co/nvidia/LocateAnything-3B" target="_blank" class="hover:text-nvidia-brand transition-colors">Model Card</a>
|
| 219 |
<a href="https://arxiv.org/abs/2605.27365" target="_blank" class="hover:text-nvidia-brand transition-colors">arXiv Paper</a>
|
| 220 |
-
<a href="https://github.com/NVlabs/Eagle/tree/main/Embodied" target="_blank" class="hover:text-nvidia-brand transition-colors">GitHub
|
| 221 |
</div>
|
| 222 |
</div>
|
| 223 |
|
| 224 |
<div class="flex items-center gap-4">
|
| 225 |
-
<span class="hidden md:inline-flex px-3 py-1 text-xs font-semibold rounded bg-emerald-500/10 text-nvidia-brand border border-nvidia-brand/20 items-center gap-1.5">
|
| 226 |
<span class="h-1.5 w-1.5 rounded-full bg-nvidia-brand animate-pulse"></span>
|
| 227 |
-
|
| 228 |
</span>
|
| 229 |
-
<a href="https://huggingface.co/spaces/akhaliq/LocateAnything" class="px-4 py-1.5 rounded bg-slate-900 hover:bg-slate-800 text-white font-semibold text-xs tracking-wider uppercase transition-all">
|
| 230 |
-
HF Space
|
| 231 |
-
</a>
|
| 232 |
</div>
|
| 233 |
</div>
|
| 234 |
</nav>
|
| 235 |
|
| 236 |
-
<!-- MAIN
|
| 237 |
-
<main class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 pt-8 lg:pt-
|
| 238 |
|
| 239 |
-
<
|
| 240 |
-
<section class="grid grid-cols-1 lg:grid-cols-12 gap-8 lg:gap-12 items-center">
|
| 241 |
|
| 242 |
-
<!--
|
| 243 |
-
<
|
| 244 |
-
<div class="space-y-2">
|
| 245 |
-
<span class="text-sm font-black font-outfit text-nvidia-brand tracking-widest uppercase block">NVIDIA RESEARCH AT GTC</span>
|
| 246 |
-
<h2 class="text-4xl sm:text-5xl lg:text-[54px] font-black font-outfit text-white leading-[1.08] tracking-tight">
|
| 247 |
-
Locate Anything in Images & Videos in Parallel
|
| 248 |
-
</h2>
|
| 249 |
-
</div>
|
| 250 |
|
| 251 |
-
<
|
| 252 |
-
|
| 253 |
-
|
| 254 |
-
|
| 255 |
-
|
| 256 |
-
|
| 257 |
-
|
| 258 |
-
|
| 259 |
-
|
| 260 |
-
<path stroke-linecap="round" stroke-linejoin="round" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" />
|
| 261 |
-
</svg>
|
| 262 |
-
<input type="text" id="categories" value="car, bus, person, potted plant" placeholder="Describe objects to locate (e.g. car, person, dog)..." class="bg-transparent border-none outline-none focus:outline-none w-full text-slate-100 placeholder-slate-500 font-medium text-sm sm:text-base">
|
| 263 |
-
<button id="clear-search-btn" class="text-slate-400 hover:text-white transition-colors p-1 rounded-full hover:bg-white/5">
|
| 264 |
-
<svg class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5">
|
| 265 |
-
<path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12" />
|
| 266 |
</svg>
|
| 267 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 268 |
</div>
|
| 269 |
-
</div>
|
| 270 |
|
| 271 |
-
|
| 272 |
-
|
| 273 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 274 |
<span id="btn-icon">🧠</span>
|
| 275 |
<span id="btn-text">Run Inference</span>
|
| 276 |
</button>
|
| 277 |
-
<a href="https://research.nvidia.com/labs/lpr/locate-anything/LocateAnything.pdf" target="_blank" class="pill-btn-outline py-3 px-8 rounded-full text-white font-bold text-sm flex items-center justify-center select-none">
|
| 278 |
-
Read Tech Report ↗
|
| 279 |
-
</a>
|
| 280 |
</div>
|
| 281 |
-
</div>
|
| 282 |
|
| 283 |
-
|
| 284 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 285 |
|
| 286 |
-
<div class="gtc-polygon-wrapper w-full aspect-video min-h-[
|
| 287 |
<div class="gtc-neon-border"></div>
|
| 288 |
<div class="gtc-inner-box p-4 flex flex-col">
|
| 289 |
|
| 290 |
<!-- Header row of Workspace inside Hexagon -->
|
| 291 |
-
<div class="flex justify-between items-center border-b border-white/5 pb-3
|
| 292 |
<span class="text-xs font-bold font-mono text-nvidia-brand uppercase tracking-widest flex items-center gap-2">
|
| 293 |
-
<span class="h-
|
| 294 |
Media Workspace
|
| 295 |
</span>
|
| 296 |
<span id="workspace-status" class="text-[10px] text-slate-500 font-mono">No Media Loaded</span>
|
|
@@ -311,7 +423,6 @@
|
|
| 311 |
<p class="text-xs font-bold text-slate-200">Drag & drop your file here</p>
|
| 312 |
<p class="text-[10px] text-slate-500 mt-1">or click to browse local folders</p>
|
| 313 |
</div>
|
| 314 |
-
<p class="text-[9px] text-slate-600">Supports PNG, JPG, JPEG, and MP4 formats</p>
|
| 315 |
</div>
|
| 316 |
|
| 317 |
<!-- Dynamic Preview Media Rendering inside Hexagon Frame -->
|
|
@@ -336,8 +447,8 @@
|
|
| 336 |
<span class="dot-pulse inline-block h-3 w-3 rounded-full bg-emerald-300" style="animation-delay: 0.4s;"></span>
|
| 337 |
</div>
|
| 338 |
<div class="text-center space-y-1">
|
| 339 |
-
<p id="processing-status" class="text-
|
| 340 |
-
<p class="text-[9px] text-slate-500 uppercase tracking-wider font-mono">
|
| 341 |
</div>
|
| 342 |
</div>
|
| 343 |
|
|
@@ -346,225 +457,40 @@
|
|
| 346 |
</div>
|
| 347 |
</div>
|
| 348 |
|
| 349 |
-
|
| 350 |
-
|
| 351 |
-
|
| 352 |
-
|
| 353 |
-
|
| 354 |
-
|
| 355 |
-
|
| 356 |
-
|
| 357 |
-
|
| 358 |
-
|
| 359 |
-
|
| 360 |
-
|
| 361 |
-
</svg>
|
| 362 |
-
Model Parameters Setup
|
| 363 |
-
</h3>
|
| 364 |
-
<span class="text-[10px] text-slate-500 uppercase tracking-widest font-mono">Fine-Tune Inference Config</span>
|
| 365 |
-
</div>
|
| 366 |
-
|
| 367 |
-
<!-- Parameters Grid -->
|
| 368 |
-
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-6">
|
| 369 |
-
|
| 370 |
-
<!-- Media Type toggle selection -->
|
| 371 |
-
<div class="space-y-2">
|
| 372 |
-
<label class="text-[10px] font-bold text-slate-400 uppercase tracking-widest">1. Media Mode</label>
|
| 373 |
-
<div class="grid grid-cols-2 gap-1.5 bg-black/40 p-1 rounded-xl border border-white/5 text-center">
|
| 374 |
-
<button id="media-type-image" class="py-2 rounded-lg font-semibold text-xs transition-all bg-nvidia-brand text-black font-extrabold shadow shadow-nvidia-brand/10">
|
| 375 |
-
Image
|
| 376 |
-
</button>
|
| 377 |
-
<button id="media-type-video" class="py-2 rounded-lg font-semibold text-xs text-slate-400 hover:text-slate-200 transition-all">
|
| 378 |
-
Video
|
| 379 |
-
</button>
|
| 380 |
-
</div>
|
| 381 |
-
</div>
|
| 382 |
-
|
| 383 |
-
<!-- Task Selector -->
|
| 384 |
-
<div class="space-y-2">
|
| 385 |
-
<label for="task-type" class="text-[10px] font-bold text-slate-400 uppercase tracking-widest">2. Task Type</label>
|
| 386 |
-
<select id="task-type" class="w-full bg-black/40 border border-white/5 rounded-xl px-3 py-2 text-xs focus:border-nvidia-brand focus:outline-none transition-all text-slate-200">
|
| 387 |
-
<option value="Detection">Detection - Locate all matched objects</option>
|
| 388 |
-
<option value="Grounding">Grounding - Match specific expression</option>
|
| 389 |
-
<option value="OCR">OCR - Extract all text coordinate boxes</option>
|
| 390 |
-
<option value="GUI">GUI - Ground user interface targets</option>
|
| 391 |
-
<option value="Pointing">Pointing - Extract point coordinates</option>
|
| 392 |
-
</select>
|
| 393 |
-
</div>
|
| 394 |
-
|
| 395 |
-
<!-- Inference Mode Selection -->
|
| 396 |
-
<div class="space-y-2">
|
| 397 |
-
<label for="inference-mode" class="text-[10px] font-bold text-slate-400 uppercase tracking-widest">3. Inference Mode</label>
|
| 398 |
-
<select id="inference-mode" class="w-full bg-black/40 border border-white/5 rounded-xl px-3 py-2 text-xs focus:border-nvidia-brand focus:outline-none transition-all text-slate-200">
|
| 399 |
-
<option value="hybrid">Hybrid - Balance Speed & Quality (PBD+AR)</option>
|
| 400 |
-
<option value="fast">Fast - Maximize Speed (PBD Parallel only)</option>
|
| 401 |
-
<option value="slow">Slow - Maximize Accuracy (AR Sequential only)</option>
|
| 402 |
-
</select>
|
| 403 |
-
</div>
|
| 404 |
-
|
| 405 |
-
<!-- Short side resize cap -->
|
| 406 |
-
<div class="space-y-2">
|
| 407 |
-
<label for="short-size" class="text-[10px] font-bold text-slate-400 uppercase tracking-widest">4. Resize Cap (px)</label>
|
| 408 |
-
<input type="number" id="short-size" placeholder="Auto-Cap (1024)" class="w-full bg-black/40 border border-white/5 rounded-xl px-3 py-2 text-xs focus:border-nvidia-brand focus:outline-none transition-all text-slate-200 font-mono">
|
| 409 |
-
</div>
|
| 410 |
-
|
| 411 |
-
</div>
|
| 412 |
-
|
| 413 |
-
<!-- Advanced parameter sliders (Collapsible details) -->
|
| 414 |
-
<details class="group border-t border-white/5 pt-4">
|
| 415 |
-
<summary class="list-none flex justify-between items-center cursor-pointer select-none text-[11px] font-bold text-slate-400 tracking-wider uppercase hover:text-slate-200 transition-colors">
|
| 416 |
-
<span class="flex items-center gap-1.5">
|
| 417 |
-
⚙️ Advanced Generation Sliders
|
| 418 |
-
</span>
|
| 419 |
-
<svg class="h-4 w-4 transform group-open:rotate-180 transition-transform text-slate-500" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
| 420 |
-
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7" />
|
| 421 |
-
</svg>
|
| 422 |
-
</summary>
|
| 423 |
-
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-6 pt-5">
|
| 424 |
-
|
| 425 |
-
<!-- Temp -->
|
| 426 |
-
<div class="space-y-2">
|
| 427 |
-
<div class="flex justify-between text-[10px] uppercase font-bold text-slate-400 tracking-wider">
|
| 428 |
-
<span>Temperature</span>
|
| 429 |
-
<span id="temp-val" class="font-mono text-nvidia-brand">0.7</span>
|
| 430 |
-
</div>
|
| 431 |
-
<input type="range" id="temp" min="0.1" max="2.0" step="0.1" value="0.7" class="w-full h-1 bg-black rounded-lg appearance-none cursor-pointer accent-nvidia-brand">
|
| 432 |
-
</div>
|
| 433 |
-
|
| 434 |
-
<!-- Top P -->
|
| 435 |
-
<div class="space-y-2">
|
| 436 |
-
<div class="flex justify-between text-[10px] uppercase font-bold text-slate-400 tracking-wider">
|
| 437 |
-
<span>Top P</span>
|
| 438 |
-
<span id="topp-val" class="font-mono text-nvidia-brand">0.9</span>
|
| 439 |
-
</div>
|
| 440 |
-
<input type="range" id="topp" min="0.05" max="1.0" step="0.05" value="0.9" class="w-full h-1 bg-black rounded-lg appearance-none cursor-pointer accent-nvidia-brand">
|
| 441 |
-
</div>
|
| 442 |
-
|
| 443 |
-
<!-- Top K -->
|
| 444 |
-
<div class="space-y-2">
|
| 445 |
-
<div class="flex justify-between text-[10px] uppercase font-bold text-slate-400 tracking-wider">
|
| 446 |
-
<span>Top K</span>
|
| 447 |
-
<span id="topk-val" class="font-mono text-nvidia-brand">20</span>
|
| 448 |
</div>
|
| 449 |
-
<input type="range" id="topk" min="1" max="100" step="1" value="20" class="w-full h-1 bg-black rounded-lg appearance-none cursor-pointer accent-nvidia-brand">
|
| 450 |
-
</div>
|
| 451 |
|
| 452 |
-
|
| 453 |
-
|
| 454 |
-
|
| 455 |
-
|
| 456 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 457 |
</div>
|
| 458 |
-
<input type="range" id="max-frames" min="1" max="10" step="1" value="4" class="w-full h-1 bg-black rounded-lg appearance-none cursor-pointer accent-nvidia-brand" disabled>
|
| 459 |
-
</div>
|
| 460 |
-
|
| 461 |
-
</div>
|
| 462 |
-
</details>
|
| 463 |
-
|
| 464 |
-
<!-- Text Prompt logs -->
|
| 465 |
-
<div class="bg-black/50 border border-white/5 rounded-xl p-3.5 flex flex-col sm:flex-row justify-between items-start sm:items-center gap-3">
|
| 466 |
-
<div class="space-y-1">
|
| 467 |
-
<span class="text-[9px] font-bold text-slate-500 uppercase tracking-widest block">System Formulated Text Prompt:</span>
|
| 468 |
-
<p id="raw-prompt-preview" class="text-xs text-slate-300 font-mono break-all leading-normal"></p>
|
| 469 |
-
</div>
|
| 470 |
-
<div class="text-[10px] text-slate-500 font-mono shrink-0 select-none">Auto-compiled from model settings</div>
|
| 471 |
-
</div>
|
| 472 |
-
|
| 473 |
-
</section>
|
| 474 |
-
|
| 475 |
-
<!-- PRELOADED EXAMPLES LIBRARY (Meta SAM 3 Grid Style) -->
|
| 476 |
-
<section class="space-y-6">
|
| 477 |
-
<div class="flex justify-between items-center border-b border-white/5 pb-3">
|
| 478 |
-
<h3 class="text-base font-black font-outfit text-white uppercase tracking-wider flex items-center gap-2">
|
| 479 |
-
<svg class="h-4.5 w-4.5 text-nvidia-brand" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
| 480 |
-
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2.2" d="M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 00-2 2z" />
|
| 481 |
-
</svg>
|
| 482 |
-
Interactive Examples Sandbox
|
| 483 |
-
</h3>
|
| 484 |
-
<span class="text-[10px] text-slate-500 uppercase tracking-widest font-mono select-none">Quick Test Gallery</span>
|
| 485 |
-
</div>
|
| 486 |
|
| 487 |
-
<div class="grid grid-cols-2 sm:grid-cols-4 gap-4 sm:gap-6">
|
| 488 |
-
|
| 489 |
-
<!-- Card 1 -->
|
| 490 |
-
<div class="example-card glass-panel glass-panel-interactive rounded-2xl p-3 cursor-pointer group space-y-3" data-type="Image" data-name="Book" data-category="book" data-task="Detection" data-mode="hybrid" data-asset="/assets/book.jpg">
|
| 491 |
-
<div class="h-28 w-full rounded-xl bg-cover bg-center overflow-hidden border border-white/5 bg-slate-900 group-hover:scale-[1.02] transition-transform duration-500" style="background-image: url('/assets/book.jpg');"></div>
|
| 492 |
-
<div class="flex justify-between items-center px-1">
|
| 493 |
-
<span class="text-xs font-bold text-slate-200">Library Book</span>
|
| 494 |
-
<span class="text-[9px] px-2 py-0.5 rounded bg-nvidia-brand/10 text-nvidia-brand border border-nvidia-brand/10 font-bold tracking-wider uppercase">Detection</span>
|
| 495 |
</div>
|
| 496 |
-
</div>
|
| 497 |
|
| 498 |
-
|
| 499 |
-
|
| 500 |
-
<div class="h-28 w-full rounded-xl bg-cover bg-center overflow-hidden border border-white/5 bg-slate-900 group-hover:scale-[1.02] transition-transform duration-500" style="background-image: url('/assets/sweet.jpg');"></div>
|
| 501 |
-
<div class="flex justify-between items-center px-1">
|
| 502 |
-
<span class="text-xs font-bold text-slate-200">Sushi Sweet</span>
|
| 503 |
-
<span class="text-[9px] px-2 py-0.5 rounded bg-nvidia-brand/10 text-nvidia-brand border border-nvidia-brand/10 font-bold tracking-wider uppercase">Detection</span>
|
| 504 |
-
</div>
|
| 505 |
</div>
|
| 506 |
|
| 507 |
-
|
| 508 |
-
<div class="example-card glass-panel glass-panel-interactive rounded-2xl p-3 cursor-pointer group space-y-3" data-type="Image" data-name="Person" data-category="person" data-task="Detection" data-mode="hybrid" data-asset="/assets/person.jpg">
|
| 509 |
-
<div class="h-28 w-full rounded-xl bg-cover bg-center overflow-hidden border border-white/5 bg-slate-900 group-hover:scale-[1.02] transition-transform duration-500" style="background-image: url('/assets/person.jpg');"></div>
|
| 510 |
-
<div class="flex justify-between items-center px-1">
|
| 511 |
-
<span class="text-xs font-bold text-slate-200">Audience Group</span>
|
| 512 |
-
<span class="text-[9px] px-2 py-0.5 rounded bg-nvidia-brand/10 text-nvidia-brand border border-nvidia-brand/10 font-bold tracking-wider uppercase">Detection</span>
|
| 513 |
-
</div>
|
| 514 |
-
</div>
|
| 515 |
-
|
| 516 |
-
<!-- Card 4 -->
|
| 517 |
-
<div class="example-card glass-panel glass-panel-interactive rounded-2xl p-3 cursor-pointer group space-y-3" data-type="Image" data-name="OCR" data-category="text" data-task="OCR" data-mode="fast" data-asset="/assets/ocr.jpg">
|
| 518 |
-
<div class="h-28 w-full rounded-xl bg-cover bg-center overflow-hidden border border-white/5 bg-slate-900 group-hover:scale-[1.02] transition-transform duration-500" style="background-image: url('/assets/ocr.jpg');"></div>
|
| 519 |
-
<div class="flex justify-between items-center px-1">
|
| 520 |
-
<span class="text-xs font-bold text-slate-200">Street Sign</span>
|
| 521 |
-
<span class="text-[9px] px-2 py-0.5 rounded bg-nvidia-brand/10 text-nvidia-brand border border-nvidia-brand/10 font-bold tracking-wider uppercase">OCR</span>
|
| 522 |
-
</div>
|
| 523 |
-
</div>
|
| 524 |
-
|
| 525 |
-
</div>
|
| 526 |
-
</section>
|
| 527 |
-
|
| 528 |
-
<!-- PERFORMANCE ANALYTICS & LOG CONSOLE -->
|
| 529 |
-
<section class="glass-panel rounded-2xl p-6 sm:p-8 space-y-6">
|
| 530 |
-
<h3 class="text-sm font-black font-mono text-nvidia-brand uppercase tracking-widest flex items-center gap-2">
|
| 531 |
-
<svg class="h-4.5 w-4.5 text-nvidia-brand" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
| 532 |
-
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2.2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
|
| 533 |
-
</svg>
|
| 534 |
-
Inference Console Logs Trace
|
| 535 |
-
</h3>
|
| 536 |
-
|
| 537 |
-
<div class="grid grid-cols-1 md:grid-cols-12 gap-6 items-stretch">
|
| 538 |
-
|
| 539 |
-
<!-- Performance Statistics Metrics Console (Grid: 5) -->
|
| 540 |
-
<div class="md:col-span-5 bg-black/60 rounded-xl p-5 border border-white/5 font-mono text-xs text-slate-300 space-y-3.5 leading-relaxed">
|
| 541 |
-
<div class="text-nvidia-brand font-bold border-b border-white/5 pb-2 mb-2 uppercase tracking-widest text-[10px]">📊 Metrics Log</div>
|
| 542 |
-
<div class="flex justify-between"><span class="text-slate-500">Inference Status:</span> <span id="meta-status" class="text-emerald-500 font-semibold">Idle</span></div>
|
| 543 |
-
<div class="flex justify-between"><span class="text-slate-500">Processed Tokens/Frames:</span> <span id="meta-tokens">-</span></div>
|
| 544 |
-
<div class="flex justify-between"><span class="text-slate-500">Bounding Box Detections:</span> <span id="meta-boxes">-</span></div>
|
| 545 |
-
<div class="flex justify-between"><span class="text-slate-500">TPS (Tokens/s):</span> <span id="meta-tps">-</span></div>
|
| 546 |
-
<div class="flex justify-between"><span class="text-slate-500">BPS (Boxes/s):</span> <span id="meta-bps">-</span></div>
|
| 547 |
-
<div class="flex justify-between"><span class="text-slate-500">Processing Time:</span> <span id="meta-time">-</span></div>
|
| 548 |
-
</div>
|
| 549 |
-
|
| 550 |
-
<!-- Tag drawer box list (Grid: 7) -->
|
| 551 |
-
<div class="md:col-span-7 bg-black/60 rounded-xl p-5 border border-white/5 flex flex-col">
|
| 552 |
-
<div class="text-nvidia-brand font-mono font-bold border-b border-white/5 pb-2 mb-2.5 uppercase tracking-widest text-[10px] flex justify-between shrink-0">
|
| 553 |
-
<span>🎯 Detected Target Coordinates</span>
|
| 554 |
-
<span id="detection-count-badge" class="text-[9px] bg-nvidia-brand/10 text-nvidia-brand border border-nvidia-brand/20 px-2 py-0.5 rounded-full font-bold">0</span>
|
| 555 |
-
</div>
|
| 556 |
-
<div id="detection-tags-wrapper" class="flex-1 flex flex-wrap gap-2 max-h-[140px] overflow-y-auto pt-1 align-content-start text-xs text-slate-500">
|
| 557 |
-
No objects detected. Stage parameters and click Run Inference to trigger the model pipeline.
|
| 558 |
-
</div>
|
| 559 |
-
</div>
|
| 560 |
-
|
| 561 |
-
</div>
|
| 562 |
-
|
| 563 |
-
<!-- Optional dynamic trace wrapper -->
|
| 564 |
-
<div id="rich-trace-log" class="hidden border-t border-white/5 pt-4"></div>
|
| 565 |
-
|
| 566 |
-
</section>
|
| 567 |
|
|
|
|
| 568 |
</main>
|
| 569 |
|
| 570 |
<!-- Gradio client connection & app runtime logic -->
|
|
@@ -690,8 +616,8 @@
|
|
| 690 |
function setMediaType(type) {
|
| 691 |
selectedMediaType = type;
|
| 692 |
if (type === "Image") {
|
| 693 |
-
mediaTypeImageBtn.className = "py-
|
| 694 |
-
mediaTypeVideoBtn.className = "py-
|
| 695 |
videoFramesWrapper.classList.add("hidden");
|
| 696 |
videoFramesWrapper.classList.add("opacity-50");
|
| 697 |
videoFramesWrapper.classList.add("pointer-events-none");
|
|
@@ -699,8 +625,8 @@
|
|
| 699 |
fileInput.accept = "image/*";
|
| 700 |
workspaceStatus.textContent = activeFile ? "Image Loaded" : "No Media Loaded";
|
| 701 |
} else {
|
| 702 |
-
mediaTypeVideoBtn.className = "py-
|
| 703 |
-
mediaTypeImageBtn.className = "py-
|
| 704 |
videoFramesWrapper.classList.remove("hidden");
|
| 705 |
videoFramesWrapper.classList.remove("opacity-50");
|
| 706 |
videoFramesWrapper.classList.remove("pointer-events-none");
|
|
@@ -818,9 +744,11 @@
|
|
| 818 |
// Setup Media type
|
| 819 |
setMediaType(type);
|
| 820 |
|
| 821 |
-
// Fetch asset file
|
| 822 |
const ext = type === "Image" ? "jpg" : "mp4";
|
| 823 |
-
const
|
|
|
|
|
|
|
| 824 |
if (file) {
|
| 825 |
handleFileImport(file);
|
| 826 |
}
|
|
@@ -939,7 +867,7 @@
|
|
| 939 |
detectionTagsWrapper.innerHTML = "";
|
| 940 |
detections.forEach(det => {
|
| 941 |
const tag = document.createElement("span");
|
| 942 |
-
tag.className = "px-2
|
| 943 |
tag.textContent = det.frame ? `[Frame ${det.frame}] ${det.label}` : det.label;
|
| 944 |
detectionTagsWrapper.appendChild(tag);
|
| 945 |
});
|
|
|
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8">
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>NVIDIA LocateAnything - Fast Vision-Language Grounding</title>
|
| 7 |
|
| 8 |
<!-- Premium Google Fonts -->
|
| 9 |
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
|
|
| 155 |
transform: translateY(1px);
|
| 156 |
}
|
| 157 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 158 |
/* Custom Scrollbar */
|
| 159 |
::-webkit-scrollbar {
|
| 160 |
width: 6px;
|
|
|
|
| 189 |
<body class="text-slate-100 font-sans min-h-screen pb-16 carbon-grid">
|
| 190 |
|
| 191 |
<!-- NVIDIA Brand Navigation Header -->
|
| 192 |
+
<nav class="bg-white/95 backdrop-blur-md sticky top-0 z-50 px-6 py-3.5 border-b border-slate-200/90 shadow-sm">
|
| 193 |
+
<div class="max-w-7xl mx-auto flex items-center justify-between">
|
| 194 |
<div class="flex items-center gap-8">
|
| 195 |
<!-- Official Styled NVIDIA Brand Text Logo -->
|
| 196 |
<a href="#" class="flex items-center gap-1.5 select-none group">
|
|
|
|
| 206 |
<div class="hidden lg:flex items-center gap-6 text-sm font-semibold text-slate-600">
|
| 207 |
<a href="https://huggingface.co/nvidia/LocateAnything-3B" target="_blank" class="hover:text-nvidia-brand transition-colors">Model Card</a>
|
| 208 |
<a href="https://arxiv.org/abs/2605.27365" target="_blank" class="hover:text-nvidia-brand transition-colors">arXiv Paper</a>
|
| 209 |
+
<a href="https://github.com/NVlabs/Eagle/tree/main/Embodied" target="_blank" class="hover:text-nvidia-brand transition-colors">GitHub</a>
|
| 210 |
</div>
|
| 211 |
</div>
|
| 212 |
|
| 213 |
<div class="flex items-center gap-4">
|
| 214 |
+
<span class="hidden md:inline-flex px-3 py-1 text-xs font-semibold rounded bg-emerald-500/10 text-nvidia-brand border border-nvidia-brand/20 items-center gap-1.5 font-mono">
|
| 215 |
<span class="h-1.5 w-1.5 rounded-full bg-nvidia-brand animate-pulse"></span>
|
| 216 |
+
ZeroGPU Server
|
| 217 |
</span>
|
|
|
|
|
|
|
|
|
|
| 218 |
</div>
|
| 219 |
</div>
|
| 220 |
</nav>
|
| 221 |
|
| 222 |
+
<!-- MAIN MINIMAL LAYOUT CONTAINER -->
|
| 223 |
+
<main class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 pt-8 lg:pt-10 space-y-8">
|
| 224 |
|
| 225 |
+
<div class="grid grid-cols-1 lg:grid-cols-12 gap-8 items-start">
|
|
|
|
| 226 |
|
| 227 |
+
<!-- LEFT PANEL: Controls (Col Span: 5) -->
|
| 228 |
+
<section class="lg:col-span-5 space-y-6">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 229 |
|
| 230 |
+
<!-- Setup Card -->
|
| 231 |
+
<div class="glass-panel rounded-2xl p-6 space-y-6">
|
| 232 |
+
|
| 233 |
+
<!-- 1. Floating Glassmorphic Search Bar (SAM 3 Input Style) -->
|
| 234 |
+
<div class="space-y-2">
|
| 235 |
+
<label class="text-[9px] font-bold text-slate-400 uppercase tracking-widest block">Describe target objects to locate:</label>
|
| 236 |
+
<div class="sam-input-bar rounded-xl px-4 py-3 flex items-center gap-2">
|
| 237 |
+
<svg class="h-4.5 w-4.5 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5">
|
| 238 |
+
<path stroke-linecap="round" stroke-linejoin="round" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 239 |
</svg>
|
| 240 |
+
<input type="text" id="categories" value="car, bus, person, potted plant" placeholder="Describe objects (e.g. car, person)..." class="bg-transparent border-none outline-none focus:outline-none w-full text-slate-100 placeholder-slate-600 font-semibold text-sm">
|
| 241 |
+
<button id="clear-search-btn" class="text-slate-500 hover:text-white transition-colors p-0.5 rounded-full hover:bg-white/5">
|
| 242 |
+
<svg class="h-4.5 w-4.5" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5">
|
| 243 |
+
<path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12" />
|
| 244 |
+
</svg>
|
| 245 |
+
</button>
|
| 246 |
+
</div>
|
| 247 |
</div>
|
|
|
|
| 248 |
|
| 249 |
+
<!-- Layout Configuration Grid -->
|
| 250 |
+
<div class="grid grid-cols-2 gap-4">
|
| 251 |
+
|
| 252 |
+
<!-- Media Type toggle selection -->
|
| 253 |
+
<div class="space-y-1.5">
|
| 254 |
+
<label class="text-[9px] font-bold text-slate-400 uppercase tracking-widest">Media Type</label>
|
| 255 |
+
<div class="grid grid-cols-2 gap-1 bg-black/40 p-1 rounded-xl border border-white/5 text-center">
|
| 256 |
+
<button id="media-type-image" class="py-1.5 rounded-lg font-semibold text-[10px] transition-all bg-nvidia-brand text-black font-outfit font-black shadow shadow-nvidia-brand/10">
|
| 257 |
+
Image
|
| 258 |
+
</button>
|
| 259 |
+
<button id="media-type-video" class="py-1.5 rounded-lg font-semibold text-[10px] text-slate-400 hover:text-slate-200 transition-all">
|
| 260 |
+
Video
|
| 261 |
+
</button>
|
| 262 |
+
</div>
|
| 263 |
+
</div>
|
| 264 |
+
|
| 265 |
+
<!-- Task Selector -->
|
| 266 |
+
<div class="space-y-1.5">
|
| 267 |
+
<label for="task-type" class="text-[9px] font-bold text-slate-400 uppercase tracking-widest">Task Type</label>
|
| 268 |
+
<select id="task-type" class="w-full bg-black/40 border border-white/5 rounded-xl px-2.5 py-2 text-[10px] focus:border-nvidia-brand focus:outline-none transition-all text-slate-200 font-semibold">
|
| 269 |
+
<option value="Detection">Detection - Locate all matched</option>
|
| 270 |
+
<option value="Grounding">Grounding - Match expression</option>
|
| 271 |
+
<option value="OCR">OCR - Extract text boxes</option>
|
| 272 |
+
<option value="GUI">GUI - Ground GUI targets</option>
|
| 273 |
+
<option value="Pointing">Pointing - Extract points</option>
|
| 274 |
+
</select>
|
| 275 |
+
</div>
|
| 276 |
+
|
| 277 |
+
</div>
|
| 278 |
+
|
| 279 |
+
<!-- Second row options -->
|
| 280 |
+
<div class="grid grid-cols-2 gap-4">
|
| 281 |
+
|
| 282 |
+
<!-- Inference Mode Selection -->
|
| 283 |
+
<div class="space-y-1.5">
|
| 284 |
+
<label for="inference-mode" class="text-[9px] font-bold text-slate-400 uppercase tracking-widest">Inference Mode</label>
|
| 285 |
+
<select id="inference-mode" class="w-full bg-black/40 border border-white/5 rounded-xl px-2.5 py-2 text-[10px] focus:border-nvidia-brand focus:outline-none transition-all text-slate-200">
|
| 286 |
+
<option value="hybrid">Hybrid - Speed & Quality</option>
|
| 287 |
+
<option value="fast">Fast - PBD Parallel</option>
|
| 288 |
+
<option value="slow">Slow - AR Sequential</option>
|
| 289 |
+
</select>
|
| 290 |
+
</div>
|
| 291 |
+
|
| 292 |
+
<!-- Short side resize cap -->
|
| 293 |
+
<div class="space-y-1.5">
|
| 294 |
+
<label for="short-size" class="text-[9px] font-bold text-slate-400 uppercase tracking-widest">Resize Cap (px)</label>
|
| 295 |
+
<input type="number" id="short-size" placeholder="Auto-Cap (1024)" class="w-full bg-black/40 border border-white/5 rounded-xl px-2.5 py-1.5 text-[10px] focus:border-nvidia-brand focus:outline-none transition-all text-slate-200 font-mono">
|
| 296 |
+
</div>
|
| 297 |
+
|
| 298 |
+
</div>
|
| 299 |
+
|
| 300 |
+
<!-- Advanced parameters sliders (Collapsible details) -->
|
| 301 |
+
<details class="group border-t border-white/5 pt-4">
|
| 302 |
+
<summary class="list-none flex justify-between items-center cursor-pointer select-none text-[10px] font-bold text-slate-400 tracking-wider uppercase hover:text-slate-200 transition-colors">
|
| 303 |
+
<span>⚙️ Advanced Sliders</span>
|
| 304 |
+
<svg class="h-3.5 w-3.5 transform group-open:rotate-180 transition-transform text-slate-500" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
| 305 |
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7" />
|
| 306 |
+
</svg>
|
| 307 |
+
</summary>
|
| 308 |
+
<div class="space-y-4 pt-4">
|
| 309 |
+
|
| 310 |
+
<!-- Temp -->
|
| 311 |
+
<div class="space-y-1.5">
|
| 312 |
+
<div class="flex justify-between text-[9px] uppercase font-bold text-slate-400 tracking-wider">
|
| 313 |
+
<span>Temperature</span>
|
| 314 |
+
<span id="temp-val" class="font-mono text-nvidia-brand">0.7</span>
|
| 315 |
+
</div>
|
| 316 |
+
<input type="range" id="temp" min="0.1" max="2.0" step="0.1" value="0.7" class="w-full h-1 bg-black rounded-lg appearance-none cursor-pointer accent-nvidia-brand">
|
| 317 |
+
</div>
|
| 318 |
+
|
| 319 |
+
<!-- Top P -->
|
| 320 |
+
<div class="space-y-1.5">
|
| 321 |
+
<div class="flex justify-between text-[9px] uppercase font-bold text-slate-400 tracking-wider">
|
| 322 |
+
<span>Top P</span>
|
| 323 |
+
<span id="topp-val" class="font-mono text-nvidia-brand">0.9</span>
|
| 324 |
+
</div>
|
| 325 |
+
<input type="range" id="topp" min="0.05" max="1.0" step="0.05" value="0.9" class="w-full h-1 bg-black rounded-lg appearance-none cursor-pointer accent-nvidia-brand">
|
| 326 |
+
</div>
|
| 327 |
+
|
| 328 |
+
<!-- Top K -->
|
| 329 |
+
<div class="space-y-1.5">
|
| 330 |
+
<div class="flex justify-between text-[9px] uppercase font-bold text-slate-400 tracking-wider">
|
| 331 |
+
<span>Top K</span>
|
| 332 |
+
<span id="topk-val" class="font-mono text-nvidia-brand">20</span>
|
| 333 |
+
</div>
|
| 334 |
+
<input type="range" id="topk" min="1" max="100" step="1" value="20" class="w-full h-1 bg-black rounded-lg appearance-none cursor-pointer accent-nvidia-brand">
|
| 335 |
+
</div>
|
| 336 |
+
|
| 337 |
+
<!-- Video Frames (Only displayed for Video mode) -->
|
| 338 |
+
<div id="video-frames-wrapper" class="space-y-1.5 opacity-50 pointer-events-none transition-opacity duration-300">
|
| 339 |
+
<div class="flex justify-between text-[9px] uppercase font-bold text-slate-400 tracking-wider">
|
| 340 |
+
<span>Max Video Frames</span>
|
| 341 |
+
<span id="frames-val" class="font-mono text-nvidia-brand">4</span>
|
| 342 |
+
</div>
|
| 343 |
+
<input type="range" id="max-frames" min="1" max="10" step="1" value="4" class="w-full h-1 bg-black rounded-lg appearance-none cursor-pointer accent-nvidia-brand" disabled>
|
| 344 |
+
</div>
|
| 345 |
+
|
| 346 |
+
</div>
|
| 347 |
+
</details>
|
| 348 |
+
|
| 349 |
+
<!-- Run CTA Button -->
|
| 350 |
+
<button id="run-btn" class="pill-btn-green w-full py-3 px-6 rounded-full text-black font-extrabold text-sm flex items-center justify-center gap-2 select-none">
|
| 351 |
<span id="btn-icon">🧠</span>
|
| 352 |
<span id="btn-text">Run Inference</span>
|
| 353 |
</button>
|
|
|
|
|
|
|
|
|
|
| 354 |
</div>
|
|
|
|
| 355 |
|
| 356 |
+
<!-- Example Library Section (SAM 3 Grid Style) -->
|
| 357 |
+
<div class="glass-panel rounded-2xl p-5 space-y-4">
|
| 358 |
+
<span class="text-[9px] font-bold text-slate-400 uppercase tracking-widest block">🖼️ Interactive Quick Sandbox</span>
|
| 359 |
+
<div class="grid grid-cols-4 gap-3">
|
| 360 |
+
|
| 361 |
+
<!-- Card 1 -->
|
| 362 |
+
<div class="example-card border border-white/5 rounded-xl p-1 cursor-pointer group space-y-1 bg-black/35 hover:border-nvidia-brand/20 transition-all text-center" data-type="Image" data-name="Book" data-category="book" data-task="Detection" data-mode="hybrid" data-asset="/assets/book.jpg">
|
| 363 |
+
<div class="h-12 w-full rounded-lg bg-cover bg-center overflow-hidden bg-slate-900" style="background-image: url('/assets/book.jpg');"></div>
|
| 364 |
+
<span class="text-[9px] font-semibold text-slate-300 block truncate">Book</span>
|
| 365 |
+
</div>
|
| 366 |
+
|
| 367 |
+
<!-- Card 2 -->
|
| 368 |
+
<div class="example-card border border-white/5 rounded-xl p-1 cursor-pointer group space-y-1 bg-black/35 hover:border-nvidia-brand/20 transition-all text-center" data-type="Image" data-name="Sweet" data-category="sweet" data-task="Detection" data-mode="hybrid" data-asset="/assets/sweet.jpg">
|
| 369 |
+
<div class="h-12 w-full rounded-lg bg-cover bg-center overflow-hidden bg-slate-900" style="background-image: url('/assets/sweet.jpg');"></div>
|
| 370 |
+
<span class="text-[9px] font-semibold text-slate-300 block truncate">Sweet</span>
|
| 371 |
+
</div>
|
| 372 |
+
|
| 373 |
+
<!-- Card 3 -->
|
| 374 |
+
<div class="example-card border border-white/5 rounded-xl p-1 cursor-pointer group space-y-1 bg-black/35 hover:border-nvidia-brand/20 transition-all text-center" data-type="Image" data-name="Person" data-category="person" data-task="Detection" data-mode="hybrid" data-asset="/assets/person.jpg">
|
| 375 |
+
<div class="h-12 w-full rounded-lg bg-cover bg-center overflow-hidden bg-slate-900" style="background-image: url('/assets/person.jpg');"></div>
|
| 376 |
+
<span class="text-[9px] font-semibold text-slate-300 block truncate">People</span>
|
| 377 |
+
</div>
|
| 378 |
+
|
| 379 |
+
<!-- Card 4 -->
|
| 380 |
+
<div class="example-card border border-white/5 rounded-xl p-1 cursor-pointer group space-y-1 bg-black/35 hover:border-nvidia-brand/20 transition-all text-center" data-type="Image" data-name="OCR" data-category="text" data-task="OCR" data-mode="fast" data-asset="/assets/ocr.jpg">
|
| 381 |
+
<div class="h-12 w-full rounded-lg bg-cover bg-center overflow-hidden bg-slate-900" style="background-image: url('/assets/ocr.jpg');"></div>
|
| 382 |
+
<span class="text-[9px] font-semibold text-slate-300 block truncate">OCR</span>
|
| 383 |
+
</div>
|
| 384 |
+
|
| 385 |
+
</div>
|
| 386 |
+
</div>
|
| 387 |
+
|
| 388 |
+
<!-- Text Prompt logs -->
|
| 389 |
+
<div class="glass-panel rounded-2xl p-4 text-[10px] text-slate-500 font-mono flex justify-between items-center select-none bg-black/40">
|
| 390 |
+
<span class="truncate block">compiled: <span id="raw-prompt-preview" class="text-slate-400"></span></span>
|
| 391 |
+
</div>
|
| 392 |
+
|
| 393 |
+
</section>
|
| 394 |
+
|
| 395 |
+
<!-- RIGHT PANEL: Media Sandbox (Col Span: 7) -->
|
| 396 |
+
<section class="lg:col-span-7 space-y-6">
|
| 397 |
|
| 398 |
+
<div class="gtc-polygon-wrapper w-full aspect-video min-h-[360px] sm:min-h-[440px]">
|
| 399 |
<div class="gtc-neon-border"></div>
|
| 400 |
<div class="gtc-inner-box p-4 flex flex-col">
|
| 401 |
|
| 402 |
<!-- Header row of Workspace inside Hexagon -->
|
| 403 |
+
<div class="flex justify-between items-center border-b border-white/5 pb-3 mb-4 z-20">
|
| 404 |
<span class="text-xs font-bold font-mono text-nvidia-brand uppercase tracking-widest flex items-center gap-2">
|
| 405 |
+
<span class="h-1.5 w-1.5 rounded-full bg-nvidia-brand animate-ping"></span>
|
| 406 |
Media Workspace
|
| 407 |
</span>
|
| 408 |
<span id="workspace-status" class="text-[10px] text-slate-500 font-mono">No Media Loaded</span>
|
|
|
|
| 423 |
<p class="text-xs font-bold text-slate-200">Drag & drop your file here</p>
|
| 424 |
<p class="text-[10px] text-slate-500 mt-1">or click to browse local folders</p>
|
| 425 |
</div>
|
|
|
|
| 426 |
</div>
|
| 427 |
|
| 428 |
<!-- Dynamic Preview Media Rendering inside Hexagon Frame -->
|
|
|
|
| 447 |
<span class="dot-pulse inline-block h-3 w-3 rounded-full bg-emerald-300" style="animation-delay: 0.4s;"></span>
|
| 448 |
</div>
|
| 449 |
<div class="text-center space-y-1">
|
| 450 |
+
<p id="processing-status" class="text-[11px] font-bold tracking-widest text-slate-200 uppercase">Executing Model...</p>
|
| 451 |
+
<p class="text-[9px] text-slate-500 uppercase tracking-wider font-mono">Gradio Queue Engine Active</p>
|
| 452 |
</div>
|
| 453 |
</div>
|
| 454 |
|
|
|
|
| 457 |
</div>
|
| 458 |
</div>
|
| 459 |
|
| 460 |
+
<!-- PERFORMANCE ANALYTICS & LOG CONSOLE -->
|
| 461 |
+
<div class="glass-panel rounded-2xl p-5 space-y-4">
|
| 462 |
+
<div class="grid grid-cols-1 sm:grid-cols-12 gap-4 items-stretch">
|
| 463 |
+
|
| 464 |
+
<!-- Performance Statistics Metrics Console (Grid: 5) -->
|
| 465 |
+
<div class="sm:col-span-5 bg-black/60 rounded-xl p-4 border border-white/5 font-mono text-[10px] text-slate-300 space-y-2 leading-normal">
|
| 466 |
+
<div class="text-nvidia-brand font-bold border-b border-white/5 pb-1 mb-1.5 uppercase tracking-widest text-[9px]">📊 Metrics Log</div>
|
| 467 |
+
<div class="flex justify-between"><span class="text-slate-500">Status:</span> <span id="meta-status" class="text-emerald-500 font-semibold">Idle</span></div>
|
| 468 |
+
<div class="flex justify-between"><span class="text-slate-500">Tokens/Frames:</span> <span id="meta-tokens">-</span></div>
|
| 469 |
+
<div class="flex justify-between"><span class="text-slate-500">Detections:</span> <span id="meta-boxes">-</span></div>
|
| 470 |
+
<div class="flex justify-between"><span class="text-slate-500">TPS / BPS:</span> <span><span id="meta-tps">-</span> / <span id="meta-bps">-</span></span></div>
|
| 471 |
+
<div class="flex justify-between"><span class="text-slate-500">Time:</span> <span id="meta-time">-</span></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 472 |
</div>
|
|
|
|
|
|
|
| 473 |
|
| 474 |
+
<!-- Tag drawer box list (Grid: 7) -->
|
| 475 |
+
<div class="sm:col-span-7 bg-black/60 rounded-xl p-4 border border-white/5 flex flex-col">
|
| 476 |
+
<div class="text-nvidia-brand font-mono font-bold border-b border-white/5 pb-1 mb-2 uppercase tracking-widest text-[9px] flex justify-between shrink-0">
|
| 477 |
+
<span>🎯 Detected Target Overlays</span>
|
| 478 |
+
<span id="detection-count-badge" class="text-[8px] bg-nvidia-brand/10 text-nvidia-brand border border-nvidia-brand/20 px-1.5 py-0.5 rounded-full font-bold">0</span>
|
| 479 |
+
</div>
|
| 480 |
+
<div id="detection-tags-wrapper" class="flex-1 flex flex-wrap gap-1.5 max-h-[100px] overflow-y-auto pt-1 align-content-start text-[10px] text-slate-500">
|
| 481 |
+
Run inference to populate target tags here.
|
| 482 |
+
</div>
|
| 483 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 484 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 485 |
</div>
|
|
|
|
| 486 |
|
| 487 |
+
<!-- Optional dynamic trace wrapper -->
|
| 488 |
+
<div id="rich-trace-log" class="hidden border-t border-white/5 pt-3"></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 489 |
</div>
|
| 490 |
|
| 491 |
+
</section>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 492 |
|
| 493 |
+
</div>
|
| 494 |
</main>
|
| 495 |
|
| 496 |
<!-- Gradio client connection & app runtime logic -->
|
|
|
|
| 616 |
function setMediaType(type) {
|
| 617 |
selectedMediaType = type;
|
| 618 |
if (type === "Image") {
|
| 619 |
+
mediaTypeImageBtn.className = "py-1.5 rounded-lg font-semibold text-[10px] transition-all bg-nvidia-brand text-black font-outfit font-black shadow shadow-nvidia-brand/10";
|
| 620 |
+
mediaTypeVideoBtn.className = "py-1.5 rounded-lg font-semibold text-[10px] text-slate-400 hover:text-slate-200 transition-all";
|
| 621 |
videoFramesWrapper.classList.add("hidden");
|
| 622 |
videoFramesWrapper.classList.add("opacity-50");
|
| 623 |
videoFramesWrapper.classList.add("pointer-events-none");
|
|
|
|
| 625 |
fileInput.accept = "image/*";
|
| 626 |
workspaceStatus.textContent = activeFile ? "Image Loaded" : "No Media Loaded";
|
| 627 |
} else {
|
| 628 |
+
mediaTypeVideoBtn.className = "py-1.5 rounded-lg font-semibold text-[10px] transition-all bg-nvidia-brand text-black font-outfit font-black shadow shadow-nvidia-brand/10";
|
| 629 |
+
mediaTypeImageBtn.className = "py-1.5 rounded-lg font-semibold text-[10px] text-slate-400 hover:text-slate-200 transition-all";
|
| 630 |
videoFramesWrapper.classList.remove("hidden");
|
| 631 |
videoFramesWrapper.classList.remove("opacity-50");
|
| 632 |
videoFramesWrapper.classList.remove("pointer-events-none");
|
|
|
|
| 744 |
// Setup Media type
|
| 745 |
setMediaType(type);
|
| 746 |
|
| 747 |
+
// Fetch asset file with robust absolute URL resolution (works in iframe)
|
| 748 |
const ext = type === "Image" ? "jpg" : "mp4";
|
| 749 |
+
const resolvedAssetUrl = new URL(assetUrl, window.location.href).href;
|
| 750 |
+
console.log("Fetching example from:", resolvedAssetUrl);
|
| 751 |
+
const file = await loadExampleFromAsset(resolvedAssetUrl, `${name.toLowerCase()}.${ext}`);
|
| 752 |
if (file) {
|
| 753 |
handleFileImport(file);
|
| 754 |
}
|
|
|
|
| 867 |
detectionTagsWrapper.innerHTML = "";
|
| 868 |
detections.forEach(det => {
|
| 869 |
const tag = document.createElement("span");
|
| 870 |
+
tag.className = "px-2 py-0.5 rounded bg-nvidia-brand/10 text-nvidia-brand border border-nvidia-brand/20 font-bold uppercase tracking-wider text-[8px] animate-fade-in";
|
| 871 |
tag.textContent = det.frame ? `[Frame ${det.frame}] ${det.label}` : det.label;
|
| 872 |
detectionTagsWrapper.appendChild(tag);
|
| 873 |
});
|