diff --git a/src/image_object_detection/config.py b/src/image_object_detection/config.py index 277510f4c5..bb51feacaa 100644 --- a/src/image_object_detection/config.py +++ b/src/image_object_detection/config.py @@ -18,8 +18,10 @@ def __init__(self): # 默认测试图像路径:位于项目根目录下的 data/test.jpg # 若用户未指定图像路径,系统将尝试加载此文件 - self.default_image_path = r"C:\Users\apple\OneDrive\桌面\test.jpg" + base_dir = os.path.dirname(os.path.abspath(__file__)) + self.default_image_path = os.path.join(base_dir, "data", "test.jpg") #注意:项目根目录下的data文件!!! + # YOLO 模型权重文件路径 # 支持: # - 内置模型名(如 "yolov8n.pt",首次运行会自动下载) @@ -29,7 +31,7 @@ def __init__(self): # 目标检测的置信度阈值 # 只有置信度 ≥ 此值的检测框才会被保留和显示 # 范围:0.0 ~ 1.0,值越高,结果越严格 - self.confidence_threshold = 0.25 + self.confidence_threshold = 0.35 # 摄像头设备索引 # 通常 0 表示内置摄像头,外接摄像头可能为 1、2 等 @@ -39,3 +41,4 @@ def __init__(self): # 例如设为 1.0 表示每秒打印一次当前处理速度 self.output_interval = 1.0 +