Files
guitar_score/.planning/codebase/CONVENTIONS.md

12 lines
1009 B
Markdown

# CONVENTIONS
## Python & Scripting
- **Naming**: Pythonic `snake_case` for functions/variables. Internal/private helper functions are prefixed with `_` (e.g., `_dhash`, `_dedup_by_hash`).
- **Typing**: Extensive use of Python 3 type hinting (`List`, `Tuple`, `Optional`, `np.ndarray` for image matrices) to ensure correct data tracking through the pipeline.
- **Logging**: Script execution uses rich, numbered `print()` statements (e.g., `[1/5] ...`, ` → ...`) to give users immediate feedback on pipeline state given that processing can take minutes.
- **Windows Safety**: Manual stdout/stderr `sys.stdout.reconfigure(encoding="utf-8")` is used to prevent Unicode block crashes on Windows cmd.exe.
## Computer Vision Processing
- Memory optimization is heavily enforced (downscaling initial captures to `MAX_FRAME_WIDTH` of 1280px immediately upon read).
- Mathematical thresholds (MSE margins, TM_CCOEFF_NORMED thresholds) are hardcoded as upper-case CONSTANTS at the top of scripts for quick tuning.