8000 feat(faces): find and describe faces with anytopdf by adeelahmad · Pull Request #227 · adeelahmad/lense · GitHub
[go: up one dir, main page]

Skip to content

feat(faces): find and describe faces with anytopdf - #227

Merged
adeelahmad merged 7 commits into
mainfrom
claude/project-thread-l382kt
Oct 7, 2026
Merged

adeelahmad merged 7 commits into
mainfrom
claude/project-thread-l382kt

Conversation

@adeelahmad
@adeelahmad adeelahmad commented Oct 7, 2026 •
Copy link
Copy Markdown
Owner

Requested by Adeel · project thread

Builds on #221 (base adapter, merged).

Description

Before: faces needed OpenCV (YuNet + SFace) or InsightFace.

After: Settings › Video › Face engine › anytopdf. anytopdf's faces plugin finds the faces (built-in YuNet) and its face-id plugin describes them with the same SFace file Lens fetches, so a server needs no OpenCV or Python packages. Its descriptions match OpenCV's for the same face (0.88 and 0.99 cosine on the OpenCV sample photos, 0.15 between different people), so switching engines keeps the people a namespace already knows.

How: anytopdf.faces() runs one sandboxed, offline convert over up to 50 frames or pages with --recognize-faces and a throwaway face index; Lens reads each face's box and score from the graph and its embedding from that run's faces.sqlite sightings at the same box, since the graph never carries one. analyze() and faces() share one runner. Identity stays in Lens (faces.py). The components fetch anytopdf and only the SFace file for this engine.

Motivation and Context

anytopdf integration plan, phase 2: Lens reading anytopdf 0.4.0's faces.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change; ! in the title)

Checklist:

  • The title is a Conventional Commit.
  • My code follows the code style of this project (make hooks checks it on commit).
  • I added or updated tests.
  • My change requires documentation updates, and I have updated docs/ accordingly.
  • Users need more than the title to understand it, so I wrote it under ## Unreleased in CHANGELOG.md.

Checked against the real anytopdf 0.4.0 release on Linux x86-64 (lena.jpg, messi5.jpg); backend suite 693 passed locally.

🤖 Generated with Claude Code

https://claude.ai/code/session_01TbMhC5vN23npJjEVxfEApC

Settings › Video › Face engine › anytopdf: its faces plugin finds the
faces (built-in YuNet) and its face-id plugin describes them with the
SFace file Lens fetches, so a server needs no OpenCV, and faces match
ones OpenCV found (0.88-0.99 on the same face). The faces step sends up
to 50 frames or pages per run. anytopdf's face index lives only for the
run: Lens reads each face's description from it, and who someone is
stays in Lens.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TbMhC5vN23npJjEVxfEApC
@adeelahmad
adeelahmad force-pushed the claude/project-thread-l382kt branch from 8af3c18 to 31086a5 Compare October 7, 2026 11:44
@adeelahmad adeelahmad self-assigned this Oct 7, 2026
@adeelahmad
adeelahmad marked this pull request as ready for review October 7, 2026 11:45
claude added 6 commits October 7, 2026 12:21
…-l382kt

# Conflicts:
#	CHANGELOG.md
#	docs/configuration.md
#	fastapi_backend/app/domain/components.py
#	fastapi_backend/tests/fake_anytopdf.py
An unread upload made the socket reset, so the client sometimes saw
"can't be reached" instead of the long answer (red on CI).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TbMhC5vN23npJjEVxfEApC
…-l382kt

# Conflicts:
#	CHANGELOG.md
#	docs/components.md
#	fastapi_backend/app/domain/components.py
#	fastapi_backend/app/domain/settings.py
…-l382kt

# Conflicts:
#	fastapi_backend/app/domain/anytopdf.py
#	fastapi_backend/tests/api/test_anytopdf.py
…-l382kt

# Conflicts:
#	CHANGELOG.md
#	fastapi_backend/app/domain/anytopdf.py
The merge left the long-answer mode reading the upload twice, so it
waited on the client and broke the pipe.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TbMhC5vN23npJjEVxfEApC
@adeelahmad
adeelahmad merged commit f7947a6 into main Oct 7, 2026
7 checks passed
@adeelahmad
adeelahmad deleted the claude/project-thread-l382kt branch October 7, 2026 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0