bushu
This commit is contained in:
@ -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)
|
||||
|
||||
Reference in New Issue
Block a user