Spaces:
Sleeping
Sleeping
Create config.py
Browse files
config.py
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
Configuration settings for the Attendance Analyzer application
|
| 3 |
+
"""
|
| 4 |
+
|
| 5 |
+
import os
|
| 6 |
+
|
| 7 |
+
class Config:
|
| 8 |
+
# Database settings
|
| 9 |
+
DATABASE_NAME = "attendance.db"
|
| 10 |
+
ENCODINGS_FILE = "face_encodings.pkl"
|
| 11 |
+
|
| 12 |
+
# Face recognition settings
|
| 13 |
+
FACE_RECOGNITION_TOLERANCE = 0.6
|
| 14 |
+
FACE_DETECTION_MODEL = "hog" # or "cnn" for better accuracy but slower
|
| 15 |
+
|
| 16 |
+
# Image processing settings
|
| 17 |
+
MAX_IMAGE_SIZE = (800, 600)
|
| 18 |
+
SUPPORTED_FORMATS = ['.jpg', '.jpeg', '.png', '.bmp']
|
| 19 |
+
|
| 20 |
+
# Application settings
|
| 21 |
+
APP_TITLE = "Attendance Analyzer - Face Detection System"
|
| 22 |
+
APP_DESCRIPTION = "AI-Powered automated attendance tracking system"
|
| 23 |
+
|
| 24 |
+
# Security settings
|
| 25 |
+
ALLOW_UNKNOWN_FACES = True
|
| 26 |
+
REQUIRE_CONFIRMATION = False
|
| 27 |
+
|
| 28 |
+
# Attendance settings
|
| 29 |
+
DUPLICATE_CHECK_HOURS = 24 # Hours to check for duplicate attendance
|
| 30 |
+
|
| 31 |
+
@classmethod
|
| 32 |
+
def get_database_path(cls):
|
| 33 |
+
return os.path.join(os.getcwd(), cls.DATABASE_NAME)
|
| 34 |
+
|
| 35 |
+
@classmethod
|
| 36 |
+
def get_encodings_path(cls):
|
| 37 |
+
return os.path.join(os.getcwd(), cls.ENCODINGS_FILE)
|