Spaces:
Running
Running
| export interface CocoExample { | |
| url: string; | |
| prompt: string; | |
| label: string; | |
| } | |
| export const DEFAULT_DETECTION_PROMPT = | |
| 'Detect all objects in this image. Return each detection as JSON: [{"box_2d": [y1, x1, y2, x2], "label": "object_name"}]'; | |
| const DETECT_PROMPT = DEFAULT_DETECTION_PROMPT; | |
| const DESCRIBE_PROMPT = | |
| "Describe this image in detail. What objects, people, and activities do you see?"; | |
| // Verified existing images in the Xenova/transformers.js-docs dataset (CORS enabled, stable) | |
| const BASE = "https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main"; | |
| export const COCO_EXAMPLES: CocoExample[] = [ | |
| { | |
| url: `${BASE}/cats.jpg`, | |
| prompt: DETECT_PROMPT, | |
| label: "Cats", | |
| }, | |
| { | |
| url: `${BASE}/city-streets.jpg`, | |
| prompt: DETECT_PROMPT, | |
| label: "Streets", | |
| }, | |
| { | |
| url: `${BASE}/corgi.jpg`, | |
| prompt: DETECT_PROMPT, | |
| label: "Corgi", | |
| }, | |
| { | |
| url: `${BASE}/football-match.jpg`, | |
| prompt: DETECT_PROMPT, | |
| label: "Football", | |
| }, | |
| { | |
| url: `${BASE}/airport.jpg`, | |
| prompt: DETECT_PROMPT, | |
| label: "Airport", | |
| }, | |
| { | |
| url: `${BASE}/butterfly.jpg`, | |
| prompt: DESCRIBE_PROMPT, | |
| label: "Butterfly", | |
| }, | |
| ]; | |