Update to lowercase MkDocs admonitions (#15990)
Co-authored-by: UltralyticsAssistant <web@ultralytics.com> Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
parent
ce24c7273e
commit
c2b647a768
133 changed files with 529 additions and 521 deletions
|
|
@ -50,7 +50,7 @@ YOLOv8's predict mode is designed to be robust and versatile, featuring:
|
|||
|
||||
Ultralytics YOLO models return either a Python list of `Results` objects, or a memory-efficient Python generator of `Results` objects when `stream=True` is passed to the model during inference:
|
||||
|
||||
!!! Example "Predict"
|
||||
!!! example "Predict"
|
||||
|
||||
=== "Return a list with `stream=False`"
|
||||
|
||||
|
|
@ -100,7 +100,7 @@ Ultralytics YOLO models return either a Python list of `Results` objects, or a m
|
|||
|
||||
YOLOv8 can process different types of input sources for inference, as shown in the table below. The sources include static images, video streams, and various data formats. The table also indicates whether each source can be used in streaming mode with the argument `stream=True` ✅. Streaming mode is beneficial for processing videos or live streams as it creates a generator of results instead of loading all frames into memory.
|
||||
|
||||
!!! Tip "Tip"
|
||||
!!! tip "Tip"
|
||||
|
||||
Use `stream=True` for processing long videos or large datasets to efficiently manage memory. When `stream=False`, the results for all frames or data points are stored in memory, which can quickly add up and cause out-of-memory errors for large inputs. In contrast, `stream=True` utilizes a generator, which only keeps the results of the current frame or data point in memory, significantly reducing memory consumption and preventing out-of-memory issues.
|
||||
|
||||
|
|
@ -123,7 +123,7 @@ YOLOv8 can process different types of input sources for inference, as shown in t
|
|||
|
||||
Below are code examples for using each source type:
|
||||
|
||||
!!! Example "Prediction sources"
|
||||
!!! example "Prediction sources"
|
||||
|
||||
=== "image"
|
||||
|
||||
|
|
@ -351,7 +351,7 @@ Below are code examples for using each source type:
|
|||
|
||||
`model.predict()` accepts multiple arguments that can be passed at inference time to override defaults:
|
||||
|
||||
!!! Example
|
||||
!!! example
|
||||
|
||||
```python
|
||||
from ultralytics import YOLO
|
||||
|
|
@ -442,7 +442,7 @@ The below table contains valid Ultralytics video formats.
|
|||
|
||||
All Ultralytics `predict()` calls will return a list of `Results` objects:
|
||||
|
||||
!!! Example "Results"
|
||||
!!! example "Results"
|
||||
|
||||
```python
|
||||
from ultralytics import YOLO
|
||||
|
|
@ -494,7 +494,7 @@ For more details see the [`Results` class documentation](../reference/engine/res
|
|||
|
||||
`Boxes` object can be used to index, manipulate, and convert bounding boxes to different formats.
|
||||
|
||||
!!! Example "Boxes"
|
||||
!!! example "Boxes"
|
||||
|
||||
```python
|
||||
from ultralytics import YOLO
|
||||
|
|
@ -532,7 +532,7 @@ For more details see the [`Boxes` class documentation](../reference/engine/resul
|
|||
|
||||
`Masks` object can be used index, manipulate and convert masks to segments.
|
||||
|
||||
!!! Example "Masks"
|
||||
!!! example "Masks"
|
||||
|
||||
```python
|
||||
from ultralytics import YOLO
|
||||
|
|
@ -565,7 +565,7 @@ For more details see the [`Masks` class documentation](../reference/engine/resul
|
|||
|
||||
`Keypoints` object can be used index, manipulate and normalize coordinates.
|
||||
|
||||
!!! Example "Keypoints"
|
||||
!!! example "Keypoints"
|
||||
|
||||
```python
|
||||
from ultralytics import YOLO
|
||||
|
|
@ -599,7 +599,7 @@ For more details see the [`Keypoints` class documentation](../reference/engine/r
|
|||
|
||||
`Probs` object can be used index, get `top1` and `top5` indices and scores of classification.
|
||||
|
||||
!!! Example "Probs"
|
||||
!!! example "Probs"
|
||||
|
||||
```python
|
||||
from ultralytics import YOLO
|
||||
|
|
@ -634,7 +634,7 @@ For more details see the [`Probs` class documentation](../reference/engine/resul
|
|||
|
||||
`OBB` object can be used to index, manipulate, and convert oriented bounding boxes to different formats.
|
||||
|
||||
!!! Example "OBB"
|
||||
!!! example "OBB"
|
||||
|
||||
```python
|
||||
from ultralytics import YOLO
|
||||
|
|
@ -672,7 +672,7 @@ For more details see the [`OBB` class documentation](../reference/engine/results
|
|||
|
||||
The `plot()` method in `Results` objects facilitates visualization of predictions by overlaying detected objects (such as bounding boxes, masks, keypoints, and probabilities) onto the original image. This method returns the annotated image as a NumPy array, allowing for easy display or saving.
|
||||
|
||||
!!! Example "Plotting"
|
||||
!!! example "Plotting"
|
||||
|
||||
```python
|
||||
from PIL import Image
|
||||
|
|
@ -728,7 +728,7 @@ Ensuring thread safety during inference is crucial when you are running multiple
|
|||
|
||||
When using YOLO models in a multi-threaded application, it's important to instantiate separate model objects for each thread or employ thread-local storage to prevent conflicts:
|
||||
|
||||
!!! Example "Thread-Safe Inference"
|
||||
!!! example "Thread-Safe Inference"
|
||||
|
||||
Instantiate a single model inside each thread for thread-safe inference:
|
||||
```python
|
||||
|
|
@ -755,7 +755,7 @@ For an in-depth look at thread-safe inference with YOLO models and step-by-step
|
|||
|
||||
Here's a Python script using OpenCV (`cv2`) and YOLOv8 to run inference on video frames. This script assumes you have already installed the necessary packages (`opencv-python` and `ultralytics`).
|
||||
|
||||
!!! Example "Streaming for-loop"
|
||||
!!! example "Streaming for-loop"
|
||||
|
||||
```python
|
||||
import cv2
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue