amon-hen 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- amon_hen-0.1.0/.env.example +3 -0
- amon_hen-0.1.0/.github/ISSUE_TEMPLATE/bug_report.yml +66 -0
- amon_hen-0.1.0/.github/ISSUE_TEMPLATE/config.yml +5 -0
- amon_hen-0.1.0/.github/ISSUE_TEMPLATE/feature_request.yml +32 -0
- amon_hen-0.1.0/.github/PULL_REQUEST_TEMPLATE.md +25 -0
- amon_hen-0.1.0/.github/workflows/ci.yml +63 -0
- amon_hen-0.1.0/.github/workflows/release.yml +38 -0
- amon_hen-0.1.0/.gitignore +15 -0
- amon_hen-0.1.0/CHANGELOG.md +21 -0
- amon_hen-0.1.0/CODE_OF_CONDUCT.md +76 -0
- amon_hen-0.1.0/CONTRIBUTING.md +117 -0
- amon_hen-0.1.0/LICENSE +21 -0
- amon_hen-0.1.0/PKG-INFO +296 -0
- amon_hen-0.1.0/README.md +258 -0
- amon_hen-0.1.0/SECURITY.md +27 -0
- amon_hen-0.1.0/benchmarks/__init__.py +1 -0
- amon_hen-0.1.0/benchmarks/dataset.py +112 -0
- amon_hen-0.1.0/benchmarks/metrics.py +116 -0
- amon_hen-0.1.0/benchmarks/run.py +183 -0
- amon_hen-0.1.0/demo/README.md +34 -0
- amon_hen-0.1.0/demo/cctv-people-demo.webm +0 -0
- amon_hen-0.1.0/demo/demo.gif +0 -0
- amon_hen-0.1.0/demo/demo.tape +25 -0
- amon_hen-0.1.0/demo/generate_gif.py +407 -0
- amon_hen-0.1.0/docs/CLI_GUIDE.md +115 -0
- amon_hen-0.1.0/docs/PYTHON_API.md +106 -0
- amon_hen-0.1.0/docs/ROADMAP.md +69 -0
- amon_hen-0.1.0/pyproject.toml +100 -0
- amon_hen-0.1.0/src/amonhen/__init__.py +3 -0
- amon_hen-0.1.0/src/amonhen/cli.py +305 -0
- amon_hen-0.1.0/src/amonhen/decode.py +150 -0
- amon_hen-0.1.0/src/amonhen/encode.py +180 -0
- amon_hen-0.1.0/src/amonhen/interactive.py +136 -0
- amon_hen-0.1.0/src/amonhen/model_registry.py +63 -0
- amon_hen-0.1.0/src/amonhen/pipeline.py +268 -0
- amon_hen-0.1.0/src/amonhen/player.py +63 -0
- amon_hen-0.1.0/src/amonhen/progress.py +128 -0
- amon_hen-0.1.0/src/amonhen/sample.py +123 -0
- amon_hen-0.1.0/src/amonhen/segment.py +89 -0
- amon_hen-0.1.0/src/amonhen/store.py +327 -0
- amon_hen-0.1.0/src/amonhen/theme.py +61 -0
- amon_hen-0.1.0/tests/conftest.py +73 -0
- amon_hen-0.1.0/tests/test_benchmark_dataset.py +31 -0
- amon_hen-0.1.0/tests/test_benchmark_metrics.py +70 -0
- amon_hen-0.1.0/tests/test_benchmark_runner.py +68 -0
- amon_hen-0.1.0/tests/test_cli.py +236 -0
- amon_hen-0.1.0/tests/test_decode.py +54 -0
- amon_hen-0.1.0/tests/test_encode.py +135 -0
- amon_hen-0.1.0/tests/test_export_onnx.py +97 -0
- amon_hen-0.1.0/tests/test_interactive.py +184 -0
- amon_hen-0.1.0/tests/test_model_registry.py +33 -0
- amon_hen-0.1.0/tests/test_package.py +6 -0
- amon_hen-0.1.0/tests/test_pipeline.py +377 -0
- amon_hen-0.1.0/tests/test_player.py +73 -0
- amon_hen-0.1.0/tests/test_progress.py +49 -0
- amon_hen-0.1.0/tests/test_publish_hf.py +75 -0
- amon_hen-0.1.0/tests/test_quantize_onnx.py +80 -0
- amon_hen-0.1.0/tests/test_sample.py +87 -0
- amon_hen-0.1.0/tests/test_segment.py +76 -0
- amon_hen-0.1.0/tests/test_store.py +201 -0
- amon_hen-0.1.0/tests/test_theme.py +64 -0
- amon_hen-0.1.0/tests/test_verify_parity.py +52 -0
- amon_hen-0.1.0/tools/__init__.py +1 -0
- amon_hen-0.1.0/tools/export_onnx.py +90 -0
- amon_hen-0.1.0/tools/prepare_charades_sta.py +356 -0
- amon_hen-0.1.0/tools/publish_to_hf.py +201 -0
- amon_hen-0.1.0/tools/quantize_onnx.py +24 -0
- amon_hen-0.1.0/tools/verify_parity.py +47 -0
- amon_hen-0.1.0/uv.lock +886 -0
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
name: Bug Report
|
|
2
|
+
description: Report an issue or unexpected behavior in Amon Hen
|
|
3
|
+
labels: ["bug"]
|
|
4
|
+
body:
|
|
5
|
+
- type: markdown
|
|
6
|
+
attributes:
|
|
7
|
+
value: |
|
|
8
|
+
Thanks for taking the time to fill out this bug report!
|
|
9
|
+
- type: input
|
|
10
|
+
id: version
|
|
11
|
+
attributes:
|
|
12
|
+
label: Amon Hen Version
|
|
13
|
+
description: What version of Amon Hen are you using? (e.g. `amon-hen --version` or git commit hash)
|
|
14
|
+
placeholder: e.g. 0.1.0
|
|
15
|
+
validations:
|
|
16
|
+
required: true
|
|
17
|
+
- type: dropdown
|
|
18
|
+
id: os
|
|
19
|
+
attributes:
|
|
20
|
+
label: Operating System
|
|
21
|
+
options:
|
|
22
|
+
- Linux (Ubuntu/Debian/Fedora/etc.)
|
|
23
|
+
- macOS (Apple Silicon - M1/M2/M3/M4)
|
|
24
|
+
- macOS (Intel)
|
|
25
|
+
- Windows 10 / 11
|
|
26
|
+
- Other
|
|
27
|
+
validations:
|
|
28
|
+
required: true
|
|
29
|
+
- type: input
|
|
30
|
+
id: python-version
|
|
31
|
+
attributes:
|
|
32
|
+
label: Python Version
|
|
33
|
+
placeholder: e.g. Python 3.12.2
|
|
34
|
+
validations:
|
|
35
|
+
required: true
|
|
36
|
+
- type: textarea
|
|
37
|
+
id: description
|
|
38
|
+
attributes:
|
|
39
|
+
label: Describe the Bug
|
|
40
|
+
description: A clear and concise description of what the bug is.
|
|
41
|
+
validations:
|
|
42
|
+
required: true
|
|
43
|
+
- type: textarea
|
|
44
|
+
id: reproduction
|
|
45
|
+
attributes:
|
|
46
|
+
label: Steps to Reproduce
|
|
47
|
+
description: Steps or CLI command to reproduce the behavior.
|
|
48
|
+
placeholder: |
|
|
49
|
+
1. Run `amon-hen index my_video.mp4`
|
|
50
|
+
2. Run `amon-hen search "a red car"`
|
|
51
|
+
3. See error
|
|
52
|
+
validations:
|
|
53
|
+
required: true
|
|
54
|
+
- type: textarea
|
|
55
|
+
id: expected
|
|
56
|
+
attributes:
|
|
57
|
+
label: Expected Behavior
|
|
58
|
+
description: A clear and concise description of what you expected to happen.
|
|
59
|
+
validations:
|
|
60
|
+
required: true
|
|
61
|
+
- type: textarea
|
|
62
|
+
id: logs
|
|
63
|
+
attributes:
|
|
64
|
+
label: Logs / Error Output
|
|
65
|
+
description: Paste any error traceback or terminal output here.
|
|
66
|
+
render: shell
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
name: Feature Request
|
|
2
|
+
description: Suggest an idea or enhancement for Amon Hen
|
|
3
|
+
labels: ["enhancement"]
|
|
4
|
+
body:
|
|
5
|
+
- type: markdown
|
|
6
|
+
attributes:
|
|
7
|
+
value: |
|
|
8
|
+
Have a feature idea? We would love to hear it!
|
|
9
|
+
- type: textarea
|
|
10
|
+
id: problem
|
|
11
|
+
attributes:
|
|
12
|
+
label: Is your feature request related to a problem? Please describe.
|
|
13
|
+
description: A clear and concise description of what the problem or limitation is.
|
|
14
|
+
validations:
|
|
15
|
+
required: true
|
|
16
|
+
- type: textarea
|
|
17
|
+
id: solution
|
|
18
|
+
attributes:
|
|
19
|
+
label: Describe the solution you would like
|
|
20
|
+
description: A clear and concise description of what you want to happen.
|
|
21
|
+
validations:
|
|
22
|
+
required: true
|
|
23
|
+
- type: textarea
|
|
24
|
+
id: alternatives
|
|
25
|
+
attributes:
|
|
26
|
+
label: Describe alternatives you have considered
|
|
27
|
+
description: Any alternative solutions or features you have considered.
|
|
28
|
+
- type: textarea
|
|
29
|
+
id: additional-context
|
|
30
|
+
attributes:
|
|
31
|
+
label: Additional Context
|
|
32
|
+
description: Add any other context, screenshots, or references here.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
## Description
|
|
2
|
+
|
|
3
|
+
Please provide a brief summary of the changes introduced in this PR and the motivation behind them.
|
|
4
|
+
|
|
5
|
+
Closes #(issue)
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Type of Change
|
|
10
|
+
|
|
11
|
+
- [ ] Bug fix (non-breaking change which fixes an issue)
|
|
12
|
+
- [ ] New feature (non-breaking change which adds functionality)
|
|
13
|
+
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
|
|
14
|
+
- [ ] Documentation update / Benchmark result
|
|
15
|
+
- [ ] Performance improvement
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Checklist
|
|
20
|
+
|
|
21
|
+
- [ ] My code follows the style guidelines of this project (`uv run ruff check .`)
|
|
22
|
+
- [ ] I have added tests that prove my fix is effective or that my feature works
|
|
23
|
+
- [ ] All new and existing tests passed (`uv run pytest`)
|
|
24
|
+
- [ ] I have updated the documentation accordingly
|
|
25
|
+
- [ ] My changes generate no new warnings or regressions
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
lint:
|
|
11
|
+
name: Lint & Format Check
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
steps:
|
|
14
|
+
- name: Checkout repository
|
|
15
|
+
uses: actions/checkout@v4
|
|
16
|
+
|
|
17
|
+
- name: Install uv
|
|
18
|
+
uses: astral-sh/setup-uv@v5
|
|
19
|
+
with:
|
|
20
|
+
enable-cache: true
|
|
21
|
+
|
|
22
|
+
- name: Set up Python
|
|
23
|
+
uses: actions/setup-python@v5
|
|
24
|
+
with:
|
|
25
|
+
python-version: "3.12"
|
|
26
|
+
|
|
27
|
+
- name: Install dependencies
|
|
28
|
+
run: uv sync --all-groups
|
|
29
|
+
|
|
30
|
+
- name: Run Ruff Linter
|
|
31
|
+
run: uv run ruff check .
|
|
32
|
+
|
|
33
|
+
- name: Check formatting
|
|
34
|
+
run: uv run ruff format --check .
|
|
35
|
+
|
|
36
|
+
test:
|
|
37
|
+
name: Test (${{ matrix.os }} - Py${{ matrix.python-version }})
|
|
38
|
+
runs-on: ${{ matrix.os }}
|
|
39
|
+
strategy:
|
|
40
|
+
fail-fast: false
|
|
41
|
+
matrix:
|
|
42
|
+
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
43
|
+
python-version: ["3.11", "3.12"]
|
|
44
|
+
|
|
45
|
+
steps:
|
|
46
|
+
- name: Checkout repository
|
|
47
|
+
uses: actions/checkout@v4
|
|
48
|
+
|
|
49
|
+
- name: Install uv
|
|
50
|
+
uses: astral-sh/setup-uv@v5
|
|
51
|
+
with:
|
|
52
|
+
enable-cache: true
|
|
53
|
+
|
|
54
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
55
|
+
uses: actions/setup-python@v5
|
|
56
|
+
with:
|
|
57
|
+
python-version: ${{ matrix.python-version }}
|
|
58
|
+
|
|
59
|
+
- name: Install dependencies
|
|
60
|
+
run: uv sync --all-groups
|
|
61
|
+
|
|
62
|
+
- name: Run Test Suite
|
|
63
|
+
run: uv run pytest -v
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
name: Release & Publish to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- "v*"
|
|
7
|
+
workflow_dispatch:
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
build-and-publish:
|
|
12
|
+
name: Build and Publish to PyPI
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
environment:
|
|
15
|
+
name: pypi
|
|
16
|
+
url: https://pypi.org/p/amon-hen
|
|
17
|
+
|
|
18
|
+
permissions:
|
|
19
|
+
id-token: write
|
|
20
|
+
steps:
|
|
21
|
+
- name: Checkout repository
|
|
22
|
+
uses: actions/checkout@v4
|
|
23
|
+
|
|
24
|
+
- name: Install uv
|
|
25
|
+
uses: astral-sh/setup-uv@v5
|
|
26
|
+
with:
|
|
27
|
+
enable-cache: true
|
|
28
|
+
|
|
29
|
+
- name: Set up Python
|
|
30
|
+
uses: actions/setup-python@v5
|
|
31
|
+
with:
|
|
32
|
+
python-version: "3.12"
|
|
33
|
+
|
|
34
|
+
- name: Build sdist and wheel
|
|
35
|
+
run: uv build
|
|
36
|
+
|
|
37
|
+
- name: Publish package to PyPI
|
|
38
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## [0.1.0] - 2026-08-28
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
* **CPU-Native Moment Retrieval:** Natural language video search running entirely on CPU using Apple's MobileCLIP2 architecture and ONNX Runtime.
|
|
14
|
+
* **Hybrid Quantization Model:** Default distribution using `vision_model.onnx` (FP32) and `text_model_quantized.onnx` (INT8) for a ~105 MB footprint with 18.5x realtime indexing throughput.
|
|
15
|
+
* **Vector Storage:** SQLite vector database powered by `sqlite-vec` for embedded, single-file storage with zero server dependencies.
|
|
16
|
+
* **Adaptive Frame Sampling:** Motion-aware frame decoding via `imageio-ffmpeg` with embedding-based deduplication (up to 7.8x speedup over fixed per-second sampling).
|
|
17
|
+
* **Temporal Segment Merging:** Consecutive frame grouping into coherent start-end timestamps with per-video baseline calibration.
|
|
18
|
+
* **Interactive Tolkien REPL:** Terminal UI with prompt history, banner styling, visual score bars, and slash commands (`/open`, `/help`, `/exit`).
|
|
19
|
+
* **External Media Player Launcher:** Instant playback at matched timestamps with automatic detection for `mpv`, `vlc`, and `ffplay`.
|
|
20
|
+
* **Benchmark Suite:** Charades-STA evaluation harness with mIoU, R@1, and R@5 metrics and synthetic dataset generation.
|
|
21
|
+
* **Model Distribution:** Automated ONNX export, INT8 dynamic quantizer, numerical parity verifier, and Hugging Face publisher for `flxhrdyn/mobileclip2-s0-onnx`.
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
|
2
|
+
|
|
3
|
+
## Our Pledge
|
|
4
|
+
|
|
5
|
+
We as members, contributors, and leaders pledge to make participation in our
|
|
6
|
+
community a harassment-free experience for everyone, regardless of age, body
|
|
7
|
+
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
|
8
|
+
identity and expression, level of experience, education, socio-economic status,
|
|
9
|
+
nationality, personal appearance, race, caste, color, religion, or sexual
|
|
10
|
+
identity and orientation.
|
|
11
|
+
|
|
12
|
+
We pledge to act and interact in ways that contribute to an open, welcoming,
|
|
13
|
+
diverse, inclusive, and healthy community.
|
|
14
|
+
|
|
15
|
+
## Our Standards
|
|
16
|
+
|
|
17
|
+
Examples of behavior that contributes to a positive environment for our
|
|
18
|
+
community include:
|
|
19
|
+
|
|
20
|
+
* Demonstrating empathy and kindness toward other people
|
|
21
|
+
* Being respectful of differing opinions, viewpoints, and experiences
|
|
22
|
+
* Giving and gracefully accepting constructive feedback
|
|
23
|
+
* Accepting responsibility and apologizing to those affected by our mistakes,
|
|
24
|
+
and learning from the experience
|
|
25
|
+
* Focusing on what is best not just for us as individuals, but for the
|
|
26
|
+
overall community
|
|
27
|
+
|
|
28
|
+
Examples of unacceptable behavior include:
|
|
29
|
+
|
|
30
|
+
* The use of sexualized language or imagery, and sexual attention or advances of
|
|
31
|
+
any kind
|
|
32
|
+
* Trolling, insulting or derogatory comments, and personal or political attacks
|
|
33
|
+
* Public or private harassment
|
|
34
|
+
* Publishing others' private information, such as a physical or email
|
|
35
|
+
address, without their explicit permission
|
|
36
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
|
37
|
+
professional setting
|
|
38
|
+
|
|
39
|
+
## Enforcement Responsibilities
|
|
40
|
+
|
|
41
|
+
Community leaders are responsible for clarifying and enforcing our standards of
|
|
42
|
+
acceptable behavior and will take appropriate and fair corrective action in
|
|
43
|
+
response to any behavior that they deem inappropriate, threatening, offensive,
|
|
44
|
+
or harmful.
|
|
45
|
+
|
|
46
|
+
Community leaders have the right and responsibility to remove, edit, or reject
|
|
47
|
+
comments, commits, code, wiki edits, issues, and other contributions that are
|
|
48
|
+
not aligned to this Code of Conduct, and will communicate reasons for moderation
|
|
49
|
+
decisions when appropriate.
|
|
50
|
+
|
|
51
|
+
## Scope
|
|
52
|
+
|
|
53
|
+
This Code of Conduct applies within all community spaces, and also applies when
|
|
54
|
+
an individual is officially representing the community in public spaces.
|
|
55
|
+
Examples of representing our community include using an official e-mail address,
|
|
56
|
+
posting via an official social media account, or acting as an appointed
|
|
57
|
+
representative at an online or offline event.
|
|
58
|
+
|
|
59
|
+
## Enforcement
|
|
60
|
+
|
|
61
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
|
62
|
+
reported to the community leaders responsible for enforcement at
|
|
63
|
+
[support@felixhrdyn.com](mailto:support@felixhrdyn.com).
|
|
64
|
+
All complaints will be reviewed and investigated promptly and fairly.
|
|
65
|
+
|
|
66
|
+
All community leaders are obligated to respect the privacy and security of the
|
|
67
|
+
reporter of any incident.
|
|
68
|
+
|
|
69
|
+
## Attribution
|
|
70
|
+
|
|
71
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
|
72
|
+
version 2.1, available at
|
|
73
|
+
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
|
|
74
|
+
|
|
75
|
+
[homepage]: https://www.contributor-covenant.org
|
|
76
|
+
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
# Contributing to Amon Hen
|
|
2
|
+
|
|
3
|
+
Thank you for your interest in contributing to **Amon Hen**! We welcome contributions of all kinds: bug reports, documentation improvements, benchmark evaluations, feature proposals, and code contributions.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Code of Conduct
|
|
8
|
+
|
|
9
|
+
All contributors and maintainers are expected to follow our [Code of Conduct](CODE_OF_CONDUCT.md). Please read it before participating.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Development Setup
|
|
14
|
+
|
|
15
|
+
Amon Hen uses [`uv`](https://github.com/astral-sh/uv) as the fast Python package and project manager.
|
|
16
|
+
|
|
17
|
+
### 1. Prerequisites
|
|
18
|
+
* Python >= 3.11
|
|
19
|
+
* `uv` installed ([installation guide](https://docs.astral.sh/uv/getting-started/installation/))
|
|
20
|
+
* Git
|
|
21
|
+
|
|
22
|
+
### 2. Clone and Setup
|
|
23
|
+
```bash
|
|
24
|
+
git clone https://github.com/flxhrdyn/amon-hen.git
|
|
25
|
+
cd amon-hen
|
|
26
|
+
|
|
27
|
+
# Install dependencies into virtualenv
|
|
28
|
+
uv sync --all-groups
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### 3. Run the Test Suite
|
|
32
|
+
```bash
|
|
33
|
+
# Run unit and integration tests
|
|
34
|
+
uv run pytest
|
|
35
|
+
|
|
36
|
+
# Run tests with verbose output
|
|
37
|
+
uv run pytest -v
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### 4. Code Quality & Linting
|
|
41
|
+
We use [`ruff`](https://github.com/astral-sh/ruff) for linting and formatting.
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
# Check code style and linting rules
|
|
45
|
+
uv run ruff check .
|
|
46
|
+
|
|
47
|
+
# Auto-fix lint errors where possible
|
|
48
|
+
uv run ruff check . --fix
|
|
49
|
+
|
|
50
|
+
# Format code
|
|
51
|
+
uv run ruff format .
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## Project Architecture & Structure
|
|
57
|
+
|
|
58
|
+
```
|
|
59
|
+
amon-hen/
|
|
60
|
+
├── src/amonhen/
|
|
61
|
+
│ ├── cli.py # Typer CLI application & interactive entry point
|
|
62
|
+
│ ├── decode.py # Video decoding via imageio-ffmpeg
|
|
63
|
+
│ ├── encode.py # Vision & text ONNX embedding pipelines
|
|
64
|
+
│ ├── interactive.py # Tolkien-themed REPL interactive session
|
|
65
|
+
│ ├── model_registry.py # Hugging Face model registry & downloader
|
|
66
|
+
│ ├── pipeline.py # Indexing & search pipeline orchestration
|
|
67
|
+
│ ├── player.py # System media player launcher with timestamp seeking
|
|
68
|
+
│ ├── progress.py # Dual-level Rich progress reporters
|
|
69
|
+
│ ├── sample.py # Adaptive motion-based frame sampling & dedup
|
|
70
|
+
│ ├── segment.py # Temporal segment merging & thresholding
|
|
71
|
+
│ ├── store.py # SQLite vector store powered by sqlite-vec
|
|
72
|
+
│ └── theme.py # Tolkien styling, banners, score bars, & verbs
|
|
73
|
+
├── tests/ # Comprehensive unit & integration tests
|
|
74
|
+
├── benchmarks/ # Evaluation benchmarks (Charades-STA metrics & runner)
|
|
75
|
+
├── demo/ # Canonical demo assets & GIF generator
|
|
76
|
+
└── tools/ # ONNX export, INT8 quantization, & HF publishing tools
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## Development Guidelines
|
|
82
|
+
|
|
83
|
+
1. **Test-Driven Development (TDD):**
|
|
84
|
+
- Write tests for any new features or bug fixes in `tests/`.
|
|
85
|
+
- Ensure 100% of tests pass before submitting a PR.
|
|
86
|
+
2. **CPU-First & Low Memory:**
|
|
87
|
+
- Amon Hen is strictly designed to run on CPU without requiring discrete GPUs.
|
|
88
|
+
- Keep memory usage low and avoid loading unnecessary heavy dependencies into runtime.
|
|
89
|
+
3. **Typing & Linting:**
|
|
90
|
+
- Use Python 3.11+ type annotations (`int | str`, `list[Segment]`, etc.).
|
|
91
|
+
- Pass all `ruff check .` rules without warnings.
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
## Submitting a Pull Request
|
|
96
|
+
|
|
97
|
+
1. **Fork** the repository and create your branch from `main`:
|
|
98
|
+
```bash
|
|
99
|
+
git checkout -b feat/your-feature-name
|
|
100
|
+
```
|
|
101
|
+
2. **Make your changes** with clear, atomic commits.
|
|
102
|
+
3. **Verify tests and linter pass:**
|
|
103
|
+
```bash
|
|
104
|
+
uv run pytest
|
|
105
|
+
uv run ruff check .
|
|
106
|
+
```
|
|
107
|
+
4. **Push** to your fork and submit a Pull Request against `main`.
|
|
108
|
+
5. Describe your changes clearly in the PR template, referencing any related issues.
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
## Reporting Issues
|
|
113
|
+
|
|
114
|
+
If you find a bug or have a feature request:
|
|
115
|
+
- Search existing [Issues](https://github.com/flxhrdyn/amon-hen/issues) to avoid duplicates.
|
|
116
|
+
- Open an issue using our structured bug report or feature request template.
|
|
117
|
+
- Provide minimal reproduction steps, OS version, and video codec details if reporting a video indexing issue.
|
amon_hen-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Felix Hardyan and Amon Hen Contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|