You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add AI photo organizer with face recognition and multi-language support
Add the `pdx organize` command that uses a vision-language model via
Ollama to describe photos and group them into named folders by date.
- YAML-based configuration with example template
- Family context file for personalized AI descriptions
- Folder history as style examples for AI naming
- Face recognition via insightface with reference photo directories
- HEIC/HEIF conversion for VLM compatibility
- Multi-language prompts (Czech and English)
- Video discovery and organization alongside photos
- GPS/EXIF-based location extraction with home location filtering
- Helpful error when config.yaml is missing
- Documentation for setup, configuration, and all features
Bug fixes:
- fix: move text tokens to GPU and results back to CPU in prompt_to_vector
- fix: filter files by supported extensions in handle_path to prevent
indexing non-photo files passed as arguments
Copy file name to clipboardExpand all lines: README.md
+69Lines changed: 69 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,15 @@
1
1
# Photo inDeXer (pdx)
2
2
3
+
## Prerequisites
4
+
5
+
- Python 3.13+
6
+
-[Ollama](https://ollama.com) with a vision-language model pulled (e.g. `ollama pull gemma4:26b`)
7
+
-[Podman](https://podman.io) for running Qdrant
8
+
-`exiftool` for EXIF/GPS metadata extraction (`sudo apt install -y libimage-exiftool-perl`)
9
+
-`libGL` for face recognition (`sudo apt install -y libgl1` on Debian/Ubuntu, `sudo dnf install -y mesa-libGL` on Fedora) — optional, only needed if using the `faces` config
10
+
11
+
See [README-Windows.md](README-Windows.md) for Windows/WSL-specific setup.
12
+
3
13
## Set up a virtual Python environment
4
14
5
15
```sh
@@ -8,6 +18,60 @@ source .venv/bin/activate
8
18
pip install -e .
9
19
```
10
20
21
+
## Configuration
22
+
23
+
Copy the example config and adjust it for your setup:
24
+
25
+
```sh
26
+
cp config.example.yaml config.yaml
27
+
```
28
+
29
+
| Section | Key | Description |
30
+
|---------|-----|-------------|
31
+
|`ai`|`language`| Output language: `cs` (Czech) or `en` (English) |
32
+
|`ai`|`ollama_url`| URL of the Ollama API endpoint |
33
+
|`ai`|`model_name`| Vision-language model to use (e.g. `gemma4:26b`) |
34
+
|`location`|`home_names`| List of city names considered "home" — photos taken here won't have the location in the folder name |
35
+
|`faces`|`reference_dir`| Directory with reference face photos for recognition (one subdirectory per person) |
36
+
|`faces`|`similarity_threshold`| Face matching threshold (lower = stricter, default `0.4`) |
|`storage`|`context_file`| Path to a text file with family/personal context for the AI |
39
+
|`storage`|`history_file`| JSON list of past folder names (e.g. `"210619 - Beach volleyball"`) used as style examples for AI naming |
40
+
41
+
### Face recognition (optional)
42
+
43
+
To enable face recognition, create a reference directory with one subdirectory per person, each containing a few clear photos of their face (one face per photo):
44
+
45
+
```
46
+
~/results/pdx/faces/
47
+
├── john/
48
+
│ ├── photo1.jpg
49
+
│ ├── photo2.jpg
50
+
│ └── photo3.jpg
51
+
└── jane/
52
+
├── photo1.jpg
53
+
└── photo2.jpg
54
+
```
55
+
56
+
Directory names are used as identifiers. Use `name_map` in the config to map them to display names (e.g. `john: "Johnny"`). 3-5 reference photos per person is usually enough.
57
+
58
+
### Family context (optional)
59
+
60
+
The `context_file` (default: `family_context.txt`) gives the AI background knowledge about your family — names, hobbies, sports, travel habits. This helps it generate more accurate photo descriptions and folder names. Write it in the same language as your `language` setting. Example:
61
+
62
+
```
63
+
FAMILY MEMBERS:
64
+
- Dad: Born 1985. Hobbies, sports.
65
+
- Mom: Born 1987. Hobbies, interests.
66
+
- Child1: Born 2013. Sport (team name, jersey color).
67
+
68
+
SPORTS:
69
+
- Sport1 (Child1 only): Jersey description, equipment.
70
+
- Sport2 (Dad): Gear, typical events.
71
+
```
72
+
73
+
If the file is missing, the AI falls back to generic descriptions.
74
+
11
75
## Start/stop Qdrant (podman)
12
76
13
77
Storage is in the `pdx` directory under XDG data home (default: `~/.local/share/pdx`).
@@ -29,6 +93,11 @@ pdx index -c private /path/to/private_photos # create or extend the `private`
29
93
pdx erase -c private # delete the `private` collection
30
94
```
31
95
96
+
## Organize photos
97
+
```sh
98
+
pdx organize -c private /path/to/organized_folder # Use AI and EXIF to group photos into a structured directory tree.
0 commit comments