agentsclimarketplace

Run2 object counting

Skill cxcscmu/SkillLearnBench/skills/b2-self-feedback-gemini-3.1-pro-preview/video-object-counting/run2_object-counting

Count the number of object occurrences in an image using OpenCV template matching in Python.From its SKILL.md

Install
npx -y skills add cxcscmu/SkillLearnBench --skill run2_object-counting

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

SKILL.md

1.7 KB, 364 tokens by cl100k_base, as published. Nobody here has run it

Object Counting

Count the number of objects in an image using computer vision, specifically Normalized Cross-Correlation (Template Matching).

Usage

The count_objects.py script provided in the environment performs template matching and outputs the number of matches found.

python3 /root/.agents/skills/object_counter/scripts/count_objects.py \
    --tool count \
    --input_image <image_file> \
    --object_image <object_template_file> \
    --threshold <threshold_value> \
    --dedup_min_dist <distance>

Arguments Explained:

  • --input_image: The target image where objects should be counted.
  • --object_image: The template image of the object you are searching for.
  • --threshold: The matching confidence threshold (e.g., 0.9 for high fidelity).
  • --dedup_min_dist: Minimum pixel distance to deduplicate overlapping matches (e.g., 3).

Example

python3 /root/.agents/skills/object_counter/scripts/count_objects.py \
    --tool count \
    --input_image frame_001.png \
    --object_image coin.png \
    --threshold 0.9 \
    --dedup_min_dist 3

Parsing Output

The script prints the result in the following format to standard output: There are X objects (\<template_path>`) in file: `<image_path>``

You can parse this programmatically using regular expressions in a Python wrapper script:

import re, subprocess

result = subprocess.run(cmd, stdout=subprocess.PIPE, text=True)
match = re.search(r'There are (\d+) objects', result.stdout)
if match:
    count = int(match.group(1))

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.