Closed glenn-jocher closed 1 week ago
Attention: Patch coverage is 11.76471%
with 15 lines
in your changes are missing coverage. Please review.
Project coverage is 37.38%. Comparing base (
f2f1afd
) to head (be722fe
).
Files | Patch % | Lines |
---|---|---|
ultralytics/engine/results.py | 0.00% | 15 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@Laughing-q not sure if OBB Results should include an 'xyxy' box? We should remove this attribute no?
Ah nevermind, I see this, I understand now, all good!
@Laughing-q could you try to update Results.summary() to enable OBB and Classify model summaries? The summaries are essentially the default JSON return for our inference API. They work correctly now for Detect, Segment and Pose models but need additional handling for Classify and OBB in order for the newly parameterized test_results
test to pass.
Thank you!
@glenn-jocher Done in https://github.com/ultralytics/ultralytics/pull/11653/commits/87f46e77128af9125b9da30033ed3c8ad56d3f1e. Currently classify model would only output names, confidence, class
keys(no box), and obb by default returns xyxyxyxy
format for box
with keys x1, y1, x2, y2, x3, y3, x4, y4
.
local test script:
from ultralytics import YOLO
model = YOLO("yolov8n-cls.pt")
results = model.predict(source="ultralytics/assets/bus.jpg")
summary = results[0].summary()[0]
print(summary)
model = YOLO("yolov8n.pt")
results = model.predict(source="ultralytics/assets/bus.jpg")
summary = results[0].summary()[0]
print(summary)
model = YOLO("yolov8n-obb.pt")
results = model.predict(source="../datasets/dota8/images/train/P0861__1024__0___1648.jpg")
summary = results[0].summary()[0]
print(summary)
output:
image 1/1 /home/laughing/codes/ultralytics/ultralytics/assets/bus.jpg: 224x224 minibus 0.47, police_van 0.25, ambulance 0.05, recreational_vehicle 0.04, bullet_trai
n 0.02, 1.4ms
Speed: 0.8ms preprocess, 1.4ms inference, 0.0ms postprocess per image at shape (1, 3, 224, 224)
{'name': 'minibus', 'class': 654, 'confidence': 0.46673}
image 1/1 /home/laughing/codes/ultralytics/ultralytics/assets/bus.jpg: 640x480 4 persons, 1 bus, 1 stop sign, 47.7ms
Speed: 1.2ms preprocess, 47.7ms inference, 1.4ms postprocess per image at shape (1, 3, 640, 480)
{'name': 'bus', 'class': 5, 'confidence': 0.87327, 'box': {'x1': 22.84789, 'y1': 231.27481, 'x2': 804.99994, 'y2': 756.82684}}
image 1/1 /home/laughing/codes/datasets/dota8/images/train/P0861__1024__0___1648.jpg: 1024x1024 6.7ms
Speed: 2.2ms preprocess, 6.7ms inference, 3.1ms postprocess per image at shape (1, 3, 1024, 1024)
{'name': 'harbor', 'class': 7, 'confidence': 0.87786, 'box': {'x1': 326.19873, 'y1': 202.04541, 'x2': 441.58606, 'y2': 232.54843, 'x3': 500.82678, 'y3': 8.4515, 'x4
': 385.43945, 'y4': -22.05151}}
EDIT: forgot about the normalize
option, fixed in https://github.com/ultralytics/ultralytics/pull/11653/commits/b3070d5540d41f39bc710fc0ea4e3650ad197c06.
@Laughing-q nice work!! PR merged as ultralytics 8.2.10 :)
Found two bugs in OBB results and Classify dataloading in this PR:
π οΈ PR Summary
Made with β€οΈ by Ultralytics Actions
π Summary
Enhancements in testing flexibility and coverage for Ultralytics models π
π Key Changes
MODELS
constant: Streamlines model management by centralizing model names in a single location.test_predict_img
andtest_results
to iterate over all models, improving test coverage and maintainability.π― Purpose & Impact
π οΈ PR Summary
Made with β€οΈ by Ultralytics Actions
π Summary
Improved testing and model result formats in Ultralytics software.
π Key Changes
MODELS
set for dynamic testing based on available models.π― Purpose & Impact
These changes aim to streamline testing processes, improve code maintainability, and enhance the user experience by providing clearer insights into model outputs. π