Welcome to ROSMASTER M3 repository
7.Oriented object detection
Oriented object detection.md
Note: Using the Docker container in the factory image does not require re-setting up the environment. The environment is already set up. Simply enter Docker and run the corresponding function commands according to the previous tutorial.
1. Orienting Objects: Images
Use yolo11n-obb.pt to predict images provided with the Ultralytics project.
Go to the code folder:
cd /root/ultralytics/ultralytics/yahboom_demo
Run the code:
xxxxxxxxxxpython3 05.obb_image.py
Preview
Yolo recognition output image location: /root/ultralytics/ultralytics/output/

Sample code:
xfrom ultralytics import YOLO# Load a modelmodel = YOLO("/root/ultralytics/ultralytics/yolo11n-obb.pt")# model = YOLO("/root/ultralytics/ultralytics/yolo11n-obb.onnx")# model = YOLO("/root/ultralytics/ultralytics/yolo11n-obb_ncnn_model")# Run batched inference on a list of imagesresults = model("/root/ultralytics/ultralytics/assets/car.jpg") # return a list of Results objects# Process results listfor result in results: boxes = result.boxes # Boxes object for bounding box outputs # masks = result.masks # Masks object for segmentation masks outputs # keypoints = result.keypoints # Keypoints object for pose outputs # probs = result.probs # Probs object for classification outputs obb = result.obb # Oriented boxes object for OBB outputs result.show() # display to screen result.save(filename="/root/ultralytics/ultralytics/output/car_output.jpg") # save to disk2. Oriented Object Detection: Video
Use yolo11n-obb.pt to predict videos in the Ultralytics project (not included with Ultralytics).
Go to the code folder:
xxxxxxxxxxcd /root/ultralytics/ultralytics/yahboom_demo
Run the code:
xxxxxxxxxxpython3 02.segmentation_video.py
Preview
Yolo recognition output video location: /root/ultralytics/ultralytics/output/

Sample code: