Skip to content

Latest commit

 

History

History
122 lines (84 loc) · 2.39 KB

File metadata and controls

122 lines (84 loc) · 2.39 KB

Windows EXE Build

Build the executable on a Windows machine. PyInstaller does not cross-compile a Windows .exe reliably from Linux.

Build

From the project root in PowerShell:

.\scripts\build_windows.ps1 -Clean

If uv is not installed, the script installs it automatically using Astral's official Windows installer, then continues the build.

Before building, confirm the spec file exists in the project root:

Test-Path .\gym_vision.spec

This must print:

True

This runs:

uv run --with pyinstaller pyinstaller --clean --noconfirm .\gym_vision.spec
uv run --with pyinstaller pyinstaller --clean --noconfirm .\test_ws_server_gui.spec

Output:

dist\gym_vision.exe
dist\test_ws_server_gui.exe
dist\config.yaml
facegate-windows.zip

Runtime Config

config.yaml is intentionally kept outside the one-file executable.

Keep this layout:

dist\
  gym_vision.exe
  test_ws_server_gui.exe
  config.yaml

The build script also creates a release-style archive:

facegate-windows.zip

Edit dist\config.yaml to change cameras, websocket URL, database path, FPS limits, crop settings, and recognition thresholds. You do not need to rebuild the .exe after editing the config.

Run:

.\dist\gym_vision.exe

Run the GUI test server:

.\dist\test_ws_server_gui.exe

Or use an explicit config path:

.\dist\gym_vision.exe --config-path C:\Latika\config.yaml

Bundled Models

The models\ directory is bundled into the one-file executable. The default config value:

vision_setting:
  models_path: models/

will use external models\ if it exists near the config/current directory, otherwise it falls back to the bundled PyInstaller model files.

Runtime Files

Relative database paths are resolved relative to the config file location. With the default:

vision_setting:
  face_DB_path: data/face_embeddings.sqlite3

the executable will use:

dist\data\face_embeddings.sqlite3

The data directory is generated outside the one-file executable at runtime:

dist\
  gym_vision.exe
  test_ws_server_gui.exe
  config.yaml
  data\
    face_embeddings.sqlite3
    logs\
      debug_YYYY-MM-DD.log
      error_YYYY-MM-DD.log

This keeps logs and the SQLite database editable, backup-friendly, and persistent across executable rebuilds.