From 1d6fd4c3cf6ccb33e4dc2372eecb470a1009bb8e Mon Sep 17 00:00:00 2001 From: Muhammad Rizwan Munawar Date: Sat, 26 Oct 2024 00:19:57 +0500 Subject: [PATCH] Update OBB predict examples with boats.jpg (#17052) Co-authored-by: UltralyticsAssistant Co-authored-by: Jan Knobloch <116908874+jk4e@users.noreply.github.com> Co-authored-by: Ultralytics Assistant <135830346+UltralyticsAssistant@users.noreply.github.com> --- docs/en/modes/predict.md | 2 +- docs/en/tasks/obb.md | 6 +++--- examples/tutorial.ipynb | 2 +- ultralytics/cfg/__init__.py | 4 +++- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/docs/en/modes/predict.md b/docs/en/modes/predict.md index a298294d59..4c69aa52d4 100644 --- a/docs/en/modes/predict.md +++ b/docs/en/modes/predict.md @@ -665,7 +665,7 @@ For more details see the [`Probs` class documentation](../reference/engine/resul model = YOLO("yolo11n-obb.pt") # Run inference on an image - results = model("bus.jpg") # results list + results = model("boats.jpg") # results list # View results for r in results: diff --git a/docs/en/tasks/obb.md b/docs/en/tasks/obb.md index 35e659ed47..621ffc783d 100644 --- a/docs/en/tasks/obb.md +++ b/docs/en/tasks/obb.md @@ -141,14 +141,14 @@ Use a trained YOLO11n-obb model to run predictions on images. model = YOLO("path/to/best.pt") # load a custom model # Predict with the model - results = model("https://ultralytics.com/images/bus.jpg") # predict on an image + results = model("https://ultralytics.com/images/boats.jpg") # predict on an image ``` === "CLI" ```bash - yolo obb predict model=yolo11n-obb.pt source='https://ultralytics.com/images/bus.jpg' # predict with official model - yolo obb predict model=path/to/best.pt source='https://ultralytics.com/images/bus.jpg' # predict with custom model + yolo obb predict model=yolo11n-obb.pt source='https://ultralytics.com/images/boats.jpg' # predict with official model + yolo obb predict model=path/to/best.pt source='https://ultralytics.com/images/boats.jpg' # predict with custom model ```

diff --git a/examples/tutorial.ipynb b/examples/tutorial.ipynb index 98c659b864..75dd455e9a 100644 --- a/examples/tutorial.ipynb +++ b/examples/tutorial.ipynb @@ -583,7 +583,7 @@ "\n", "model = YOLO('yolo11n-obb.pt') # load a pretrained YOLO OBB model\n", "model.train(data='dota8.yaml', epochs=3) # train the model\n", - "model('https://ultralytics.com/images/bus.jpg') # predict on an image" + "model('https://ultralytics.com/images/boats.jpg') # predict on an image" ], "metadata": { "id": "IJNKClOOB5YS" diff --git a/ultralytics/cfg/__init__.py b/ultralytics/cfg/__init__.py index 7c36a3b918..0af93a37d3 100644 --- a/ultralytics/cfg/__init__.py +++ b/ultralytics/cfg/__init__.py @@ -809,7 +809,9 @@ def entrypoint(debug=""): # Mode if mode in {"predict", "track"} and "source" not in overrides: - overrides["source"] = DEFAULT_CFG.source or ASSETS + overrides["source"] = ( + "https://ultralytics.com/images/boats.jpg" if task == "obb" else DEFAULT_CFG.source or ASSETS + ) LOGGER.warning(f"WARNING ⚠️ 'source' argument is missing. Using default 'source={overrides['source']}'.") elif mode in {"train", "val"}: if "data" not in overrides and "resume" not in overrides: