"use client"; import { useState } from "react"; import { motion } from "framer-motion"; import { COLORS, VizFrame } from "./common"; type Model = { name: string; latency: number; // ms, T4 TensorRT FP16 (or paper-reported V100 where noted) map: number; // COCO val2017 mAP@50:95 family: "yolo" | "detr" | "rfdetr"; }; // Public reference numbers — see citations below the chart. // Ultralytics docs https://docs.ultralytics.com/models/ // DETR paper https://arxiv.org/abs/2005.12872 // RT-DETR paper https://arxiv.org/abs/2304.08069 // RF-DETR blog https://blog.roboflow.com/rf-detr/ const MODELS: Model[] = [ { name: "YOLOv8n", latency: 1.5, map: 37.3, family: "yolo" }, { name: "YOLOv8s", latency: 2.7, map: 44.9, family: "yolo" }, { name: "YOLOv8m", latency: 5.1, map: 50.2, family: "yolo" }, { name: "YOLOv8l", latency: 8.7, map: 52.9, family: "yolo" }, { name: "YOLO11n", latency: 1.5, map: 39.5, family: "yolo" }, { name: "YOLO11s", latency: 2.5, map: 47.0, family: "yolo" }, { name: "YOLO11m", latency: 4.7, map: 51.5, family: "yolo" }, { name: "DETR-R50", latency: 28.0, map: 42.0, family: "detr" }, { name: "DETR-R101", latency: 36.0, map: 43.5, family: "detr" }, { name: "RT-DETR-R18", latency: 4.6, map: 46.5, family: "detr" }, { name: "RT-DETR-R50", latency: 9.3, map: 53.1, family: "detr" }, { name: "RT-DETR-R101", latency: 13.5, map: 54.3, family: "detr" }, { name: "RF-DETR-N", latency: 2.3, map: 48.4, family: "rfdetr" }, { name: "RF-DETR-S", latency: 3.5, map: 53.0, family: "rfdetr" }, { name: "RF-DETR-B", latency: 6.0, map: 55.0, family: "rfdetr" }, ]; const FAMILY_COLOR: Record = { yolo: COLORS.accent, detr: COLORS.green, rfdetr: COLORS.honey, }; export function LatencyMap({ width = 740, height = 460, }: { width?: number; height?: number; }) { const padX = 60; const padY = 50; const xMax = 40; const yMin = 30; const yMax = 60; const sx = (x: number) => padX + (x / xMax) * (width - padX * 2); const sy = (y: number) => height - padY - ((y - yMin) / (yMax - yMin)) * (height - padY * 2); const [hover, setHover] = useState(null); return ( inference latency (ms) mAP@50:95 {[5, 10, 15, 20, 25, 30, 35].map((g) => ( {g} ))} {[35, 40, 45, 50, 55].map((g) => ( {g} ))} {MODELS.map((m, i) => ( setHover(m.name)} onMouseLeave={() => setHover(null)} style={{ cursor: "pointer" }} > {m.name} ))} {(["yolo", "detr", "rfdetr"] as const).map((fam, i) => ( {fam} ))} ); }