What’s included
We described how the applications is build in this post. The sources for the App are now available for downloading in a zipped package.

On first run a settings.json will be created next to the code when you save Preferences.
Download Link at the bottom
Prerequisites
- Python: 3.10 or 3.11 (64-bit recommended).
- Pip: latest (python -m pip install -U pip).
- Windows only (if you build anything from source): Microsoft C++ Build Tools. (Most users won’t need this, just use pre build wheels for dlib. See below for download and installing details)
GPU encoding is optional. The app runs CPU-only out of the box. If you have CUDA (wich comes with NVIDEA based Graphic Cards like the RTX 40×0 series), install the matching batch recognition worker (face + body) Torch/Torch Vision wheels from PyTorch.
Installing
Optionally create a clean Python Environment
# Windows (PowerShell, Command Prompt)
python -m venv .venv
.venv\Scripts\Activate.ps1
# macOS / Linux
python3 -m venv .venv
source .venv/bin/activate
Install Python packages
Core stack (CPU-only defaults):
- pip install “torch==2.3.1” “torchvision==0.18.1” –index-url https://download.pytorch.org/whl/cpu
- pip install numpy pillow “opencv-python>=4.8” “face_recognition==1.3.0” face_recognition_models
- pip install “torchreid>=1.4.0” “PyQt6>=6.6”
The app imports TorchReID through a wrapper that supports both torchreid.models and the legacy torchreid.reid.models, and silences the usual console spam.
Install dlib (required by face_recognition)
#Windows/macOS:
install a prebuilt dlib wheel compatible with your Python version (recommended). Pre-built dlib wheel files for Python 3.10 are available from multiple GitHub repositories and direct download links, primarily for Windows 64-bit systems. The most commonly referenced wheel file is dlib-19.22.99-cp310-cp310-win_amd64.whl
Download the Wheel File
Obtain the pre-built wheel from a trusted source like: GitHub – preetrathi/Wheel-Issue-Solved
GitHub – Murtaza-Saeed/Dlib-Precompiled-Wheels
Install Using pip
Open a terminal, navigate to the download directory, and run:
pip install dlib-19.22.99-cp310-cp310-win_amd64.whl
This method avoids compilation issues and significantly reduces installation time.
#Linux:
pip install dlib (requires build tools).
Once dlib is installed, face_recognition works. The face pipeline normalizes image buffers for dlib. Also it has HOG→CNN fallbacks and optional blur filtering. Besides it can emit embeddings directly.
If you see pkg_resources is deprecated or TorchReID “Cython evaluation” warnings. Don’t worry the app already filters these in main.py.
To verify that all imports work, here is a small optional but handy script.
python – << “PY”
import torch, importlib.util as u
print(‘torch’, torch.__version__, ‘cuda?’, torch.cuda.is_available())
print(‘face_recognition?’, u.find_spec(‘face_recognition’) is not None)
print(‘dlib?’, u.find_spec(‘dlib’) is not None)
print(‘torchreid?’, u.find_spec(‘torchreid’) is not None)
PY
First test run
At a Command Prompt enter:
python main.py
Open Settings → Preferences and set:
- Persons dataset – the KB root folder (one subfolder per person).
- Processed output – where recognized images are copied.
- Process input – folder you’ll run recognition on.
- Face tolerance (distance; smaller = stricter).
- Body similarity (cosine; larger = stricter).
- ReID model (default osnet_ain_x1_0).
Click OK to save (settings.json is written).
Build/extend the Knowledge Base (KB)
At a Command Prompt enter:
python main.py
OpenKnowledgebase → Initialize KB…
Pick your KB root (each subfolder name is a person; images inside).
The app computes face/body embeddings and writes encodings.pkl in the KB root.
OpenKnowledgebase → Extend KB from Folder…
Choose a staging folder with new person subfolders; they’re copied into the KB and only those are encoded. File handles are safely closed to avoid Windows locks.
OpenKnowledgebase → Show KB Stats…
See persons, image counts, face/body totals, embedding dims, discrepancies (names only in folders vs only in pkl), and encodings.pkl size.
Manage persons
At a Command Prompt enter:
python main.py
Open Manage Persons → Add / Remove / Rename / Re-encode Person…
These operations are threaded, log progress in the console, and update encodings.pkl consistently. Re-encode wipes a person’s old encodings and rebuilds them with current models/settings.
Batch recognition
At a Command Prompt enter:
python main.py
Open Recognition → Recognize Folder…
Select an input folder (defaults to your “Process input”).
The worker now:
- Aligns and embeds the biggest detected face, compares to known faces with the configured distance threshold.
- Extracts a TorchReID body vector and compares by cosine similarity.
- Uses face result if confident; otherwise falls back to body.
- Copies the image into Processed output/<FinalName>/ and logs top-3 face/body matches with scores.
Threshold tips
- Face tolerance (distance): 0.60 = balanced; 0.50 = stricter; 0.40 = very strict.
- Body similarity (cosine): start around 0.80 and adjust per dataset.
Both are editable in Preferences and used by the workers at runtime.
Common issues & fixes
- “TorchReID models path” errors — your install might expose torchreid.reid.models. The wrapper auto-detects and logs that it’s using the fallback path; no action needed.
- “No images found” after starting recognition — the app now checks the folder before heavy initialization; verify extensions match your valid_exts.
- Windows file locks — all PIL opens use context managers and .copy() where needed (batch body extraction) to keep files closed.
- Console noise (Cython / pkg_resources) — filtered centrally in main.py.
Download Link

This Archive contains the seven Python source code files for the People Recognize App.
It comes with installation and usage Instructions in the Readme.md
Note: the latest complete download can be found here.