78 lines
1.9 KiB
Python
78 lines
1.9 KiB
Python
import redis
|
|
import os
|
|
|
|
# Redis配置
|
|
REDIS_CONFIG = {
|
|
'host': "222.186.10.253",
|
|
'port': 6379,
|
|
'password': "Obscura@2024"
|
|
}
|
|
|
|
# Redis数据库映射
|
|
REDIS_DB = {
|
|
'camera_A01': 210, # A01摄像头数据库
|
|
'camera_B02': 211, # B02摄像头数据库
|
|
'identity': 212, # 身份信息数据库
|
|
}
|
|
|
|
# 初始化Redis客户端
|
|
REDIS_CLIENTS = {
|
|
'A01': redis.Redis(
|
|
host=REDIS_CONFIG['host'],
|
|
port=REDIS_CONFIG['port'],
|
|
password=REDIS_CONFIG['password'],
|
|
db=REDIS_DB['camera_A01']
|
|
),
|
|
'B02': redis.Redis(
|
|
host=REDIS_CONFIG['host'],
|
|
port=REDIS_CONFIG['port'],
|
|
password=REDIS_CONFIG['password'],
|
|
db=REDIS_DB['camera_B02']
|
|
)
|
|
}
|
|
|
|
# 身份数据库客户端
|
|
REDIS_IDENTITY = redis.Redis(
|
|
host=REDIS_CONFIG['host'],
|
|
port=REDIS_CONFIG['port'],
|
|
password=REDIS_CONFIG['password'],
|
|
db=REDIS_DB['identity']
|
|
)
|
|
|
|
# 获取项目根目录
|
|
PROJECT_ROOT = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
|
|
|
# 文件路径配置
|
|
PATH_CONFIG = {
|
|
'base_dir': os.path.join(PROJECT_ROOT, "files"),
|
|
'recordings': os.path.join(PROJECT_ROOT, "files/recordings"),
|
|
'images': os.path.join(PROJECT_ROOT, "files/images"),
|
|
'crop': os.path.join(PROJECT_ROOT, "files/crop"),
|
|
'data': os.path.join(PROJECT_ROOT, "files/data")
|
|
}
|
|
|
|
# RTSP流配置
|
|
RTSP_CONFIG = {
|
|
'A01': {
|
|
'url': "rtsp://admin:Obscura@2024@192.168.31.196:554//h264/ch1/main/av_stream",
|
|
'name': "A01"
|
|
},
|
|
'B02': {
|
|
'url': "rtsp://admin:AWOLDS@192.168.31.181:554//h264/ch1/main/av_stream",
|
|
'name': "B02"
|
|
}
|
|
}
|
|
|
|
# SFTP配置
|
|
SFTP_CONFIG = {
|
|
'hostname': "222.186.10.253",
|
|
'username': "zydi",
|
|
'password': "Obscura@2024",
|
|
'remote_base_path': "files/recordings"
|
|
}
|
|
|
|
# 模型路径配置
|
|
MODEL_CONFIG = {
|
|
'qwen_path': os.path.join(PROJECT_ROOT, "Qwen2-VL-7B-Instruct"),
|
|
'yolo_pose_path': os.path.join(PROJECT_ROOT, "yolo11n-pose.pt")
|
|
} |