Evo Egomotion Analysis logo

Evo Egomotion Analysis

Community
Zhang-Henry
evo-egomotion-analysis

Analyze camera egomotion and detect dynamic objects in video. Classifies camera motion (Stay, Dolly In/Out, Pan Left/Right, Tilt Up/Down, Roll Left/Right) and produces binary masks of independently moving objects. All thresholds are derived from runtime data distributions. Use when given a video file and asked to produce motion labels JSON and dynamic object masks in CSR NPZ format.

Overview

PublisherZhang-Henry
RepositoryCoEvoSkills
Skill nameevo-egomotion-analysis
Stars
83
Forks
9
Bundled files
6
LicenseApache-2.0
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 6 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by Zhang-Henry on GitHub. Read the source before you install it.

Installation

Install the Evo Egomotion Analysis AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/Zhang-Henry/CoEvoSkills/tree/main/artifacts/skills/dynamic-object-aware-egomotion/evo-egomotion-analysis
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Zhang-Henry/CoEvoSkills.git /tmp/CoEvoSkills
mkdir -p .claude/skills
cp -r /tmp/CoEvoSkills/artifacts/skills/dynamic-object-aware-egomotion/evo-egomotion-analysis .claude/skills/evo-egomotion-analysis
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Evo Egomotion Analysis in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Evo Egomotion Analysis on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Evo Egomotion Analysis is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Egomotion Analysis and Dynamic Object Segmentation

Overview

This skill analyzes video to:

  1. Classify camera motion (egomotion) into labeled intervals
  2. Detect dynamic (independently moving) objects and produce binary masks

All classification and detection thresholds are derived from the runtime data distribution rather than fixed constants.

Architecture

Scripts

  • scripts/video_utils.py - Frame sampling and optical flow computation
  • scripts/homography_utils.py - Homography estimation and expected flow
  • scripts/motion_classifier.py - Motion parameter extraction, noise-floor threshold estimation, and camera motion classification
  • scripts/dynamic_segmentation.py - Dynamic object detection via adaptive flow residual thresholding
  • scripts/csr_utils.py - CSR sparse format encoding/decoding
  • scripts/pipeline.py - End-to-end pipeline orchestrating all steps

Pipeline Steps

  1. Sample video at caller-supplied target FPS
  2. Compute dense optical flow (Farneback) between consecutive sampled frames
  3. Estimate homography (ORB + RANSAC) for global camera motion
  4. Extract motion parameters (scale, dx, dy, roll) from each homography
  5. Derive classification thresholds from the parameter distributions
  6. Classify camera motion per frame, smooth temporally, merge into intervals
  7. Detect dynamic objects via adaptive residual thresholding and morphological cleanup
  8. Apply temporal mask propagation for consistency
  9. Save outputs (JSON intervals + CSR NPZ masks)

Usage

python
import sys
sys.path.insert(0, '/app/environment/skills/evo-egomotion-analysis/scripts')
from pipeline import run_pipeline, validate_outputs

# All paths and fps are caller-supplied; no defaults embed current-instance paths
intervals, masks = run_pipeline(
    video_path='<path-to-video>',
    target_fps=5,
    json_output='<path-to-output-json>',
    mask_output='<path-to-output-npz>'
)

# Validate
n_frames = len(masks)
shape = masks[0].shape
validate_outputs('<path-to-output-json>', '<path-to-output-npz>', n_frames, shape)

Threshold Derivation

  • Scale threshold: 2x MAD of scale ratios across all frame pairs
  • Pan threshold: 2x MAD of |dx| values
  • Tilt threshold: mean(|dy|) + 2*std(dy), ensuring noise is filtered
  • Roll threshold: 2.5*std of roll angles from proper homography decomposition
  • Dynamic detection: median + 3.5MAD of residual magnitude per frame, with a floor of 1.5median + 1.0
  • Fusion threshold: derived from nonzero evidence distribution per frame

Output Formats

Motion Labels JSON

Intervals are half-open ranges covering indices 0 through N-1, final interval ends at N. Valid labels: Stay, Dolly In, Dolly Out, Pan Left, Pan Right, Tilt Up, Tilt Down, Roll Left, Roll Right.

Dynamic Masks NPZ (CSR format)

  • shape: [H, W]
  • f_{i}_data: array of 1s (True pixel values)
  • f_{i}_indices: column indices of dynamic pixels
  • f_{i}_indptr: row pointer array (length H+1)

Key Design Decisions

  • Sign inversion: Pan Right = negative dx in image coords
  • Roll extracted via cv2.decomposeHomographyMat (translation-dominant solution)
  • Adaptive thresholding for dynamic detection based on per-frame residual stats
  • Temporal propagation using flow-warped previous masks
  • Morphological kernel sizes scaled to image resolution
  • Last sampled frame duplicates the previous frame's labels and mask

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Evo Egomotion Analysis AI skill do?

Analyze camera egomotion and detect dynamic objects in video. Classifies camera motion (Stay, Dolly In/Out, Pan Left/Right, Tilt Up/Down, Roll Left/Right) and produces binary masks of independently moving objects. All thresholds are derived from runtime data distributions. Use when given a video file and asked to produce motion labels JSON and dynamic object masks in CSR NPZ format.

Why use Evo Egomotion Analysis on TypingMind?

Because you install it once and use it with any model. Evo Egomotion Analysis is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Evo Egomotion Analysis in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/Zhang-Henry/CoEvoSkills/tree/main/artifacts/skills/dynamic-object-aware-egomotion/evo-egomotion-analysis. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Evo Egomotion Analysis?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Evo Egomotion Analysis?

As many as you like. As long as a model supports skills, you can use Evo Egomotion Analysis with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Evo Egomotion Analysis AI skill free?

Yes. It is published on GitHub by Zhang-Henry under the Apache-2.0 license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇