Skip to main content

Amon Hen

"From the Seat of Seeing, no moment remains hidden."

A fast, lightweight CLI and Python library for natural language video moment retrieval on local CPU. Runs entirely on CPU without discrete GPUs, background daemons, or cloud dependencies.

PyPI Python 3.11+ License: MIT


Key Highlights

  • 100% CPU Execution: Powered by Apple's MobileCLIP2 architecture, Whisper-Tiny ONNX, and ONNX Runtime.
  • Hybrid Visual & Speech Retrieval: Simultaneously retrieves moments based on visual semantics and spoken dialogue.
  • Low Footprint: Hybrid FP32-vision + INT8-quantized text pipeline (approx. 105 MB RAM).
  • Zero Infrastructure: Embedded vector database and full-text index via SQLite, sqlite-vec, and FTS5 (single .db file).
  • High Throughput: 3-gate adaptive motion sampler achieving 4.8x to 18.5x realtime indexing speed.
  • Temporal Grouping: Merges consecutive matching frames into start-end timestamp intervals.

Installation

# Recommended via uv
uv tool install amon-hen

# Or via pipx
pipx install amon-hen

# Or standard pip
pip install amon-hen

Quickstart

1. Interactive Terminal UI

Run amon-hen without arguments to launch the interactive prompt:

amon-hen

Supports instant search queries, history navigation (/), /open <n> to play matches in your default player, and /cut <n> [output] to export clips.

2. Index Videos

# Index a video or entire folder with adaptive motion sampling
amon-hen index /path/to/videos/ --sampler adaptive

3. Search Moments

# Search visual actions or spoken dialogue (Battle of Amon Hen)
amon-hen search "swords fight warriors in forest"

# Search real-world surveillance events (CCTV footage)
amon-hen search "a person holding an umbrella"

4. Extract Video Clip

# Extract matching segment into a standalone video clip
amon-hen cut battle-of-amon-hen.webm --start 00:03:56 --end 00:04:52 -o battle_climax.mp4

Python API

from amonhen.encode import TextEncoder
from amonhen.model_registry import get_model
from amonhen.pipeline import search
from amonhen.store import Store

# 1. Connect to index
store = Store("index.db", embed_dim=512)

# 2. Load CPU-optimized text encoder
spec = get_model("mobileclip2-s0")
text_encoder = TextEncoder(spec)

# 3. Retrieve matching video segments
results = search("red sports car turning", store=store, text_encoder=text_encoder)
for seg in results:
    print(
        f"{seg.video_path}: {seg.start_ms / 1000.0:.1f}s - {seg.end_ms / 1000.0:.1f}s (score: {seg.score:.3f})"
    )

store.close()

Capabilities & Known Limitations

  • Visual Semantic Search (MobileCLIP2): Strong zero-shot recognition for objects, actions, settings, spatial arrangements, and characters. Adding descriptive context (e.g. "Aragorn with sword" vs "Aragorn") maximizes cosine similarity and avoids domain noise.
  • Speech-to-Text (Whisper-Tiny ONNX): Indexes clean spoken dialogue across speeches, podcasts, lectures, and vlogs. It is not an acoustic sound-effects classifier. Low-confidence dialogue on heavy orchestral soundtracks is automatically filtered to prevent hallucinations.
  • Lossless Stream Cut: Sub-second extraction aligns to nearest container keyframes; use --reencode for exact frame-level cuts.

Resources & Links

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

amon_hen-0.1.19.tar.gz (27.2 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

amon_hen-0.1.19-py3-none-any.whl (40.5 kB view details)

Uploaded Python 3

File details

Details for the file amon_hen-0.1.19.tar.gz.

File metadata

  • Download URL: amon_hen-0.1.19.tar.gz
  • Upload date:
  • Size: 27.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for amon_hen-0.1.19.tar.gz
Algorithm Hash digest
SHA256 e9243821375ef5af729b5689dd6aed0a5eab7f75da225beccc2a9027ffcb46c2
MD5 f5ea8a5708384d0eecbc36aea0a2456e
BLAKE2b-256 c5c32c7277559770bff9e4e645bfbbda3e720b3bdd07eafca635943b378b4435

See more details on using hashes here.

Provenance

The following attestation bundles were made for amon_hen-0.1.19.tar.gz:

Publisher: release.yml on flxhrdyn/amon-hen

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file amon_hen-0.1.19-py3-none-any.whl.

File metadata

  • Download URL: amon_hen-0.1.19-py3-none-any.whl
  • Upload date:
  • Size: 40.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for amon_hen-0.1.19-py3-none-any.whl
Algorithm Hash digest
SHA256 bc79b9f82fa8a3ca3fb53ca620ced2d7256cb07e4a4530569e29527264169c5d
MD5 dcb1eb1f8c7f1aa65ce5d0b6c4dacd21
BLAKE2b-256 7bd59cf43b0920975705e0588c8b7406653e5b1f335e576f1d7c2373c4038c7c

See more details on using hashes here.

Provenance

The following attestation bundles were made for amon_hen-0.1.19-py3-none-any.whl:

Publisher: release.yml on flxhrdyn/amon-hen

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.1.21

2 files

0.1.20

2 files

This release

0.1.19 This release

2 files

0.1.18

2 files

0.1.17

2 files

0.1.16

2 files

0.1.15

2 files

0.1.14

2 files

0.1.13

2 files

0.1.12

2 files

0.1.11

2 files

0.1.10

2 files

0.1.9

2 files

0.1.8

2 files

0.1.7

2 files

0.1.6

2 files

0.1.5

2 files

0.1.4

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page