### Install NVIDIA GPU Runtime with uv Source: https://github.com/steinsag/photoaident/blob/main/README.md Use this command to synchronize dependencies for NVIDIA GPU (CUDA) support. Ensure you have the necessary CUDA drivers installed. ```bash uv sync --group cuda ``` -------------------------------- ### Install Intel Hardware Runtime with uv Source: https://github.com/steinsag/photoaident/blob/main/README.md Use this command to synchronize dependencies for Intel CPUs, iGPUs, or NPUs (OpenVINO). This is optimized for Intel hardware like N100 processors. ```bash uv sync --group openvino ``` -------------------------------- ### Install CPU/Apple Silicon Runtime with uv Source: https://github.com/steinsag/photoaident/blob/main/README.md Use this command to synchronize dependencies for CPU or Apple Silicon (CoreML) support. This is suitable for general-purpose computing. ```bash uv sync --group cpu_coreml ``` -------------------------------- ### Run PhotoAIdent Application Source: https://github.com/steinsag/photoaident/blob/main/README.md Execute the PhotoAIdent application using uv. This command starts the application with default logging settings. ```bash uv run photoaident ``` -------------------------------- ### Auto-Format Code with Black Source: https://github.com/steinsag/photoaident/blob/main/README.md Execute this command to automatically format the project's code according to Black's style guide. Ensure the target Python version is specified. ```bash uv run black --target-version py312 . ``` -------------------------------- ### Run Pyright Static Type Checker Source: https://github.com/steinsag/photoaident/blob/main/README.md Execute this command to perform static type checking on the project's source and test files using Pyright. Specify the Python version for accurate checking. ```bash uv run pyright --pythonversion 3.12 src/ tests/ ``` -------------------------------- ### Compile Translation Files Source: https://github.com/steinsag/photoaident/blob/main/README.md This command compiles .ts translation files into binary .qm format for the application to load. It iterates through all .ts files in the assets/translations directory. ```bash for ts in assets/translations/*.ts; do uv run pyside6-lrelease "$ts" -qm "${ts%.ts}.qm"; done ``` -------------------------------- ### Build AppImage Source: https://github.com/steinsag/photoaident/blob/main/AGENTS.md Creates an AppImage, a self-contained executable format for Linux. This script is used for packaging the application for Linux distributions. ```bash ./scripts/build_appimage.sh ``` -------------------------------- ### Run Pyright for Type Checking Source: https://github.com/steinsag/photoaident/blob/main/README.md Execute Pyright, a static type checker, on the source and test directories. This is part of the pre-commit hook process. ```bash uv run pyright src/ tests/ ``` -------------------------------- ### Run PhotoAIdent with Increased Logging Source: https://github.com/steinsag/photoaident/blob/main/README.md Execute the PhotoAIdent application with the DEBUG log level for enhanced verbosity. This is useful for debugging. ```bash uv run photoaident --log-level DEBUG ``` -------------------------------- ### Verify Code Formatting, Linting, Type-Checking, and Tests Source: https://github.com/steinsag/photoaident/blob/main/README.md Run a comprehensive verification script that includes auto-fixing formatting and linting issues, performing type checks, and executing tests. This script ensures code quality and consistency. ```bash uv run scripts/verify.py ``` -------------------------------- ### Build PyInstaller Bundle Source: https://github.com/steinsag/photoaident/blob/main/AGENTS.md Builds a standalone executable bundle of the application using PyInstaller. This script is used to package the application for distribution. ```bash ./scripts/build_pyinstaller.sh ``` -------------------------------- ### Run Tests with Pytest and Coverage Source: https://github.com/steinsag/photoaident/blob/main/README.md Execute tests using 'pytest' to automatically generate coverage reports. This command runs tests and provides terminal, HTML, and XML coverage summaries. ```bash uv run pytest ``` -------------------------------- ### Photoaident Database Schema Diagram Source: https://github.com/steinsag/photoaident/blob/main/README.md This Mermaid diagram illustrates the database schema for Photoaident, showing tables, their columns, primary keys (PK), foreign keys (FK), and relationships (one-to-one, one-to-many). ```mermaid erDiagram images ||--o| image_metadata: "1:1" images ||--o{ image_tags: "1:N" images ||--o{ faces: "1:N" persons ||--o{ faces: "1:N" persons ||--o{ embedding_clusters: "1:N" persons ||--o{ suggestions: "1:N" embedding_clusters ||--o{ faces: "1:N" embedding_clusters ||--o{ suggestions: "1:N" faces ||--o{ suggestions: "1:N" images { int id PK string file_path UK string file_hash "SHA256" int file_size datetime indexed_at datetime updated_at int index_version } image_metadata { int id PK int image_id FK, UK datetime taken_at string taken_at_source "nullable, exif|filepath|manual" string camera_make string camera_model numeric gps_lat numeric gps_lon float gps_altitude int width int height int orientation "EXIF 1-8" } image_tags { int id PK int image_id FK string tag_key string tag_value string tag_source "model|manual" string model_name datetime created_at } faces { int id PK int image_id FK int faiss_id "nullable, deprecated" int bbox_x int bbox_y int bbox_w int bbox_h float detection_confidence int person_id FK int cluster_id FK string state "unidentified|identified|anonymous" datetime labelled_at string model_version datetime deleted_at } persons { int id PK string name string notes datetime created_at } embedding_clusters { int id PK int person_id FK string label string age_group "infant|youngster|teenager|adult|senior" blob mean_embedding "nullable, 512-dim float32" datetime created_at } suggestions { int id PK int face_id FK int person_id FK int cluster_id FK float similarity_score string state "pending|confirmed|rejected" datetime created_at } ``` -------------------------------- ### Run GPU Integration Tests Only Source: https://github.com/steinsag/photoaident/blob/main/AGENTS.md Executes only the integration tests marked with the 'gpu' marker. These tests are skipped if CUDA is unavailable and are intended for systems with NVIDIA GPUs. ```bash uv run pytest -m gpu ``` -------------------------------- ### Enable Git Pre-commit Hooks Source: https://github.com/steinsag/photoaident/blob/main/README.md Configure Git to use repository-managed pre-commit hooks. This ensures linters, formatters, and type checkers run automatically before each commit. ```bash git config core.hooksPath .githooks ``` -------------------------------- ### Run Static Type Checking with ty Source: https://github.com/steinsag/photoaident/blob/main/README.md Execute the 'ty check' command to perform static type checking across the entire project. This ensures code adheres to defined types before runtime. ```bash uv run ty check ``` -------------------------------- ### Check Code Formatting with Black Source: https://github.com/steinsag/photoaident/blob/main/README.md Run this command to check if the code adheres to Black's formatting standards without making any changes. Specify the target Python version. ```bash uv run black --check --target-version py312 . ``` -------------------------------- ### Apply All Alembic Migrations Source: https://github.com/steinsag/photoaident/blob/main/AGENTS.md Applies all pending database migrations to the current database. This command is typically used in development to bring the database schema up to date. ```bash uv run alembic upgrade head ``` -------------------------------- ### Generate Alembic Migration Source: https://github.com/steinsag/photoaident/blob/main/AGENTS.md Use this command to create a new database migration script after modifying data models. Always review the generated script before committing. ```bash uv run alembic revision --autogenerate -m "describe the change" ``` -------------------------------- ### Create New Alembic Migration Source: https://github.com/steinsag/photoaident/blob/main/AGENTS.md Generates a new database migration script using Alembic. The `--autogenerate` flag attempts to detect schema changes, and `-m "description"` requires a descriptive message for the migration. ```bash uv run alembic revision --autogenerate -m "description" ``` -------------------------------- ### Run Ruff Linter Source: https://github.com/steinsag/photoaident/blob/main/README.md This command runs Ruff to check for common Python linting rule violations across the entire project. ```bash uv run ruff check . ``` -------------------------------- ### Lint Code with Ruff Source: https://github.com/steinsag/photoaident/blob/main/AGENTS.md Runs the Ruff linter to check for code style issues and potential errors. The `--fix` flag attempts to automatically correct fixable issues, and `--quiet` reduces output verbosity. ```bash uv run ruff check --fix --quiet ``` -------------------------------- ### Format Code with Black Source: https://github.com/steinsag/photoaident/blob/main/AGENTS.md Formats the Python code in the project using Black, a strict code formatter. `--target-version py312` ensures compatibility with Python 3.12, and `--quiet` reduces output. ```bash uv run black --quiet --target-version py312 . ``` -------------------------------- ### Auto-Fix Linting Errors with Ruff Source: https://github.com/steinsag/photoaident/blob/main/README.md Use this command to automatically fix linting issues that Ruff can resolve. It checks the project and applies fixes where possible. ```bash uv run ruff check . --fix ``` -------------------------------- ### Update Translation Source Files Source: https://github.com/steinsag/photoaident/blob/main/README.md Use this command to update the .ts translation source files after modifying strings. The `-locations none` flag prevents line-number tags from causing unnecessary diffs, and `-extensions py` is required for Python files. ```bash uv run pyside6-lupdate -locations none -extensions py src/ -ts assets/translations/photoaident_de.ts assets/translations/photoaident_en.ts ``` -------------------------------- ### Bypass Git Pre-commit Hook Source: https://github.com/steinsag/photoaident/blob/main/README.md Command to bypass the Git pre-commit hook during a commit. Use this when you need to commit changes without running the automated checks. ```bash git commit --no-verify ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.