File size: 1,190 Bytes
576d07a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
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",
  },
];