fix+logging: model load logging, CPU fallback, log level audit

Bugs fixed (from high-effort review):
- InsightFace CPU fallback now passes providers=['CPUExecutionProvider'] and
  wraps in _suppress_output() so broken GPU drivers don't cause fallback to
  try the same broken provider again, and C-extension noise stays suppressed
- scheduler.py: BaseException → Exception (KeyboardInterrupt already re-raised;
  winnow has no sys.exit() calls, so SystemExit would not occur, but Exception
  is the correct scope)
- compose.yml: fix inverted AUTO_MODE comment (docker run -it enables
  interactive mode via TTY, not non-interactive)

Model loading logging (embeddings.py):
- InsightFace: disk cache check, "not cached — downloading now (~300 MB)",
  "loading into memory on GPU/CPU...", "ready on GPU/CPU (Xs)"
- SigLIP: same treatment; cache path derived dynamically from model_name
  via HuggingFace slug convention (models--org--model) so it stays correct
  if the model variant ever changes

Logging level audit (INFO/DEBUG/WARNING/ERROR):
- diversity.py: internal algo steps (clustering, medoids, adaptive threshold,
  auto-stop decision) → DEBUG; final selection summaries stay INFO
- immich_api.py: "Fetching assets" and "Retained N assets" → DEBUG (callers
  already print this to the console via rprint)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-12 15:23:44 +00:00
co-authored by Claude Sonnet 4.6
parent af8bae1c45
commit 3db52c2141
5 changed files with 51 additions and 21 deletions
+2 -2
View File
@@ -49,7 +49,7 @@ def fetch_all_assets(person: dict) -> list[dict]:
url = f"{Config.IMMICH_URL}/api/search/metadata"
page_size = 1000
logger.info(f"Fetching assets for {name}...")
logger.debug(f"Fetching assets for {name}...")
assets = []
for page in range(1, MAX_PAGES + 1):
@@ -212,6 +212,6 @@ def filter_recent_assets(assets: list[dict], years: int | None = None) -> list[d
except ValueError:
continue
logger.info(f"Retained {len(recent)} assets (filtered {skipped} old assets).")
logger.debug(f"Retained {len(recent)} assets (filtered {skipped} old assets).")
return recent