Spaces:
Running
Running
Download new/frontends/react/src/DataViewer.tsx from elvis-hf/cnn_visualizer: direct link, hf CLI and curl.
- Browser
- Download file 689 Bytes
-
https://huggingface.co/spaces/elvis-hf/cnn_visualizer/resolve/main/new/frontends/react/src/DataViewer.tsx
- Command line
-
hf download hf://spaces/elvis-hf/cnn_visualizer/new/frontends/react/src/DataViewer.tsx
-
curl -L -o DataViewer.tsx https://huggingface.co/spaces/elvis-hf/cnn_visualizer/resolve/main/new/frontends/react/src/DataViewer.tsx
689 Bytes
| import Button from "./ui/Button"; | |
| interface DataViewerProps { | |
| onGetRandomSample: () => void; | |
| imageUrl: string | null; | |
| label: string | null; | |
| } | |
| export default function DataViewer({ onGetRandomSample, imageUrl, label }: DataViewerProps) { | |
| return ( | |
| <div className="min-h-0 min-w-0 flex flex-col items-center"> | |
| { imageUrl && ( | |
| <div className="flex flex-col items-center gap-2 p-4"> | |
| <img src={imageUrl} alt="Sample" className="max-h-64 object-contain border border-gray-300"/> | |
| <div className="text-lg font-medium">Label: {label}</div> | |
| </div> | |
| ) } | |
| <Button label="Get Random Sample" onClick={onGetRandomSample} /> | |
| </div> | |
| ) | |
| } |