agentic-video Gallery

Count how many times a purple circle logo pops up

CountScreen recordingVerified
0:30CC-BY-4.0 · Lucas Werkmeister

Proof frames

Click a frame to seek

Tool calls

2 calls · agentic-video 0.3.1
count_occurrencesbox · 3 ms

Arguments

{
  "source": "$CLIP",
  "description": "a purple circle",
  "start_sec": 0,
  "fps": 5,
  "max_spans": 10
}

Result

{
  "ok": true,
  "data": {
    "status": "in_progress",
    "retry_after_seconds": 5
  }
}
count_occurrencesbox · 1 ms

Arguments

{
  "source": "$CLIP",
  "description": "a purple circle",
  "start_sec": 0,
  "fps": 5,
  "max_spans": 10
}

Result

{
  "ok": true,
  "data": {
    "status": "complete",
    "count": 4,
    "spans": [
      {
        "index": 1,
        "start_sec": 1.4,
        "end_sec": 2.4,
        "duration_sec": 1,
        "score": 1,
        "representative_sec": 1.8,
        "frame_badge": "#1",
        "weak": false,
        "region": {
          "x": 0.85,
          "y": 0.044,
          "w": 0.125,
          "h": 0.222
        },
        "travel": "stationary"
      },
      {
        "index": 2,
        "start_sec": 5.4,
        "end_sec": 6.4,
        "duration_sec": 1,
        "score": 1,
        "representative_sec": 5.8,
        "frame_badge": "#2",
        "weak": false,
        "region": {
          "x": 0.85,
          "y": 0.044,
          "w": 0.125,
          "h": 0.222
        },
        "travel": "stationary"
      },
      {
        "index": 3,
        "start_sec": 9.6,
        "end_sec": 10.6,
        "duration_sec": 1,
        "score": 1,
        "representative_sec": 10,
        "frame_badge": "#3",
        "weak": false,
        "region": {
          "x": 0.85,
          "y": 0.044,
          "w": 0.125,
          "h": 0.222
        },
        "travel": "stationary"
      },
      {
        "index": 4,
        "start_sec": 13.8,
        "end_sec": 14.8,
        "duration_sec": 1,
        "score": 1,
        "representative_sec": 14.2,
        "frame_badge": "#4",
        "weak": false,
        "region": {
          "x": 0.85,
          "y": 0.044,
          "w": 0.125,
          "h": 0.222
        },
        "travel": "stationary"
      }
    ],
    "spans_returned": 4,
    "spans_omitted": 0,
    "window": {
      "start_sec": 0,
      "end_sec": 30
    },
    "fps_used": 5,
    "frames_sampled": 150,
    "frames_analyzed": 103,
    "checks": {
      "text": null,
      "description": "a purple circle",
      "color": "purple",
      "shape": "circle"
    },
    "contact_sheet": {
      "file_path": "<cache>/aa3b7f6e9eee037f5844/contact_sheets/occurrences_7bd7a26b7b008b16bb57.jpg",
      "sample_count": 4,
      "rows": 1,
      "cols": 4,
      "frame_width": 288,
      "frame_height": 192,
      "labels": [
        "#1 1.8s",
        "#2 5.8s",
        "#3 10.0s",
        "#4 14.2s"
      ],
      "tool_file": {
        "_tag": "ToolFile",
        "name": "occurrences_7bd7a26b7b008b16bb57.jpg",
        "mimeType": "image/jpeg",
        "encoding": "base64",
        "data": "<83364 base64 chars dropped>",
        "byteLength": 62523
      }
    },
    "note": "Spans are sample-based (+/- 1/fps); verify each representative_sec with inspect_window. contact_sheet is one image with a tile per listed span, in span order: a zoomed frame of the span's best match, boxed, labeled with the span number and time. Look at each tile and drop any span whose tile is not the asked-for thing; spans marked * (`weak`) are the likeliest false ones. The answer is the number of tiles that match, plus any omitted spans and respecting any merged gaps noted above.",
    "verify": "Rough count: spans can be false, merge across scene cuts, split one appearance, or miss crossings. Before answering, look at each tile of the contact_sheet image (one per span, in span order, a zoomed frame of its best match, boxed) and drop any span whose tile is not the asked-for thing; spans with weak=true (tile label *) are the likeliest false ones. The answer is the number of tiles that match, plus any spans the sheet does not show; if you also count by eye and differ, trust your own."
  }
}

Question and answer

Question
How many times does the logo pop up?
Answer
count_occurrences counts 4 appearances of a purple circle in the 30-second clip.
Check passedanswer 4, expected 4 (tolerance 0)

How it was checked

Truth from
constructed
Fixed at

Planted by this recipe: ffmpeg overlaid a 80 px purple circle with a white K, drawn by Pillow, in the top-right corner of the first 30 s of the source, for 1 s at each of the times 1.4, 5.4, 9.6, 13.8 s, with at least 3 s of clear picture between two icons. The truth is the number of planted icons, 4.

A script drew a small purple circle with a white letter over the top-right corner of this clip, at set times one second long, so the count is the number of those planted appearances. The tool can also miss one or count a look-alike, and the card does not show every frame.

Try it yourself

Use agentic-video to count how many times the purple circle logo pops up in my video. Call count_occurrences on the whole clip with the description "a purple circle", and tell me the count. Use my own file.
  1. Get the .mcpb file and open it in Claude Desktop.
  2. Or: pip install agentic-video

Clip and licence

Licence
CC-BY-4.0
Author
Lucas Werkmeister
Source
commons.wikimedia.org
This file is licensed under the Creative Commons Attribution 4.0 International license.