feat: Enhance API startup script and add file hash management for photos
This commit improves the `run_api_with_worker.sh` script by ensuring the virtual environment is created if it doesn't exist and dependencies are installed. It also adds a check to ensure the database schema is up to date. Additionally, new functionality has been introduced to calculate and store file hashes for uploaded photos, preventing duplicates. The database schema has been updated to include a `file_hash` column in the `photos` table, along with an index for efficient querying. The frontend has been updated to handle warnings for duplicate photos during the review process. Documentation has been updated to reflect these changes.
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
"""Configuration values used by the PunimTag web services.
|
||||
|
||||
This module replaces the legacy desktop configuration to keep the web
|
||||
application self-contained.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
# Supported image formats for uploads/imports
|
||||
SUPPORTED_IMAGE_FORMATS = {".jpg", ".jpeg", ".png", ".bmp", ".tiff", ".tif"}
|
||||
|
||||
# DeepFace behavior
|
||||
DEEPFACE_ENFORCE_DETECTION = False
|
||||
DEEPFACE_ALIGN_FACES = True
|
||||
|
||||
# Face filtering thresholds
|
||||
MIN_FACE_CONFIDENCE = 0.4
|
||||
MIN_FACE_SIZE = 40
|
||||
MAX_FACE_SIZE = 1500
|
||||
|
||||
# Matching tolerance and calibration options
|
||||
DEFAULT_FACE_TOLERANCE = 0.6
|
||||
USE_CALIBRATED_CONFIDENCE = True
|
||||
CONFIDENCE_CALIBRATION_METHOD = "empirical" # "empirical", "linear", or "sigmoid"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user