Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
84ebc60
Implement python
ildyria Mar 21, 2026
ca15243
Fix tasks
ildyria Mar 21, 2026
9cd10d6
Fix astral install
ildyria Mar 21, 2026
a1475df
more fixes
ildyria Mar 21, 2026
cc8c44e
Fix dockerfile
ildyria Mar 21, 2026
d8a029f
Accept CVE
ildyria Mar 21, 2026
8d06e94
pin
ildyria Mar 21, 2026
6783ecc
fix workflow
ildyria Mar 21, 2026
6600c37
fix workflow
ildyria Mar 21, 2026
d063671
Add backend
ildyria Mar 21, 2026
a7de26f
tasks
ildyria Mar 21, 2026
43a1c11
Frontend wip
ildyria Mar 22, 2026
18baed6
WIP
ildyria Mar 22, 2026
cafc250
more fixes
ildyria Mar 22, 2026
aa31217
fix table
ildyria Mar 22, 2026
dff7252
improve
ildyria Mar 22, 2026
993b870
Update
ildyria Mar 22, 2026
2cffac2
Merge branch 'assisted-vision-backend' into assisted-vision-frontend
ildyria Mar 22, 2026
4bce868
Delete stupid cache files
ildyria Mar 22, 2026
4c84722
Merge branch 'assisted-vision' into assisted-vision-backend
ildyria Mar 22, 2026
2f9ebce
Merge branch 'assisted-vision-backend' into assisted-vision-frontend
ildyria Mar 22, 2026
5cd1bcc
Pull more changes from front-end branch
ildyria Mar 22, 2026
8e23309
oversight
ildyria Mar 22, 2026
e977649
Merge branch 'assisted-vision' into assisted-vision-backend
ildyria Mar 22, 2026
f73ba62
Merge branch 'assisted-vision-backend' into assisted-vision-frontend
ildyria Mar 22, 2026
5e48dbb
fix linting
ildyria Mar 22, 2026
00b17a2
fix tests
ildyria Mar 22, 2026
2ef56ad
Merge branch 'assisted-vision' into assisted-vision-backend
ildyria Mar 22, 2026
cc41257
Merge branch 'assisted-vision-backend' into assisted-vision-frontend
ildyria Mar 22, 2026
aea97c1
Fix linting
ildyria Mar 22, 2026
adbe694
Merge branch 'master' into assisted-vision
ildyria Mar 22, 2026
94653ca
Merge branch 'assisted-vision' into assisted-vision-backend
ildyria Mar 22, 2026
7c801bc
Merge branch 'assisted-vision-backend' into assisted-vision-frontend
ildyria Mar 22, 2026
c4bf2b0
WIP
ildyria Mar 23, 2026
d4abe21
more spec
ildyria Mar 23, 2026
cf2d3fb
WIP
ildyria Mar 24, 2026
29f7a3b
Moving parts around
ildyria Mar 24, 2026
ec2b38f
logging
ildyria Mar 24, 2026
50334b5
WIP
ildyria Mar 24, 2026
d76b326
Merge branch 'master' into assisted-vision-frontend
ildyria Mar 25, 2026
8ee1c3a
Revert "chore(deps): bump the production-dependencies group across 1 …
ildyria Mar 26, 2026
6855d7d
WIP
ildyria Mar 26, 2026
22b9245
fixes
ildyria Mar 26, 2026
8730848
tests
ildyria Mar 28, 2026
fac84cc
Merge branch 'master' into assisted-vision-frontend
ildyria Mar 30, 2026
851a1d4
fixes?
ildyria Mar 30, 2026
8ad035a
Merge branch 'master' into assisted-vision-frontend
ildyria Mar 31, 2026
add3b3a
Merge branch 'master' into assisted-vision-frontend
ildyria Apr 2, 2026
5a71825
uv lock update
ildyria Apr 2, 2026
5b2e7bf
more code...
ildyria Apr 2, 2026
7068eaf
Allow to disable ssl verification
ildyria Apr 2, 2026
f9afdd7
Add check in python side
ildyria Apr 2, 2026
6ea9247
progress
ildyria Apr 3, 2026
0970547
feat(030): face UX extensions — dismiss, batch ops, merge, overlay co…
Copilot Apr 5, 2026
77b790a
Merge branch 'master' into assisted-vision-frontend
ildyria Apr 6, 2026
f6e0fbd
currently heavily broken
ildyria Apr 6, 2026
b13b7d0
still broken
ildyria Apr 6, 2026
4b5d2fb
Merge branch 'master' into assisted-vision-frontend
ildyria Apr 6, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ vite/*
secrets/*
# Local testing @ildyria
public/uploads-bck/*
public/uploads/*
*.sql

# Node
node_modules/
Expand All @@ -56,8 +58,12 @@ npm-debug.log
# Mapping for database and config used by docker compose
lychee/*

# Python
ai-vision-service/*

# Laravel
/storage/logs/*
/storage/tmp/*
/storage/framework/cache/*
/storage/framework/sessions/*
/storage/framework/views/*
Expand Down
3 changes: 0 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ updates:
dependency-type: "production"
development-dependencies:
dependency-type: "development"
ignore:
- dependency-name: "typescript"
versions: [ ">=6.0.0" ]

- package-ecosystem: composer
directory: /
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/CICD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@ on:
- '**/*.md'
- 'public/dist/*.js'
- 'public/dist/**/*.js'
- 'ai-vision-service/**'
pull_request:
paths-ignore:
- '**/*.md'
- 'public/dist/*.js'
- 'public/dist/**/*.js'
- 'ai-vision-service/**'
# Allow manually triggering the workflow.
workflow_dispatch:

Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,8 @@ jobs:
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: 'Dependency Review'
uses: actions/dependency-review-action@2031cfc080254a8a887f58cffee85186f0e49e48 # v4.9.0
with:
# No fix available yet
# Note that the model is directly baked into the inage
# So the risk is limited.
allow-ghsas: GHSA-hqmj-h5c6-369m
154 changes: 154 additions & 0 deletions .github/workflows/python_ai_vision_face_recognition.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
name: Python AI Vision Service for face recognition

on:
push:
branches:
- master
- assisted-vision
paths:
- 'ai-vision-service/face-recognition/**'
pull_request:
paths:
- 'ai-vision-service/face-recognition/**'
workflow_dispatch:

# Declare default permissions as read only.
permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ !contains(github.ref, 'master') && !startsWith(github.ref, 'refs/tags/') }}

defaults:
run:
working-directory: ai-vision-service/face-recognition

jobs:
# ---------------------------------------------------------------------------
# Lint – formatting and style
# ---------------------------------------------------------------------------
lint:
name: Lint (ruff)
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
with:
egress-policy: audit

- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Set up uv
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0
with:
enable-cache: true

- name: Install dev dependencies
run: uv sync --frozen

- name: Check formatting
run: uv run ruff format --check app/ tests/

- name: Lint
run: uv run ruff check app/ tests/

# ---------------------------------------------------------------------------
# Type check
# ---------------------------------------------------------------------------
typecheck:
name: Type check (ty)
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
with:
egress-policy: audit

- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Set up uv
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0
with:
enable-cache: true

- name: Install dev dependencies
run: uv sync --frozen

- name: Type check
run: uv run ty check app/

# ---------------------------------------------------------------------------
# Test matrix – Python 3.13 and 3.14
# ---------------------------------------------------------------------------
test:
name: Tests (Python ${{ matrix.python-version }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version:
- "3.13"
- "3.14"

steps:
- name: Harden Runner
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
with:
egress-policy: audit

- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Set up uv
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0
with:
enable-cache: true
python-version: ${{ matrix.python-version }}

- name: Install dev dependencies
run: uv sync --frozen

- name: Run tests
run: uv run pytest --cov=app --cov-report=xml -v

- name: Upload coverage
if: matrix.python-version == '3.13'
uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2
with:
files: ai-vision-service/face-recognition/coverage.xml
flags: ai-vision-service/face-recognition
continue-on-error: true

# ---------------------------------------------------------------------------
# Docker build verification
# ---------------------------------------------------------------------------
docker-build:
name: Docker build
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
with:
egress-policy: audit

- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd #v4.0.0

- name: Build Docker image (no model bake in CI to save time)
uses: docker/build-push-action@d08e5c354a6adb9ed34480a06d141179aa583294 # v7.0.0
with:
context: ai-vision-service/face-recognition
push: false
load: true
tags: lychee-ai-vision:ci
# Override the model-bake step by targeting the builder stage
# to avoid downloading 300MB of model weights in CI.
target: builder
cache-from: type=gha
cache-to: type=gha,mode=max
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ clover.xml
.NO_AUTO_COMPOSER_MIGRATE
storage/bootstrap/cache/*
storage/image-jobs/*
**/__pycache__/**
.coverage

# used by Vite
public/hot
Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,9 @@ class-leak:
docker-build:
docker build -t lychee-frankenphp .

docker-build-legacy:
docker build -t lychee-frankenphp -f Dockerfile-legacy .

docker-build-no-cache:
docker build -t lychee-frankenphp . --no-cache

Expand Down
2 changes: 2 additions & 0 deletions ai-vision-service/face-recognition/.insightface/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*
!.gitignore
54 changes: 54 additions & 0 deletions ai-vision-service/face-recognition/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Multi-stage build: keep the runtime image lean.

# ---------------------------------------------------------------------------
# Stage 1 – builder: install dependencies and bake the model weights.
# ---------------------------------------------------------------------------
FROM python:3.13-slim@sha256:739e7213785e88c0f702dcdc12c0973afcbd606dbf021a589cab77d6b00b579d AS builder

# Install uv from the official image.
COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv

# Build tools required to compile insightface's Cython extension (mesh_core_cython).
RUN apt-get update && apt-get install -y --no-install-recommends \
g++ \
libgl1 \
libglib2.0-0 \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /app

# Install dependencies only (no source code) so layer cache is reused when
# only application code changes.
COPY pyproject.toml uv.lock README.md ./
RUN uv sync --frozen --no-dev

# Bake buffalo_l model weights into the image at build time (~300 MB download).
# The resulting image is ~1 GB larger but starts instantly and works in
# airgapped environments. Model updates require an image rebuild.
RUN uv run python -c \
"from insightface.app import FaceAnalysis; \
a = FaceAnalysis(name='buffalo_l', root='/root/.insightface', providers=['CPUExecutionProvider']); \
a.prepare(ctx_id=-1); \
print('buffalo_l model downloaded.')"

# ---------------------------------------------------------------------------
# Stage 2 – runtime: copy only what's needed to run.
# ---------------------------------------------------------------------------
FROM python:3.13-slim@sha256:739e7213785e88c0f702dcdc12c0973afcbd606dbf021a589cab77d6b00b579d AS runtime

WORKDIR /app

# Copy the pre-built virtualenv and baked model weights from the builder stage.
COPY --from=builder /app/.venv /app/.venv
COPY --from=builder /root/.insightface /root/.insightface

# Copy application source.
COPY app/ ./app/

ENV PATH="/app/.venv/bin:$PATH"

EXPOSE 8000

# Use a shell-form CMD so that the ${VISION_FACE_WORKERS:-1} variable is
# expanded at container startup, not at image build time.
CMD ["sh", "-c", "uvicorn app.main:app --host 0.0.0.0 --port 8000 --workers ${VISION_FACE_WORKERS:-1}"]
Loading
Loading