update
This commit is contained in:
+11
-7
@@ -1,4 +1,5 @@
|
||||
import redis
|
||||
import os
|
||||
|
||||
# Redis配置
|
||||
REDIS_CONFIG = {
|
||||
@@ -38,13 +39,16 @@ REDIS_IDENTITY = redis.Redis(
|
||||
db=REDIS_DB['identity']
|
||||
)
|
||||
|
||||
# 获取项目根目录
|
||||
PROJECT_ROOT = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||
|
||||
# 文件路径配置
|
||||
PATH_CONFIG = {
|
||||
'base_dir': "files",
|
||||
'recordings': "files/recordings", # 视频录制目录
|
||||
'images': "files/images", # 图片目录
|
||||
'crop': "files/crop", # 裁剪图片目录
|
||||
'data': "files/data" # 数据目录
|
||||
'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流配置
|
||||
@@ -69,6 +73,6 @@ SFTP_CONFIG = {
|
||||
|
||||
# 模型路径配置
|
||||
MODEL_CONFIG = {
|
||||
'qwen_path': "/obscura/models/qwen/Qwen2-VL-7B-Instruct",
|
||||
'yolo_pose_path': '/home/zydi/models/yolo11n-pose.pt'
|
||||
'qwen_path': os.path.join(PROJECT_ROOT, "Qwen2-VL-7B-Instruct"),
|
||||
'yolo_pose_path': os.path.join(PROJECT_ROOT, "yolo11n-pose.pt")
|
||||
}
|
||||
@@ -3,7 +3,7 @@ import time
|
||||
from datetime import datetime
|
||||
import os
|
||||
import paramiko
|
||||
from config import SFTP_CONFIG, RTSP_CONFIG
|
||||
from config import SFTP_CONFIG, RTSP_CONFIG, PATH_CONFIG
|
||||
|
||||
class SFTPClient:
|
||||
def __init__(self):
|
||||
@@ -55,8 +55,8 @@ def record_rtsp_stream(rtsp_url, camera_name, start_delay=0):
|
||||
last_upload_time = time.time()
|
||||
pending_uploads = [] # 记录待上传的视频文件
|
||||
|
||||
script_dir = os.path.dirname(os.path.abspath(__file__))
|
||||
base_output_dir = os.path.join(script_dir, "recordings")
|
||||
# 直接使用配置中的路径
|
||||
base_output_dir = PATH_CONFIG['recordings']
|
||||
output_dir = os.path.join(base_output_dir, camera_name)
|
||||
|
||||
# 创建必要的文件夹
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user