Spaces:
Running on CPU Upgrade
Running on CPU Upgrade
Sync from huggingface/lerobot-dataset-visualizer via hub-sync
Browse filesFiles changed (2)
755 unmodified lines756757758759760761755 unmodified lines{activeTab === "frames" && (<OverviewPaneldata={episodeFramesData}loading={framesLoading}flaggedOnly={framesFlaggedOnly}onFlaggedOnlyChange={setFramesFlaggedOnly}755 unmodified lines756757758759760761762755 unmodified lines{activeTab === "frames" && (<OverviewPaneldata={episodeFramesData}cameras={datasetInfo.cameras}loading={framesLoading}flaggedOnly={framesFlaggedOnly}onFlaggedOnlyChange={setFramesFlaggedOnly}
1 unmodified line23456789101112131415161718192041 unmodified lines626364656667686970717238 unmodified lines1111121131141151161 unmodified line11811912012112212367 unmodified lines191192193194195196197198199200201202203204205102 unmodified lines3083093103113123131 unmodified lineimport React, { useState, useEffect, useRef, useCallback } from "react";import type {EpisodeFrameInfo,EpisodeFramesData,} from "@/app/[org]/[dataset]/[episode]/fetch-data";import { useFlaggedEpisodes } from "@/context/flagged-episodes-context";const PAGE_SIZE = 48;function FrameThumbnail({info,showLast,}: {info: EpisodeFrameInfo;showLast: boolean;}) {const containerRef = useRef<HTMLDivElement>(null);const videoRef = useRef<HTMLVideoElement>(null);41 unmodified linesreturn (<div ref={containerRef} className="flex flex-col items-center"><div className="w-full aspect-video bg-[var(--surface-1)] rounded overflow-hidden relative group">{inView ? (<videoref={videoRef}src={info.videoUrl}preload="metadata"mutedclassName="w-full h-full object-cover"38 unmodified linesinterface OverviewPanelProps {data: EpisodeFramesData | null;loading: boolean;flaggedOnly?: boolean;onFlaggedOnlyChange?: (v: boolean) => void;1 unmodified lineexport default function OverviewPanel({data,loading,flaggedOnly = false,onFlaggedOnlyChange,67 unmodified lines}const totalPages = Math.ceil(frames.length / PAGE_SIZE);const pageFrames = frames.slice(page * PAGE_SIZE, (page + 1) * PAGE_SIZE);return (<div className="max-w-7xl mx-auto py-6 space-y-5"><p className="text-sm text-slate-500">Use first/last frame views to spot episodes with bad end states or otheranomalies. Hover over a thumbnail and click the flag icon to markepisodes with wrong outcomes for review.</p>{/* Controls row */}<div className="flex items-center justify-between flex-wrap gap-4">102 unmodified lineskey={`${selectedCamera}-${info.episodeIndex}`}info={info}showLast={showLast}/>))}</div>1 unmodified line2345678910111213141516171819202122232441 unmodified lines666768697071727374757677787938 unmodified lines1181191201211221231241 unmodified line12612712812913013113267 unmodified lines200201202203204205206207208209210211212213214215216217218219220221102 unmodified lines3243253263273283293301 unmodified lineimport React, { useState, useEffect, useRef, useCallback } from "react";import type {CameraInfo,EpisodeFrameInfo,EpisodeFramesData,} from "@/app/[org]/[dataset]/[episode]/fetch-data";import { useFlaggedEpisodes } from "@/context/flagged-episodes-context";import { proxyHfUrl } from "@/utils/auth";const PAGE_SIZE = 48;function FrameThumbnail({info,showLast,aspectRatio,}: {info: EpisodeFrameInfo;showLast: boolean;aspectRatio: number;}) {const containerRef = useRef<HTMLDivElement>(null);const videoRef = useRef<HTMLVideoElement>(null);41 unmodified linesreturn (<div ref={containerRef} className="flex flex-col items-center"><divclassName="w-full bg-[var(--surface-1)] rounded overflow-hidden relative group"style={{ aspectRatio }}>{inView ? (<videoref={videoRef}src={proxyHfUrl(info.videoUrl)}preload="metadata"mutedclassName="w-full h-full object-cover"38 unmodified linesinterface OverviewPanelProps {data: EpisodeFramesData | null;cameras: CameraInfo[];loading: boolean;flaggedOnly?: boolean;onFlaggedOnlyChange?: (v: boolean) => void;1 unmodified lineexport default function OverviewPanel({data,cameras,loading,flaggedOnly = false,onFlaggedOnlyChange,67 unmodified lines}const totalPages = Math.ceil(frames.length / PAGE_SIZE);/// The camera's own shape: a fixed 16:9 box with object-cover cropped 4:3 frames top and bottom.const camera = cameras.find((c) => c.name === selectedCamera);const aspectRatio =camera && camera.height > 0 ? camera.width / camera.height : 16 / 9;const pageFrames = frames.slice(page * PAGE_SIZE, (page + 1) * PAGE_SIZE);return (<div className="max-w-7xl mx-auto py-6 space-y-5"><div><h2 className="text-xl font-bold text-slate-100">Frames</h2><p className="text-sm text-slate-400 mt-1">Use first/last frame views to spot episodes with bad end states orother anomalies. Hover over a thumbnail and click the flag icon tomark episodes with wrong outcomes for review.</p></div>{/* Controls row */}<div className="flex items-center justify-between flex-wrap gap-4">102 unmodified lineskey={`${selectedCamera}-${info.episodeIndex}`}info={info}showLast={showLast}aspectRatio={aspectRatio}/>))}</div>
src/app/[org]/[dataset]/[episode]/episode-viewer.tsx+1
src/components/overview-panel.tsx+24-7