AGENT SKILL

agentic-ecology-camera-traps

Provides capabilities to run SpeciesNet detector and classifier on camera trap images, extract crop-level feature embeddings, and populate a Hoplite vector database for downstream search and agile modeling. Use when ingesting camera trap images, classifying wildlife photos, or indexing camera trap data.

License 许可
Apache-2.0
所属仓库
leemiracle/work4ai
最近更新
2026-11-12
Stars
★ 4
Forks
0

01 前言 Front Matter

name
agentic-ecology-camera-traps
license
Apache-2.0
description
Provides capabilities to run SpeciesNet detector and classifier on camera trap images, extract crop-level feature embeddings, and populate a Hoplite vector database for downstream search and agile modeling. Use when ingesting camera trap images, classifying wildlife photos, or indexing camera trap data.
compatibility
Requires Python 3.12+, uv, PyTorch; GPU recommended for large datasets

02 资源文件 1

03 SKILL.md 正文

Camera Traps Skill

Use this skill when you need to process a collection of camera trap images, run species classification, extract vector representation embeddings, and store them inside a Hoplite vector database.

Workflow Overview

Follow these sequential steps:

  1. Identify Dataset and Limits:
    • Locate the target camera trap images directory.
    • Assess if a GPU is available on the system. If running on CPU-only, discuss with the user or apply a processing limit (e.g., first 1000 images) to prevent the ingestion pipeline from running excessively long.
  2. Initialize Hoplite Database:
    • Create a Hoplite database (SQLiteUSearchDB) at the destination folder.
    • Configure it with an embedding dimension of 1280 (EfficientNet-V2 M feature size), the metric set to Cos, and the data type set to float16.
  3. Run Ingestion Pipeline:
    • Instantiate the SpeciesNetDetector and SpeciesNetClassifier models (if running in an environment with pre-mounted read-only models like /kaggle/input/ on Colab, copy the model directory to a local writable path first; see the Technical Reference).
    • Register a PyTorch forward hook on the classifier's average pooling layer (SpeciesNet/efficientnetv2-m/avg_pool/Mean_Squeeze__3825) to intercept raw embeddings.
    • For each image:
      • Insert it into the database as a recording.
      • Run the detector model to get bounding box coords for animal detections.
      • Crop the PIL image to the bounding box, preprocess it, and run the classifier to extract the 1280-dim embedding vector.
      • Cast the vector to float16 and insert it into the database as a window.
    • Commit database changes periodically and at the end of ingestion via db.commit() to persist SQLite rows and flush the USearch vector index to disk.
  4. Agile Modeling and Search:
    • Once populated, use the Hoplite database to perform vector searches (ranking by similarity) or train active learning classifiers on top of the embeddings.
  5. Camera Trap Visualization Guidelines (M3 UI):
    • Context Preservation: Avoid displaying raw cropped images in the result cards. Instead, display the original (uncropped) image inside the card container and draw the animal detection as a red border box overlay dynamically using CSS absolute positioning and percentages (e.g., left: xmin * 100%, top: ymin * 100%, etc.).
    • Full-Resolution Modal Preview: Implement a click handler on the card media that triggers a floating fullscreen modal containing the uncropped image and the aligned bounding box overlay to allow the user to verify low-confidence detections.
    • Custom Query Search Support: The backend server supporting the Web UI must implement on-the-fly embedding extraction for custom HTTP/S query URIs by downloading the image, running the detector to identify target bounding boxes, preprocessing the crop, and capturing the embedding vector using the PyTorch forward hook on the classifier.

Technical Reference

For detailed model loading code, Kaggle/Colab read-only filesystem workarounds, PyTorch hook embedding extraction, and bounding box calculations, see:

04 同仓库更多 Skills

leemiracle
leemiracle/work4ai

agentic-ecology-ui

Guidelines and templates for creating a generic web UI to visualize, rank, filter, and annotate vector databases. The UI has a hierarchical structure covering database selection, label selection/definition, ranking/filtering configuration, and row visualization/annotation. Use when building, serving, or adapting an interactive web UI for Hoplite vector databases.

★ 4
leemiracle
leemiracle/work4ai

agentic-ecology-init

Initializes a local uv-managed project directory for agentic ecology workloads. Sets up Python dependencies using reference pyproject.toml and uv.lock, configures workspace rules, and ensures Agentic Ecology skills are discoverable. Use when initializing a new project workspace or bootstrapping a clean environment.

★ 4
leemiracle
leemiracle/work4ai

agentic-ecology-bioacoustics

Provides bioacoustic analysis capabilities for ecologists and researchers using the perch-hoplite Python package. A typical use case is to use agile modeling to bootstrap the creation and deployment of a bespoke detector for targeted species on an existing collection of passive acoustic monitoring recordings. Use when processing and annotating audio recordings for bioacoustic applications.

★ 4
leemiracle
leemiracle/work4ai

sample-skill

Sample skill used by agent-env integration tests. Exercises SKILL.md parsing plus supporting scripts and references.

★ 4
leemiracle
leemiracle/work4ai

simready-foundation-validate-foundation-change

Use for auditing SimReady requirement, validator, feature, profile, adapter, test, and skill consistency.

★ 4
leemiracle
leemiracle/work4ai

simready-foundation-update-validator

Use for updating SimReady validators, failure messages, edge cases, and tests while preserving requirement semantics.

★ 4