docs: add AGENTS.md for repository onboarding

This commit is contained in:
jetson committed 2026-11-04 12:20:31 +07:00
1 parent ad702faccc
commit 2259cdb275
1 file changed
+28
+28
View File
@@ -0,0 +1,28 @@
# AGENTS.md
Feedmill Recounter: AI video analysis for counting sacks/boxes in feedmill videos. Flask web UI + CLI, file-backed (no DB).
## Commands
- Install: `pip install -e ".[dev]"`
- Tests: `pytest` (config in `pyproject.toml`: testpaths = `tests`)
- Single test: `pytest tests/test_app.py::test_name` or `pytest -k name`
- CLI: `recounter --video input.mp4 --model v4-best.pt --filter sack --output-dir ./output`
- Web UI: `recounter-web` (default port 9050; `WEB_PORT` overrides)
- List models: `recounter --list-models --models-dir ./models`
## Architecture
- `app.py`: Flask routes, job queue, model upload/conversion endpoints.
- `src/pipeline.py`: `run_pipeline` / `run_merged_pipeline`; analysis space is fixed 1280x720.
- `src/job.py`: in-memory `JobQueue`; jobs die on restart, output dirs survive.
- `src/model_registry.py`: scans `models/` by stem; formats `.engine` > `.pt` > `.onnx`.
- `src/model_conversion.py`: background `.pt` -> `.onnx` -> `.engine` conversion; only one at a time and blocks analysis.
- Config: `config.yaml` (tunables), `zones.json` (fixed zones), `.env` (paths/secrets).
## Quirks
- Model weights and `.engine` files are gitignored; local models required for real runs.
- `numpy<2.0` pinned for Jetson torch.
- Tests auto-isolate `job_queue` output dir via `tests/conftest.py`; do not point tests at real `output/`.
- Web process currently `python app.py`; restart it after code changes.
- `README.md` says port 9000 in `.env.example`, but code defaults to 9050.
- Conversion to `.engine` must start from `.pt`; Ultralytics cannot export from ONNX.
- `.engine` conversion may take minutes on Jetson.