-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathconfig.py
More file actions
32 lines (26 loc) · 1005 Bytes
/
config.py
File metadata and controls
32 lines (26 loc) · 1005 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
"""
Configuration settings for the SafeVision application.
"""
import os
# Directory settings
ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
SAVE_DIR = os.path.join(ROOT_DIR, "detected_behaviors")
MODELS_DIR = os.path.join(ROOT_DIR, "models")
# Model settings
YOLO_MODEL_PATH = os.path.join(MODELS_DIR, "yolov8n.pt")
BEHAVIOR_MODEL = "microsoft/resnet-50"
# Detection settings
SAVE_INTERVAL = 10 * 60 # Save images every 10 minutes
MOVEMENT_THRESHOLD = 40 # Threshold for sudden movement detection
EDGE_THRESHOLD = 80 # Threshold for edge of frame detection
FACE_SIZE_THRESHOLD = 160 # Threshold for detecting leaning forward
SKIN_AREA_THRESHOLD = 5000 # Threshold for significant skin area
# Behavior detection settings
SKIN_COLOR_LOWER = [0, 20, 70] # Lower HSV range for skin color
SKIN_COLOR_UPPER = [20, 255, 255] # Upper HSV range for skin color
# Web server settings
DEBUG = True
HOST = "127.0.0.1"
PORT = 5000
# Create necessary directories
os.makedirs(SAVE_DIR, exist_ok=True)