import HfIcon from "./HfIcon"; import GlassContainer from "./GlassContainer"; import GlassButton from "./GlassButton"; import { GLASS_EFFECTS } from "../constants"; import type React from "react"; interface WelcomeScreenProps { onStart: () => void; onSelectCamera?: () => void; onSelectDisplay?: () => void; onSelectFile?: (file: File) => void; isSourceReady?: boolean; } export default function WelcomeScreen({ onStart, onSelectCamera, onSelectDisplay, onSelectFile, isSourceReady }: WelcomeScreenProps) { const handleFileChange = (e: React.ChangeEvent) => { const file = e.target.files?.[0]; if (file && onSelectFile) onSelectFile(file); // Reset input so selecting the same file again re-triggers change e.currentTarget.value = ""; }; return (
{/* Main Title Card */}

FastVLM WebGPU

Real-time video captioning powered by{" "} FastVLM-0.5B

{/* Source Selection Card */}
{ e.preventDefault(); onSelectCamera?.(); }} className="px-4 py-3 rounded-2xl" aria-label="Use Camera" > Use Camera { e.preventDefault(); onSelectDisplay?.(); }} className="px-4 py-3 rounded-2xl" aria-label="Share Tab or Screen" > Share Tab/Screen
{ e.preventDefault(); document.getElementById("video-file-input")?.click(); }} className="px-4 py-3 rounded-2xl" aria-label="Upload Video" > Upload Video
Start Live Captioning
{/* How It Works Card */}

How it works:

1

You are about to load{" "} FastVLM-0.5B , a powerful multimodal model optimized for in-browser inference.

2

Everything runs entirely in your browser with{" "} Transformers.js {" "} and ONNX Runtime Web, meaning no data is sent to a server. It can even run offline!

3

Get started by clicking the button below.

AI model will load when you click start

); }