Update README.md

This commit is contained in:
2026-06-10 15:50:16 -04:00
committed by GitHub
parent a38122a5fe
commit f35d63b957
+18 -70
View File
@@ -1,85 +1,33 @@
# if-curator-headless # if-curator-headless
Headless fork of [if-curator](https://github.com/ds-sebastian/if_curator) with automatic Frigate face training upload and Docker support. fork of [if-curator](https://github.com/ds-sebastian/if_curator) with automatic Frigate face training upload and Docker support.
## What Changed ## What This Adds
Only `cli.py` was modified. Three functions were added, one was changed. All other modules (`config.py`, `immich_api.py`, `embeddings.py`, `diversity.py`, `image_processing.py`, `quality.py`, `cache.py`, `logging.py`) are identical to upstream. - **Headless mode** — runs without interactive prompts, suitable for Docker and cron
- **Auto-discover people** — processes all named people from Immich automatically instead of picking one at a time
- **Frigate upload** — sends curated face crops directly to Frigate's face training API after processing
- **People filtering** — skip specific people, whitelist only certain people, or set a minimum photo count
- **Docker** — Dockerfile and compose config with NVIDIA GPU support, ready for TrueNAS
### New functions in `cli.py` All of if-curator's original functionality (smart diversity, quality filtering, face alignment, blur rejection, etc.) is unchanged.
**`auto_configure(people)`** — Non-interactive replacement for `interactive_configure()`. Fetches all named people from Immich, filters by env vars, and iterates through each without prompts.
**`_resolve_strategy(strategy, has_embedding)`** — Non-interactive replacement for `_get_strategy_choice()`. Maps `STRATEGY` env var to `(limit, selection_mode)` without prompting.
**`upload_to_frigate(jobs)`** — POSTs face crops to Frigate's `/api/faces/train/{name}/classify` API. Skipped if `FRIGATE_URL` is not set.
### Modified function: `main()`
- Added `AUTO_MODE` env var check to branch between `auto_configure()` and `interactive_configure()`
- Confirmation prompt skipped when `AUTO_MODE=true`
- `upload_to_frigate(jobs)` called after `execute_jobs()`
## New Environment Variables ## New Environment Variables
| Variable | Default | Description | | Variable | Default | What it does |
| :--- | :--- | :--- | | :--- | :--- | :--- |
| `AUTO_MODE` | `false` | Enable headless mode | | `AUTO_MODE` | `false` | Run without prompts |
| `FRIGATE_URL` | *(empty)* | Frigate URL for auto-upload (skipped if empty) | | `FRIGATE_URL` | *(empty)* | Frigate server URL — auto-uploads faces when set |
| `TRAINING_MODE` | `face` | `face` or `object` | | `TRAINING_MODE` | `face` | `face` or `object` |
| `STRATEGY` | `auto` | `auto`, `standard`, or `broad` | | `STRATEGY` | `auto` | `auto`, `standard`, or `broad` |
| `SKIP_PEOPLE` | *(empty)* | Comma-separated people to skip | | `SKIP_PEOPLE` | *(empty)* | People to skip |
| `ONLY_PEOPLE` | *(empty)* | Comma-separated people to process (whitelist) | | `ONLY_PEOPLE` | *(empty)* | People to process (whitelist) |
| `MIN_FACE_COUNT` | `3` | Skip people with fewer assets | | `MIN_FACE_COUNT` | `3` | Minimum photos required to process a person |
| `OBJECT_CLASS` | `dog` | Object class (only with `TRAINING_MODE=object`) | | `OBJECT_CLASS` | `dog` | Object type (only for object mode) |
All original if-curator variables (`IMMICH_URL`, `API_KEY`, `FORCE_CPU`, `OUTPUT_DIR`, etc.) still work. See the [upstream README](https://github.com/ds-sebastian/if_curator) for those. All original if-curator variables (`IMMICH_URL`, `API_KEY`, `FORCE_CPU`, etc.) still work.
## Docker ## Docker
Upstream has no Dockerfile. This fork adds Docker support with NVIDIA GPU acceleration and TrueNAS-compatible user mapping. ghcr.io/sudolulo/if-curator-headless:latest
### Dockerfile
```dockerfile
FROM nvidia/cuda:12.4.1-runtime-ubuntu22.04
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
software-properties-common \
&& add-apt-repository ppa:deadsnakes/ppa -y \
&& apt-get update && apt-get install -y --no-install-recommends \
python3.12 \
python3.12-venv \
python3.12-dev \
libgl1 \
libglib2.0-0 \
libxext6 \
git \
curl \
g++ \
&& rm -rf /var/lib/apt/lists/* \
&& ln -sf /usr/bin/python3.12 /usr/bin/python \
&& ln -sf /usr/bin/python3.12 /usr/bin/python3
RUN curl -LsSf https://astral.sh/uv/install.sh | sh
ENV PATH="/root/.local/bin:${PATH}"
WORKDIR /app
RUN git clone --depth 1 https://github.com/sudolulo/if_curator_headless.git . \
&& uv sync --extra gpu \
&& uv cache clean
RUN groupadd -g 568 apps \
&& useradd -u 568 -g apps -m -s /bin/bash appuser \
&& chown -R appuser:apps /app
USER appuser
ENV FORCE_CPU=false \
HF_HOME=/models/huggingface \
INSIGHTFACE_HOME=/models/insightface
ENTRYPOINT ["uv", "run", "if-curator"]