From e7ab03435695c066f71b2b1183b74f0867e8f6c3 Mon Sep 17 00:00:00 2001 From: sudolulo Date: Thu, 11 Jun 2026 01:26:16 -0400 Subject: [PATCH] Update cli.py --- if_curator/cli.py | 25 +++---------------------- 1 file changed, 3 insertions(+), 22 deletions(-) diff --git a/if_curator/cli.py b/if_curator/cli.py index 3f842e0..6bb38ca 100644 --- a/if_curator/cli.py +++ b/if_curator/cli.py @@ -423,36 +423,17 @@ def _show_preview(jobs: list[dict]) -> None: def _enrich_asset_with_face_data(asset: dict, person: dict) -> dict: - """Enrich an asset dict with face data from the Immich faces API. - - The search/metadata endpoint does not include face bounding box data, - so we fetch it from GET /api/faces?id={asset_id} and inject it into - the asset's "people" field so process_face_mode can find it. - - Returns the enriched asset dict (modifies in place and returns it). - """ person_id = person["id"] face_data = fetch_face_data(asset["id"], person_id=person_id) if face_data is None: - logger.debug( - f"Face data API returned nothing for {person.get('name')} " - f"in asset {asset.get('id')} — Immich may not have detected a face" - ) + logger.debug(f"No face data returned for {person.get('name')} in asset {asset.get('id')}") return asset - # Skip zero-area bounding boxes (face detection failed or no face found) if face_data.bbox == (0, 0, 0, 0): - logger.debug( - f"Zero-area bounding box for {person.get('name')} in asset {asset.get('id')}" - ) + logger.debug(f"Zero-area bounding box for {person.get('name')} in asset {asset.get('id')}") return asset - logger.debug( - f"Got face data for {person.get('name')} in asset {asset.get('id')}: " - f"bbox={face_data.bbox}, img_size={face_data.image_width}x{face_data.image_height}" - ) - face_info = { "boundingBoxX1": face_data.bbox[0], "boundingBoxY1": face_data.bbox[1], @@ -462,11 +443,11 @@ def _enrich_asset_with_face_data(asset: dict, person: dict) -> dict: "imageHeight": face_data.image_height, } - # Inject into asset so process_face_mode can find it via asset["people"] asset["people"] = [{"id": person_id, "faces": [face_info]}] return asset + def execute_jobs(jobs: list[dict]) -> None: """Download and process images for all jobs.""" if not jobs: