import React from 'react'; import { motion } from 'framer-motion'; export function BoundingBoxDemo() { return (
{/* Simulated Image */}
🚗
{/* Animated Bounding Box */} Car 98% {/* Corner markers */} {[ { top: -4, left: -4 }, { top: -4, right: -4 }, { bottom: -4, left: -4 }, { bottom: -4, right: -4 } ].map((pos, i) => ( ))}
); } export function PoseSkeletonDemo() { const keypoints = [ { id: 'head', x: 50, y: 10, label: 'Head' }, { id: 'neck', x: 50, y: 22 }, { id: 'lshoulder', x: 35, y: 25 }, { id: 'rshoulder', x: 65, y: 25 }, { id: 'lelbow', x: 25, y: 40 }, { id: 'relbow', x: 75, y: 40 }, { id: 'lwrist', x: 20, y: 55 }, { id: 'rwrist', x: 80, y: 55 }, { id: 'hip', x: 50, y: 50 }, { id: 'lhip', x: 40, y: 52 }, { id: 'rhip', x: 60, y: 52 }, { id: 'lknee', x: 38, y: 70 }, { id: 'rknee', x: 62, y: 70 }, { id: 'lankle', x: 35, y: 90 }, { id: 'rankle', x: 65, y: 90 }, ]; const bones = [ ['head', 'neck'], ['neck', 'lshoulder'], ['neck', 'rshoulder'], ['lshoulder', 'lelbow'], ['rshoulder', 'relbow'], ['lelbow', 'lwrist'], ['relbow', 'rwrist'], ['neck', 'hip'], ['hip', 'lhip'], ['hip', 'rhip'], ['lhip', 'lknee'], ['rhip', 'rknee'], ['lknee', 'lankle'], ['rknee', 'rankle'], ]; const getPoint = (id) => keypoints.find(k => k.id === id); return (
{/* Bones */} {bones.map(([from, to], i) => { const p1 = getPoint(from); const p2 = getPoint(to); return ( ); })} {/* Keypoints */} {keypoints.map((point, i) => ( ))}
); } export function EmotionFaceDemo() { const emotions = [ { emoji: '😊', label: 'Happy', color: 'from-yellow-400 to-orange-400' }, { emoji: '😢', label: 'Sad', color: 'from-blue-400 to-indigo-400' }, { emoji: '😠', label: 'Angry', color: 'from-red-400 to-rose-400' }, { emoji: '😲', label: 'Surprise', color: 'from-purple-400 to-pink-400' }, { emoji: '😐', label: 'Neutral', color: 'from-gray-400 to-slate-400' }, ]; const [currentEmotion, setCurrentEmotion] = React.useState(0); React.useEffect(() => { const interval = setInterval(() => { setCurrentEmotion((prev) => (prev + 1) % emotions.length); }, 2000); return () => clearInterval(interval); }, []); const emotion = emotions[currentEmotion]; return (
{emotion.emoji} {emotion.label} {/* Confidence Bars */}
{emotions.map((e, i) => (
{e.emoji}
{i === currentEmotion ? '95%' : `${Math.floor(Math.random() * 20 + 5)}%`}
))}
); }