This commit is contained in:
琉璃月光
2025-10-21 14:11:52 +08:00
parent 349449f2b7
commit df7c0730f5
363 changed files with 5386 additions and 578 deletions

View File

@ -25,6 +25,7 @@ def predict_obb_best_angle(model_path, image_path, save_path=None):
# 3. 推理 OBB
results = model(img, save=False, imgsz=640, conf=0.5, mode='obb')
result = results[0]
print(result)
# 4. 可视化
annotated_img = result.plot()
@ -62,8 +63,8 @@ def predict_obb_best_angle(model_path, image_path, save_path=None):
# ------------------- 测试 -------------------
if __name__ == "__main__":
weight_path = r'best.pt'
image_path = r"./test_image/3.jpg"
weight_path = r'obb.pt'
image_path = r"./test_image/7.jpg"
save_path = "./inference_results/detected_3.jpg"
#angle_deg, annotated_img = predict_obb_best_angle(weight_path, image_path, save_path)