Spaces:
Running on CPU Upgrade
Running on CPU Upgrade
Sync from huggingface/lerobot-dataset-visualizer via hub-sync
Browse files
src/app/[org]/[dataset]/[episode]/episode-viewer.tsx
CHANGED
|
@@ -18,6 +18,7 @@ import StatsPanel from "@/components/stats-panel";
|
|
| 18 |
import OverviewPanel from "@/components/overview-panel";
|
| 19 |
import Loading from "@/components/loading-component";
|
| 20 |
import HfAuthButton from "@/components/hf-auth-button";
|
|
|
|
| 21 |
import { hasURDFSupport } from "@/lib/so101-robot";
|
| 22 |
import {
|
| 23 |
computeColumnMinMax,
|
|
@@ -638,35 +639,10 @@ function EpisodeViewerInner({
|
|
| 638 |
|
| 639 |
{activeTab === "episodes" && (
|
| 640 |
<>
|
| 641 |
-
<
|
| 642 |
-
|
| 643 |
-
|
| 644 |
-
|
| 645 |
-
className="block shrink-0 opacity-90 hover:opacity-100 transition-opacity"
|
| 646 |
-
>
|
| 647 |
-
{/* eslint-disable-next-line @next/next/no-img-element */}
|
| 648 |
-
<img
|
| 649 |
-
src="https://github.com/huggingface/lerobot/raw/main/media/readme/lerobot-logo-thumbnail.png"
|
| 650 |
-
alt="LeRobot Logo"
|
| 651 |
-
className="w-24"
|
| 652 |
-
/>
|
| 653 |
-
</a>
|
| 654 |
-
|
| 655 |
-
<div className="min-w-0">
|
| 656 |
-
<a
|
| 657 |
-
href={`https://huggingface.co/datasets/${datasetInfo.repoId}`}
|
| 658 |
-
target="_blank"
|
| 659 |
-
className="text-slate-200 hover:text-cyan-300 transition-colors"
|
| 660 |
-
>
|
| 661 |
-
<p className="text-base font-medium truncate">
|
| 662 |
-
{datasetInfo.repoId}
|
| 663 |
-
</p>
|
| 664 |
-
</a>
|
| 665 |
-
<p className="text-[10px] uppercase tracking-wide text-slate-500 mt-0.5 tabular">
|
| 666 |
-
Episode 路 {episodeId}
|
| 667 |
-
</p>
|
| 668 |
-
</div>
|
| 669 |
-
</div>
|
| 670 |
|
| 671 |
{/* Videos */}
|
| 672 |
{videosInfo.length > 0 && (
|
|
@@ -708,14 +684,10 @@ function EpisodeViewerInner({
|
|
| 708 |
|
| 709 |
{activeTab === "annotations" && (
|
| 710 |
<div className="annotations-skin flex flex-col gap-4">
|
| 711 |
-
<
|
| 712 |
-
|
| 713 |
-
|
| 714 |
-
|
| 715 |
-
<p className="text-[10px] uppercase tracking-wide text-slate-500 tabular">
|
| 716 |
-
Episode 路 {episodeId}
|
| 717 |
-
</p>
|
| 718 |
-
</div>
|
| 719 |
{videosInfo.length > 0 && (
|
| 720 |
<SimpleVideosPlayer
|
| 721 |
videosInfo={videosInfo}
|
|
|
|
| 18 |
import OverviewPanel from "@/components/overview-panel";
|
| 19 |
import Loading from "@/components/loading-component";
|
| 20 |
import HfAuthButton from "@/components/hf-auth-button";
|
| 21 |
+
import { EpisodeHeader } from "@/components/ui";
|
| 22 |
import { hasURDFSupport } from "@/lib/so101-robot";
|
| 23 |
import {
|
| 24 |
computeColumnMinMax,
|
|
|
|
| 639 |
|
| 640 |
{activeTab === "episodes" && (
|
| 641 |
<>
|
| 642 |
+
<EpisodeHeader
|
| 643 |
+
repoId={datasetInfo.repoId}
|
| 644 |
+
episodeId={episodeId}
|
| 645 |
+
/>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 646 |
|
| 647 |
{/* Videos */}
|
| 648 |
{videosInfo.length > 0 && (
|
|
|
|
| 684 |
|
| 685 |
{activeTab === "annotations" && (
|
| 686 |
<div className="annotations-skin flex flex-col gap-4">
|
| 687 |
+
<EpisodeHeader
|
| 688 |
+
repoId={datasetInfo.repoId}
|
| 689 |
+
episodeId={episodeId}
|
| 690 |
+
/>
|
|
|
|
|
|
|
|
|
|
|
|
|
| 691 |
{videosInfo.length > 0 && (
|
| 692 |
<SimpleVideosPlayer
|
| 693 |
videosInfo={videosInfo}
|
src/components/ui.tsx
CHANGED
|
@@ -126,3 +126,43 @@ export function Switch({
|
|
| 126 |
</div>
|
| 127 |
);
|
| 128 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 126 |
</div>
|
| 127 |
);
|
| 128 |
}
|
| 129 |
+
|
| 130 |
+
/** Repo and episode above the videos, on every tab that plays an episode. */
|
| 131 |
+
export function EpisodeHeader({
|
| 132 |
+
repoId,
|
| 133 |
+
episodeId,
|
| 134 |
+
}: {
|
| 135 |
+
repoId: string;
|
| 136 |
+
episodeId: number;
|
| 137 |
+
}) {
|
| 138 |
+
return (
|
| 139 |
+
<div className="flex items-center gap-4">
|
| 140 |
+
<a
|
| 141 |
+
href="https://github.com/huggingface/lerobot"
|
| 142 |
+
target="_blank"
|
| 143 |
+
rel="noopener noreferrer"
|
| 144 |
+
className="block shrink-0 opacity-90 hover:opacity-100 transition-opacity"
|
| 145 |
+
>
|
| 146 |
+
{/* eslint-disable-next-line @next/next/no-img-element */}
|
| 147 |
+
<img
|
| 148 |
+
src="https://github.com/huggingface/lerobot/raw/main/media/readme/lerobot-logo-thumbnail.png"
|
| 149 |
+
alt="LeRobot Logo"
|
| 150 |
+
className="w-24"
|
| 151 |
+
/>
|
| 152 |
+
</a>
|
| 153 |
+
<div className="min-w-0">
|
| 154 |
+
<a
|
| 155 |
+
href={`https://huggingface.co/datasets/${repoId}`}
|
| 156 |
+
target="_blank"
|
| 157 |
+
rel="noopener noreferrer"
|
| 158 |
+
className="text-slate-200 hover:text-cyan-300 transition-colors"
|
| 159 |
+
>
|
| 160 |
+
<p className="text-base font-medium truncate">{repoId}</p>
|
| 161 |
+
</a>
|
| 162 |
+
<p className="text-[10px] uppercase tracking-wide text-slate-500 mt-0.5 tabular">
|
| 163 |
+
Episode 路 {episodeId}
|
| 164 |
+
</p>
|
| 165 |
+
</div>
|
| 166 |
+
</div>
|
| 167 |
+
);
|
| 168 |
+
}
|