Closed FabianEP11 closed 1 week ago
๐ Hello @FabianEP11, thank you for your interest in Ultralytics ๐! We appreciate you bringing this up and providing detailed information.
We recommend a quick look at the Ultralytics Docs for reference, including specific sections on Python usage and model outputs, which might help clarify expected outputs.
If this is a ๐ Bug Report, it would help tremendously if you could provide a minimum reproducible example (MRE). This allows us to dive deeper and confirm the behavior. In your case, it looks like the boxes
field is returning None
, despite bounding boxes being displayed in the saved image. This suggests a potential post-processing or confidence threshold issue.
You may want to:
confidence
or iou
threshold set for the model. Lower thresholds might help if some bounding boxes are being filtered out. obb
attribute directly in the results, as the boxes
might be represented differently for OBB-specific model outputs.If this is a โ Question, let us know more about any specific modifications or debugging steps youโve already tried, and provide dataset examples or logs (if applicable). Make sure to confirm you're following the Tips for Best Training Results.
Ensure you're running the latest ultralytics
package with up-to-date dependencies to confirm the issue hasnโt already been resolved. Update your environment as follows:
pip install -U ultralytics
For testing, running YOLO in a verified environment might help narrow down the issue. Some options include:
Docker Quickstart Guide:
Testing in one of these environments ensures all dependencies are pre-installed and correctly configured.
Join the Ultralytics community for diverse support:
Please note this is an automated response ๐ค. An Ultralytics engineer will review and assist you further as soon as possible. Thank you for your patience and for reporting this!
It's in results.obb
not results.boxes
Oh I see, thanks!
@FabianEP11 you're welcome! For OBB tasks, the oriented bounding boxes are stored in results.obb
instead of results.boxes
. You can access their coordinates using properties like xywhr
(center coordinates, width, height, rotation) or xyxyxyxy
(4 corner points). Check the OBB documentation here for more details: https://docs.ultralytics.com/reference/engine/results/#ultralytics.engine.results.OBB
Thank you! that's what I was looking for.
You're welcome! Glad the OBB solution worked for you. ๐ For future reference, all oriented box properties like coordinates and rotations are accessible through results.obb
as shown in our documentation. Happy coding!
Hello, I also encountered the same problem as you. May I ask how to print out the predicted results of obb model? Could you please provide the modified code for reference?
For OBB models, access oriented box coordinates via results.obb.xywhr
or results.obb.xyxyxyxy
. Here's the modified code:
from ultralytics import YOLO
model = YOLO("yolo11n-obb.pt")
results = model('image.jpg')
for r in results:
print(r.obb.xywhr) # or r.obb.xyxyxyxy for corner points
For more details see the OBB documentation.
Search before asking
Question
Hi,
I'm encountering an issue where the YOLO models (
yolo11n-obb.pt
,yolo11m-obb.pt
) don't return the bounding box values, even though the output includes the image with bounding boxes visually displayed.I have searched in the documentation and I found the same issue in this discussion: https://github.com/orgs/ultralytics/discussions/8462#discussioncomment-10200090
The proposed solution was to decrease the confidence score, but I don't think thatโs the issue because when I run the script, the output image correctly shows the bounding boxes and labels. However, the resulting output does not contain any values for the bounding box coordinates in the "boxes" field.
- Result Output
`Speed: 3.3ms preprocess, 81.1ms inference, 1.9ms postprocess per image at shape (1, 3, 576, 1024) Results saved to runs/obb/track4 [ultralytics.engine.results.Results object with attributes:
boxes: None keypoints: None masks: None names: {0: 'plane', 1: 'ship', 2: 'storage tank', 3: 'baseball diamond', 4: 'tennis court', 5: 'basketball court', 6: 'ground track field', 7: 'harbor', 8: 'bridge', 9: 'large vehicle', 10: 'small vehicle', 11: 'helicopter', 12: 'roundabout', 13: 'soccer ball field', 14: 'swimming pool'} obb: ultralytics.engine.results.OBB object orig_img: array([[[137, 136, 135], [137, 136, 135], [137, 136, 135], ..., [177, 176, 175], [177, 176, 175], [177, 176, 175]],
orig_shape: (1080, 1920)`
Am I missing something?
I would appreciate any help, Thank you
Additional
No response