项目基础模块代码

This commit is contained in:
2025-02-19 11:47:33 +08:00
parent 3cb2a4c507
commit 31302bcd17
30 changed files with 588 additions and 74 deletions

View File

@ -8,4 +8,11 @@ db = 0
password = sdust2020
[log]
dir = D:\syg\workspace\logs
dir = D:\syg\workspace\logs
[yolo]
datasets_url = D:\syg\yolov5\datasets
runs_url = D:\syg\yolov5\runs
[images]
image_url = D:\syg\images

View File

@ -1,11 +0,0 @@
[mysql]
database_url = mysql+pymysql://root:root@localhost:3306/sun
[redis]
host = localhost
port = 6379
db = 0
password = 123456
[log]
dir = /Users/macbookpro/sunyg/workspace/logs

View File

@ -0,0 +1,18 @@
[mysql]
database_url = mysql+pymysql://root:root@localhost:3306/sun
[redis]
host = localhost
port = 6379
db = 0
password = 123456
[log]
dir = /Users/macbookpro/sunyg/workspace/logs
[yolo]
datasets_url = /home/yolov5/datasets
runs_url = /home/yolov5/runs
[images]
image_url = /home/images

View File

@ -3,6 +3,8 @@ import os
env = "dev"
# env = "prod"
script_directory = os.path.dirname(os.path.abspath(__file__))
config_path = os.path.join(script_directory, f'application_config_{env}.ini')
@ -18,4 +20,9 @@ redis_port = config.get('redis', 'port')
redis_db = config.get('redis', 'db')
redis_password = config.get('redis', 'password')
log_dir = config.get('log', 'dir')
log_dir = config.get('log', 'dir')
datasets_url = config.get('yolo', 'datasets_url')
runs_url = config.get('yolo', 'runs_url')
images_url = config.get('images', 'image_url')