Files
PaperPod/config.yaml
T
ilia 12e5d1aeb1 Add page-marker grouping and party-aware naming
Consecutive captures whose printed PAGE X OF Y markers advance under the same total are grouped into one multi-page PDF, with duplicate pages keeping the better read. Naming gains doc-title/party components and a scan-date fallback so nothing lands in UNSORTED. Vision LLM default switches to minicpm-v (faster, fewer false blanks on dense mono pages).
2026-07-26 15:37:28 -04:00

86 lines
3.4 KiB
YAML

# PaperPod tunable thresholds. All values here override the built-in defaults
# in paperpod/config.py; delete a key to fall back to the default.
capture:
# Frames per second to sample from the source video for analysis.
sample_fps: 8
# Frames are downscaled to this width for motion analysis (full resolution
# is still used for the final document crops).
processing_width: 960
audio:
# WAV sample rate for the extracted audio track (16 kHz mono = whisper-ready).
sample_rate: 16000
motion:
# Gaussian blur kernel applied before frame differencing (odd number).
blur_ksize: 21
# A pixel counts as "changed" if its gray level moved by more than this (0-255).
pixel_threshold: 12
# Fraction of changed pixels (0.0-1.0) above which a frame counts as "moving".
# Raise if sensor noise triggers false motion; lower if small gestures
# (page flips) are being missed.
threshold: 0.02
# A stable stretch must last at least this long (seconds) to count as a window.
stable_min_duration_s: 1.0
document:
# Contours smaller than this fraction of the frame area are ignored.
min_area_ratio: 0.04
# Contours larger than this fraction of the frame are rejected as likely
# background/lighting rather than a document.
max_area_ratio: 0.92
# Reject candidates whose long side is more than this many times their
# short side (filters out thin slivers/edge-strip false detections).
max_aspect: 6.0
# Canny edge detection thresholds.
canny_low: 50
canny_high: 150
# Contour search runs on a frame downscaled to this width (then the
# winning quad is scaled back up for the full-resolution crop). Keeps
# edge/gap-closing behavior consistent regardless of source resolution —
# important for 4K phone video.
detect_width: 1000
# Bake illumination-normalization + contrast enhancement into the saved
# crop/PDF (grayscale "flattened scan" look). OCR always uses this
# enhancement internally regardless of this setting.
enhance: false
# Auto-detect and correct 0/90/180/270 rotation before OCR/PDF export.
auto_rotate: true
# Expand the detected quad outward by this fraction before warping, to
# recover paper margins clipped by curl/wrinkles (straight-line quad vs.
# a slightly bowed real edge). refine.tighten below trims any extra
# mat/background this pulls in back off.
pad_margin: 0.04
# Tighten crops to the actual paper region (cuts mat margins/hands) and
# inpaint fingers pressing on the page.
refine: true
remove_fingers: true
# Split separate document placements when no contour is seen for this long.
event_gap_s: 2.0
# Ignore single-frame detection blips.
event_min_samples: 2
llm:
# Identify/name documents with a local Ollama vision model (all offline).
# Reads whole documents at once — far more robust than Tesseract for
# curled receipts and stylized logos — and flags quality issues
# (fingers_visible, blurry, glare) in export_summary.csv.
# minicpm-v: ~8-12s/doc; avoids qwen2.5vl's false "blank" on dense
# bank statements. OCR still fills date/total when the model hallucinates.
# Falls back to Tesseract when Ollama is down.
enabled: true
model: minicpm-v
base_url: http://localhost:11434
timeout_s: 180
speech:
# Window around a capture event in which to look for a spoken description.
window_before_s: 3.0
window_after_s: 5.0
output:
dir: ./output
# Paperless-ngx consume directory (module 7, not wired up yet).
consume_dir: null