添加状态分类和液面分割
This commit is contained in:
@ -6,7 +6,7 @@ import torch
|
||||
import torch.nn.functional as F
|
||||
|
||||
# ------------------ 模型与路径配置 ------------------
|
||||
MODEL_PATH = '../ultralytics_yolo11-main/runs/train/exp4/weights/best.pt'
|
||||
MODEL_PATH = '../ultralytics_yolo11-main/runs/train/seg/exp2/weights/best.pt'
|
||||
OUTPUT_DIR = '../test_image'
|
||||
os.makedirs(OUTPUT_DIR, exist_ok=True)
|
||||
|
||||
@ -24,7 +24,7 @@ def detect_jaw_angle_fast(image_path, mode='silent'):
|
||||
name_only = os.path.splitext(filename)[0]
|
||||
|
||||
# 推理(批量可进一步提速)
|
||||
results = model(image_path, imgsz=1280, conf=0.5, device='cuda')
|
||||
results = model(image_path, imgsz=1280, conf=0.15, device='cuda')
|
||||
r = results[0]
|
||||
|
||||
if r.masks is None:
|
||||
@ -100,9 +100,9 @@ def detect_jaw_angle_fast(image_path, mode='silent'):
|
||||
|
||||
# ------------------ 测试 ------------------
|
||||
if __name__ == '__main__':
|
||||
image_path = '/test_image/1.png'
|
||||
image_path = '/home/hx/yolo/output_masks/1.jpg'
|
||||
print(f"🚀 处理: {image_path}")
|
||||
angle = detect_jaw_angle_fast(image_path, mode='silent')
|
||||
angle = detect_jaw_angle_fast(image_path, mode='show')
|
||||
if angle is not None:
|
||||
print(f"✅ 角度: {angle}°")
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user