Add bash codeblock formatting (#19804)

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
This commit is contained in:
Glenn Jocher 2025-03-20 20:24:06 +01:00 committed by GitHub
parent 88b80e02f3
commit cf33b64ad4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
89 changed files with 459 additions and 461 deletions

View File

@ -99,23 +99,26 @@ The Ultralytics COCO128 dataset is a compact subset containing the first 128 ima
To train a YOLO11 model on the COCO128 dataset, you can use either Python or CLI commands. Here's how:
=== "Python"
!!! example "Train Example"
````python
from ultralytics import YOLO
=== "Python"
# Load a pretrained model
model = YOLO("yolo11n.pt")
```python
from ultralytics import YOLO
# Train the model
results = model.train(data="coco128.yaml", epochs=100, imgsz=640)
```
# Load a pretrained model
model = YOLO("yolo11n.pt")
=== "CLI"
# Train the model
results = model.train(data="coco128.yaml", epochs=100, imgsz=640)
```
`bash
yolo detect train data=coco128.yaml model=yolo11n.pt epochs=100 imgsz=640
`
=== "CLI"
```bash
yolo detect train data=coco128.yaml model=yolo11n.pt epochs=100 imgsz=640
```
For more training options and parameters, refer to the [Training](../../modes/train.md) documentation.
@ -149,4 +152,3 @@ While COCO128 is primarily designed for object detection, the dataset's annotati
- **Transfer learning**: As a starting point for fine-tuning models for custom tasks
For specialized tasks like [segmentation](../../tasks/segment.md), consider using purpose-built variants like [COCO8-seg](../segment/coco8-seg.md) which include the appropriate annotations.
````

View File

@ -102,10 +102,10 @@ If you use the SKU-110k dataset in your research or development work, please cit
```bibtex
@inproceedings{goldman2019dense,
author = {Eran Goldman and Roei Herzig and Aviv Eisenschtat and Jacob Goldberger and Tal Hassner},
title = {Precise Detection in Densely Packed Scenes},
booktitle = {Proc. Conf. Comput. Vision Pattern Recognition (CVPR)},
year = {2019}
author = {Eran Goldman and Roei Herzig and Aviv Eisenschtat and Jacob Goldberger and Tal Hassner},
title = {Precise Detection in Densely Packed Scenes},
booktitle = {Proc. Conf. Comput. Vision Pattern Recognition (CVPR)},
year = {2019}
}
```
@ -179,10 +179,10 @@ If you use the SKU-110k dataset in your research or development work, please cit
```bibtex
@inproceedings{goldman2019dense,
author = {Eran Goldman and Roei Herzig and Aviv Eisenschtat and Jacob Goldberger and Tal Hassner},
title = {Precise Detection in Densely Packed Scenes},
booktitle = {Proc. Conf. Comput. Vision Pattern Recognition (CVPR)},
year = {2019}
author = {Eran Goldman and Roei Herzig and Aviv Eisenschtat and Jacob Goldberger and Tal Hassner},
title = {Precise Detection in Densely Packed Scenes},
booktitle = {Proc. Conf. Comput. Vision Pattern Recognition (CVPR)},
year = {2019}
}
```

View File

@ -38,10 +38,10 @@ This guide provides a comprehensive overview of three fundamental types of [data
=== "CLI"
```bash
yolo solutions analytics show=True
yolo solutions analytics show=True
# Pass the source
yolo solutions analytics source="path/to/video/file.mp4"
yolo solutions analytics source="path/to/video.mp4"
# Generate the pie chart
yolo solutions analytics analytics_type="pie" show=True
@ -60,7 +60,7 @@ This guide provides a comprehensive overview of three fundamental types of [data
from ultralytics import solutions
cap = cv2.VideoCapture("Path/to/video/file.mp4")
cap = cv2.VideoCapture("path/to/video.mp4")
assert cap.isOpened(), "Error reading video file"
# Video writer
@ -138,7 +138,7 @@ import cv2
from ultralytics import solutions
cap = cv2.VideoCapture("Path/to/video/file.mp4")
cap = cv2.VideoCapture("path/to/video.mp4")
assert cap.isOpened(), "Error reading video file"
w, h, fps = (int(cap.get(x)) for x in (cv2.CAP_PROP_FRAME_WIDTH, cv2.CAP_PROP_FRAME_HEIGHT, cv2.CAP_PROP_FPS))
@ -188,7 +188,7 @@ import cv2
from ultralytics import solutions
cap = cv2.VideoCapture("Path/to/video/file.mp4")
cap = cv2.VideoCapture("path/to/video.mp4")
assert cap.isOpened(), "Error reading video file"
w, h, fps = (int(cap.get(x)) for x in (cv2.CAP_PROP_FRAME_WIDTH, cv2.CAP_PROP_FRAME_HEIGHT, cv2.CAP_PROP_FPS))
@ -238,7 +238,7 @@ import cv2
from ultralytics import solutions
cap = cv2.VideoCapture("Path/to/video/file.mp4")
cap = cv2.VideoCapture("path/to/video.mp4")
assert cap.isOpened(), "Error reading video file"
w, h, fps = (int(cap.get(x)) for x in (cv2.CAP_PROP_FRAME_WIDTH, cv2.CAP_PROP_FRAME_HEIGHT, cv2.CAP_PROP_FPS))
@ -283,7 +283,7 @@ import cv2
from ultralytics import solutions
cap = cv2.VideoCapture("Path/to/video/file.mp4")
cap = cv2.VideoCapture("path/to/video.mp4")
assert cap.isOpened(), "Error reading video file"
w, h, fps = (int(cap.get(x)) for x in (cv2.CAP_PROP_FRAME_WIDTH, cv2.CAP_PROP_FRAME_HEIGHT, cv2.CAP_PROP_FPS))

View File

@ -61,7 +61,7 @@ Install the required dependencies:
cd ultralytics
pip install -r requirements.txt
pip install ultralytics
pip install onnx>=1.12.0
pip install onnx
```
### Perform YOLO11 tasks
@ -110,7 +110,7 @@ source activate yolo11env
cd ultralytics
pip install -r requirements.txt
pip install ultralytics
pip install onnx>=1.12.0
pip install onnx
```
Note that we need to use the `source activate yolo11env` for all the %%bash cells, to make sure that the %%bash cell uses environment we want.
@ -166,7 +166,7 @@ Running YOLO11 on AzureML for model training involves several steps:
conda create --name yolo11env -y python=3.12
conda activate yolo11env
conda install pip -y
pip install ultralytics onnx>=1.12.0
pip install ultralytics onnx
```
3. **Run YOLO11 Tasks**: Use the Ultralytics CLI to train your model:

View File

@ -98,8 +98,8 @@ Run the image:
```bash
# Run the Ultralytics image in a container with GPU support
sudo docker run -it --ipc=host --gpus all $t # all GPUs
sudo docker run -it --ipc=host --gpus '"device=2,3"' $t # specify GPUs
sudo docker run -it --ipc=host --gpus all $t # all GPUs
sudo docker run -it --ipc=host --gpus '"device=2,3"' $t # specify GPUs
```
## Speeding Up Installation with Libmamba

View File

@ -103,7 +103,7 @@ To use the Edge TPU, you need to convert your model into a compatible format. It
=== "CLI"
```bash
yolo export model=path/to/model.pt format=edgetpu # Export an official model or custom model
yolo export model=path/to/model.pt format=edgetpu # Export an official model or custom model
```
The exported model will be saved in the `<model_name>_saved_model/` folder with the name `<model_name>_full_integer_quant_edgetpu.tflite`. It is important that your model ends with the suffix `_edgetpu.tflite`, otherwise ultralytics doesn't know that you're using an Edge TPU model.
@ -143,7 +143,7 @@ Now you can run inference using the following code:
=== "CLI"
```bash
yolo predict model=path/to/<model_name>_full_integer_quant_edgetpu.tflite source=path/to/source.png # Load an official model or custom model
yolo predict model=path/to/MODEL_NAME_full_integer_quant_edgetpu.tflite source=path/to/source.png # Load an official model or custom model
```
Find comprehensive information on the [Predict](../modes/predict.md) page for full prediction mode details.
@ -238,7 +238,7 @@ Yes, you can export your Ultralytics YOLO11 model to be compatible with the Cora
=== "CLI"
```bash
yolo export model=path/to/model.pt format=edgetpu # Export an official model or custom model
yolo export model=path/to/model.pt format=edgetpu # Export an official model or custom model
```
For more information, refer to the [Export Mode](../modes/export.md) documentation.
@ -280,7 +280,7 @@ After exporting your YOLO11 model to an Edge TPU-compatible format, you can run
=== "CLI"
```bash
yolo predict model=path/to/edgetpu_model.tflite source=path/to/source.png # Load an official model or custom model
yolo predict model=path/to/edgetpu_model.tflite source=path/to/source.png # Load an official model or custom model
```
Comprehensive details on full prediction mode features can be found on the [Predict Page](../modes/predict.md).

View File

@ -245,8 +245,8 @@ If you want to use INT8 precision for inference, you need to follow the steps be
5. Run the following to select 1000 random images from COCO dataset to run calibration
```bash
for jpg in $(ls -1 val2017/*.jpg | sort -R | head -1000); do \
cp ${jpg} calibration/; \
for jpg in $(ls -1 val2017/*.jpg | sort -R | head -1000); do
cp ${jpg} calibration/
done
```
@ -319,10 +319,10 @@ To set up multiple streams under a single deepstream application, you can do the
[source0]
enable=1
type=3
uri=<path_to_video>
uri=<path_to_video>
uri=<path_to_video>
uri=<path_to_video>
uri=path/to/video1.jpg
uri=path/to/video2.jpg
uri=path/to/video3.jpg
uri=path/to/video4.jpg
num-sources=4
```

View File

@ -55,7 +55,7 @@ Measuring the gap between two objects is known as distance calculation within a
from ultralytics import solutions
cap = cv2.VideoCapture("Path/to/video/file.mp4")
cap = cv2.VideoCapture("path/to/video.mp4")
assert cap.isOpened(), "Error reading video file"
# Video writer

View File

@ -175,9 +175,9 @@ Setup and configuration of an X11 or Wayland display server is outside the scope
```bash
xhost +local:docker && docker run -e DISPLAY=$DISPLAY \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-v ~/.Xauthority:/root/.Xauthority \
-it --ipc=host $t
-v /tmp/.X11-unix:/tmp/.X11-unix \
-v ~/.Xauthority:/root/.Xauthority \
-it --ipc=host $t
```
This command sets the `DISPLAY` environment variable to the host's display, mounts the X11 socket, and maps the `.Xauthority` file to the container. The `xhost +local:docker` command allows the Docker container to access the X11 server.
@ -189,8 +189,8 @@ Setup and configuration of an X11 or Wayland display server is outside the scope
```bash
xhost +local:docker && docker run -e DISPLAY=$DISPLAY \
-v $XDG_RUNTIME_DIR/$WAYLAND_DISPLAY:/tmp/$WAYLAND_DISPLAY \
--net=host -it --ipc=host $t
-v $XDG_RUNTIME_DIR/$WAYLAND_DISPLAY:/tmp/$WAYLAND_DISPLAY \
--net=host -it --ipc=host $t
```
This command sets the `DISPLAY` environment variable to the host's display, mounts the Wayland socket, and allows the Docker container to access the Wayland server.
@ -257,17 +257,17 @@ To visualize YOLO prediction results with a GUI in a Docker container, you need
```bash
xhost +local:docker && docker run -e DISPLAY=$DISPLAY \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-v ~/.Xauthority:/root/.Xauthority \
-it --ipc=host ultralytics/ultralytics:latest
-v /tmp/.X11-unix:/tmp/.X11-unix \
-v ~/.Xauthority:/root/.Xauthority \
-it --ipc=host ultralytics/ultralytics:latest
```
For systems running Wayland, use:
```bash
xhost +local:docker && docker run -e DISPLAY=$DISPLAY \
-v $XDG_RUNTIME_DIR/$WAYLAND_DISPLAY:/tmp/$WAYLAND_DISPLAY \
--net=host -it --ipc=host ultralytics/ultralytics:latest
-v $XDG_RUNTIME_DIR/$WAYLAND_DISPLAY:/tmp/$WAYLAND_DISPLAY \
--net=host -it --ipc=host ultralytics/ultralytics:latest
```
More information can be found in the [Run graphical user interface (GUI) applications in a Docker Container](#run-graphical-user-interface-gui-applications-in-a-docker-container) section.

View File

@ -45,13 +45,13 @@ A heatmap generated with [Ultralytics YOLO11](https://github.com/ultralytics/ult
yolo solutions heatmap show=True
# Pass a source video
yolo solutions heatmap source="path/to/video/file.mp4"
yolo solutions heatmap source="path/to/video.mp4"
# Pass a custom colormap
yolo solutions heatmap colormap=cv2.COLORMAP_INFERNO
# Heatmaps + object counting
yolo solutions heatmap region=[(20, 400), (1080, 400), (1080, 360), (20, 360)]
yolo solutions heatmap region="[(20, 400), (1080, 400), (1080, 360), (20, 360)]"
```
=== "Python"
@ -61,7 +61,7 @@ A heatmap generated with [Ultralytics YOLO11](https://github.com/ultralytics/ult
from ultralytics import solutions
cap = cv2.VideoCapture("Path/to/video/file.mp4")
cap = cv2.VideoCapture("path/to/video.mp4")
assert cap.isOpened(), "Error reading video file"
# Video writer
@ -175,7 +175,7 @@ import cv2
from ultralytics import solutions
cap = cv2.VideoCapture("path/to/video/file.mp4")
cap = cv2.VideoCapture("path/to/video.mp4")
heatmap = solutions.Heatmap(colormap=cv2.COLORMAP_PARULA, show=True, model="yolo11n.pt")
while cap.isOpened():
@ -202,7 +202,7 @@ import cv2
from ultralytics import solutions
cap = cv2.VideoCapture("path/to/video/file.mp4")
cap = cv2.VideoCapture("path/to/video.mp4")
heatmap = solutions.Heatmap(show=True, model="yolo11n.pt", classes=[0, 2])
while cap.isOpened():

View File

@ -45,7 +45,7 @@ There are two types of instance segmentation tracking available in the Ultralyti
yolo solutions isegment show=True
# Pass a source video
yolo solutions isegment source="path/to/video/file.mp4"
yolo solutions isegment source="path/to/video.mp4"
# Monitor the specific classes
yolo solutions isegment classes=[0, 5]
@ -58,7 +58,7 @@ There are two types of instance segmentation tracking available in the Ultralyti
from ultralytics import solutions
cap = cv2.VideoCapture("Path/to/video/file.mp4")
cap = cv2.VideoCapture("path/to/video.mp4")
assert cap.isOpened(), "Error reading video file"
# Video writer
@ -143,7 +143,7 @@ import cv2
from ultralytics import solutions
cap = cv2.VideoCapture("Path/to/video/file.mp4")
cap = cv2.VideoCapture("path/to/video.mp4")
assert cap.isOpened(), "Error reading video file"
# Video writer

View File

@ -273,7 +273,7 @@ The YOLO11n model in PyTorch format is converted to TensorRT to run inference wi
```bash
# Export a YOLO11n PyTorch model to TensorRT format
yolo export model=yolo11n.pt format=engine # creates 'yolo11n.engine'
yolo export model=yolo11n.pt format=engine # creates 'yolo11n.engine'
# Run inference with the exported model
yolo predict model=yolo11n.engine source='https://ultralytics.com/images/bus.jpg'
@ -322,7 +322,7 @@ The following Jetson devices are equipped with DLA hardware:
```bash
# Export a YOLO11n PyTorch model to TensorRT format with DLA enabled (only works with FP16 or INT8)
# Once DLA core number is specified at export, it will use the same core at inference
yolo export model=yolo11n.pt format=engine device="dla:0" half=True # dla:0 or dla:1 corresponds to the DLA cores
yolo export model=yolo11n.pt format=engine device="dla:0" half=True # dla:0 or dla:1 corresponds to the DLA cores
# Run inference with the exported model on the DLA
yolo predict model=yolo11n.engine source='https://ultralytics.com/images/bus.jpg'

View File

@ -38,7 +38,7 @@ Object blurring with [Ultralytics YOLO11](https://github.com/ultralytics/ultraly
yolo solutions blur show=True
# Pass a source video
yolo solutions blur source="path/to/video/file.mp4"
yolo solutions blur source="path/to/video.mp4"
# Blur the specific classes
yolo solutions blur classes=[0, 5]
@ -51,7 +51,7 @@ Object blurring with [Ultralytics YOLO11](https://github.com/ultralytics/ultraly
from ultralytics import solutions
cap = cv2.VideoCapture("Path/to/video/file.mp4")
cap = cv2.VideoCapture("path/to/video.mp4")
assert cap.isOpened(), "Error reading video file"
# Video writer
@ -136,7 +136,7 @@ import cv2
from ultralytics import solutions
cap = cv2.VideoCapture("Path/to/video/file.mp4")
cap = cv2.VideoCapture("path/to/video.mp4")
assert cap.isOpened(), "Error reading video file"
w, h, fps = (int(cap.get(x)) for x in (cv2.CAP_PROP_FRAME_WIDTH, cv2.CAP_PROP_FRAME_HEIGHT, cv2.CAP_PROP_FPS))

View File

@ -45,10 +45,10 @@ Object counting with [Ultralytics YOLO11](https://github.com/ultralytics/ultraly
yolo solutions count show=True
# Pass a source video
yolo solutions count source="path/to/video/file.mp4"
yolo solutions count source="path/to/video.mp4"
# Pass region coordinates
yolo solutions count region=[(20, 400), (1080, 400), (1080, 360), (20, 360)]
yolo solutions count region="[(20, 400), (1080, 400), (1080, 360), (20, 360)]"
```
=== "Python"
@ -58,7 +58,7 @@ Object counting with [Ultralytics YOLO11](https://github.com/ultralytics/ultraly
from ultralytics import solutions
cap = cv2.VideoCapture("path/to/video/file.mp4")
cap = cv2.VideoCapture("path/to/video.mp4")
assert cap.isOpened(), "Error reading video file"
# region_points = [(20, 400), (1080, 400)] # line counting

View File

@ -43,7 +43,7 @@ Object cropping with [Ultralytics YOLO11](https://github.com/ultralytics/ultraly
yolo solutions crop show=True
# Pass a source video
yolo solutions crop source="path/to/video/file.mp4"
yolo solutions crop source="path/to/video.mp4"
# Crop specific classes
yolo solutions crop classes=[0, 2]
@ -56,7 +56,7 @@ Object cropping with [Ultralytics YOLO11](https://github.com/ultralytics/ultraly
from ultralytics import solutions
cap = cv2.VideoCapture("Path/to/video/file.mp4")
cap = cv2.VideoCapture("path/to/video.mp4")
assert cap.isOpened(), "Error reading video file"
# Initialize object cropper object

View File

@ -80,7 +80,7 @@ Parking management with [Ultralytics YOLO11](https://github.com/ultralytics/ultr
from ultralytics import solutions
# Video capture
cap = cv2.VideoCapture("Path/to/video/file.mp4")
cap = cv2.VideoCapture("path/to/video.mp4")
assert cap.isOpened(), "Error reading video file"
# Video writer

View File

@ -44,10 +44,10 @@ Queue management using [Ultralytics YOLO11](https://github.com/ultralytics/ultra
yolo solutions queue show=True
# Pass a source video
yolo solutions queue source="path/to/video/file.mp4"
yolo solutions queue source="path/to/video.mp4"
# Pass queue coordinates
yolo solutions queue region=[(20, 400), (1080, 400), (1080, 360), (20, 360)]
yolo solutions queue region="[(20, 400), (1080, 400), (1080, 360), (20, 360)]"
```
=== "Python"
@ -57,7 +57,7 @@ Queue management using [Ultralytics YOLO11](https://github.com/ultralytics/ultra
from ultralytics import solutions
cap = cv2.VideoCapture("Path/to/video/file.mp4")
cap = cv2.VideoCapture("path/to/video.mp4")
assert cap.isOpened(), "Error reading video file"
# Video writer

View File

@ -125,7 +125,7 @@ The YOLO11n model in PyTorch format is converted to NCNN to run inference with t
```bash
# Export a YOLO11n PyTorch model to NCNN format
yolo export model=yolo11n.pt format=ncnn # creates 'yolo11n_ncnn_model'
yolo export model=yolo11n.pt format=ncnn # creates 'yolo11n_ncnn_model'
# Run inference with the exported model
yolo predict model='yolo11n_ncnn_model' source='https://ultralytics.com/images/bus.jpg'
@ -400,7 +400,7 @@ You can convert a PyTorch YOLO11 model to NCNN format using either Python or CLI
```bash
# Export a YOLO11n PyTorch model to NCNN format
yolo export model=yolo11n.pt format=ncnn # creates 'yolo11n_ncnn_model'
yolo export model=yolo11n.pt format=ncnn # creates 'yolo11n_ncnn_model'
# Run inference with the exported model
yolo predict model='yolo11n_ncnn_model' source='https://ultralytics.com/images/bus.jpg'

View File

@ -43,7 +43,7 @@ keywords: object counting, regions, YOLO11, computer vision, Ultralytics, effici
from ultralytics import solutions
cap = cv2.VideoCapture("Path/to/video/file.mp4")
cap = cv2.VideoCapture("path/to/video.mp4")
assert cap.isOpened(), "Error reading video file"
# Pass region as list

View File

@ -40,7 +40,7 @@ The Security Alarm System Project utilizing Ultralytics YOLO11 integrates advanc
from ultralytics import solutions
cap = cv2.VideoCapture("Path/to/video/file.mp4")
cap = cv2.VideoCapture("path/to/video.mp4")
assert cap.isOpened(), "Error reading video file"
# Video writer

View File

@ -51,10 +51,10 @@ keywords: Ultralytics YOLO11, speed estimation, object tracking, computer vision
yolo solutions speed show=True
# Pass a source video
yolo solutions speed source="path/to/video/file.mp4"
yolo solutions speed source="path/to/video.mp4"
# Pass region coordinates
yolo solutions speed region=[(20, 400), (1080, 400), (1080, 360), (20, 360)]
yolo solutions speed region="[(20, 400), (1080, 400), (1080, 360), (20, 360)]"
```
=== "Python"
@ -64,7 +64,7 @@ keywords: Ultralytics YOLO11, speed estimation, object tracking, computer vision
from ultralytics import solutions
cap = cv2.VideoCapture("Path/to/video/file.mp4")
cap = cv2.VideoCapture("path/to/video.mp4")
assert cap.isOpened(), "Error reading video file"
# Video writer
@ -132,7 +132,7 @@ import cv2
from ultralytics import solutions
cap = cv2.VideoCapture("path/to/video/file.mp4")
cap = cv2.VideoCapture("path/to/video.mp4")
w, h, fps = (int(cap.get(x)) for x in (cv2.CAP_PROP_FRAME_WIDTH, cv2.CAP_PROP_FRAME_HEIGHT, cv2.CAP_PROP_FPS))
video_writer = cv2.VideoWriter("speed_estimation.avi", cv2.VideoWriter_fourcc(*"mp4v"), fps, (w, h))

View File

@ -59,7 +59,7 @@ Streamlit makes it simple to build and deploy interactive web applications. Comb
inf.inference()
### Make sure to run the file using command `streamlit run <file-name.py>`
# Make sure to run the file using command `streamlit run path/to/file.py`
```
This will launch the Streamlit application in your default web browser. You will see the main title, subtitle, and the sidebar with configuration options. Select your desired YOLO11 model, set the confidence and [NMS thresholds](https://www.ultralytics.com/glossary/non-maximum-suppression-nms), and click the "Start" button to begin the real-time object detection.
@ -79,7 +79,7 @@ You can optionally supply a specific model in Python:
inf.inference()
### Make sure to run the file using command `streamlit run <file-name.py>`
# Make sure to run the file using command `streamlit run path/to/file.py`
```
## How It Works
@ -138,7 +138,7 @@ Then, you can create a basic Streamlit application to run live inference:
inf.inference()
### Make sure to run the file using command `streamlit run <file-name.py>`
# Make sure to run the file using command `streamlit run path/to/file.py`
```
=== "CLI"
@ -164,7 +164,7 @@ Discover more about these advantages [here](#advantages-of-live-inference).
After coding your Streamlit application integrating Ultralytics YOLO11, you can deploy it by running:
```bash
streamlit run <file-name.py>
streamlit run path/to/file.py
```
This command will launch the application in your default web browser, enabling you to select YOLO11 models, set confidence and NMS thresholds, and start real-time object detection with a simple click. For a detailed guide, refer to the [Streamlit Application Code](#streamlit-application-code) section.

View File

@ -46,10 +46,10 @@ TrackZone specializes in monitoring objects within designated areas of a frame i
yolo solutions trackzone show=True
# Pass a source video
yolo solutions trackzone show=True source="path/to/video/file.mp4"
yolo solutions trackzone show=True source="path/to/video.mp4"
# Pass region coordinates
yolo solutions trackzone show=True region=[(150, 150), (1130, 150), (1130, 570), (150, 570)]
yolo solutions trackzone show=True region="[(150, 150), (1130, 150), (1130, 570), (150, 570)]"
```
=== "Python"
@ -59,7 +59,7 @@ TrackZone specializes in monitoring objects within designated areas of a frame i
from ultralytics import solutions
cap = cv2.VideoCapture("path/to/video/file.mp4")
cap = cv2.VideoCapture("path/to/video.mp4")
assert cap.isOpened(), "Error reading video file"
# Define region points
@ -119,7 +119,7 @@ Moreover, the following visualization options are available:
Tracking objects in a defined area or zone of a video frame is straightforward with Ultralytics YOLO11. Simply use the command provided below to initiate tracking. This approach ensures efficient analysis and accurate results, making it ideal for applications like surveillance, crowd management, or any scenario requiring zonal tracking.
```bash
yolo solutions trackzone source="path/to/video/file.mp4" show=True
yolo solutions trackzone source="path/to/video.mp4" show=True
```
### How can I use TrackZone in Python with Ultralytics YOLO11?
@ -131,7 +131,7 @@ import cv2
from ultralytics import solutions
cap = cv2.VideoCapture("path/to/video/file.mp4")
cap = cv2.VideoCapture("path/to/video.mp4")
assert cap.isOpened(), "Error reading video file"
w, h, fps = (int(cap.get(x)) for x in (cv2.CAP_PROP_FRAME_WIDTH, cv2.CAP_PROP_FRAME_HEIGHT, cv2.CAP_PROP_FPS))

View File

@ -23,7 +23,7 @@ keywords: VisionEye, YOLO11, Ultralytics, object mapping, object tracking, dista
yolo solutions visioneye show=True
# Pass a source video
yolo solutions visioneye source="path/to/video/file.mp4"
yolo solutions visioneye source="path/to/video.mp4"
# Monitor the specific classes
yolo solutions visioneye classes=[0, 5]
@ -36,7 +36,7 @@ keywords: VisionEye, YOLO11, Ultralytics, object mapping, object tracking, dista
from ultralytics import solutions
cap = cv2.VideoCapture("path/to/video/file.mp4")
cap = cv2.VideoCapture("path/to/video.mp4")
assert cap.isOpened(), "Error reading video file"
# Video writer
@ -127,7 +127,7 @@ import cv2
from ultralytics import solutions
cap = cv2.VideoCapture("path/to/video/file.mp4")
cap = cv2.VideoCapture("path/to/video.mp4")
assert cap.isOpened(), "Error reading video file"
# Video writer

View File

@ -45,7 +45,7 @@ Monitoring workouts through pose estimation with [Ultralytics YOLO11](https://gi
yolo solutions workout show=True
# Pass a source video
yolo solutions workout source="path/to/video/file.mp4"
yolo solutions workout source="path/to/video.mp4"
# Use keypoints for pushups
yolo solutions workout kpts=[6, 8, 10]
@ -58,7 +58,7 @@ Monitoring workouts through pose estimation with [Ultralytics YOLO11](https://gi
from ultralytics import solutions
cap = cv2.VideoCapture("path/to/video/file.mp4")
cap = cv2.VideoCapture("path/to/video.mp4")
assert cap.isOpened(), "Error reading video file"
# Video writer
@ -124,7 +124,7 @@ import cv2
from ultralytics import solutions
cap = cv2.VideoCapture("path/to/video/file.mp4")
cap = cv2.VideoCapture("path/to/video.mp4")
assert cap.isOpened(), "Error reading video file"
w, h, fps = (int(cap.get(x)) for x in (cv2.CAP_PROP_FRAME_WIDTH, cv2.CAP_PROP_FRAME_HEIGHT, cv2.CAP_PROP_FPS))
@ -187,7 +187,7 @@ import cv2
from ultralytics import solutions
cap = cv2.VideoCapture("path/to/video/file.mp4")
cap = cv2.VideoCapture("path/to/video.mp4")
assert cap.isOpened(), "Error reading video file"
w, h, fps = (int(cap.get(x)) for x in (cv2.CAP_PROP_FRAME_WIDTH, cv2.CAP_PROP_FRAME_HEIGHT, cv2.CAP_PROP_FPS))

View File

@ -141,12 +141,12 @@ The [Ultralytics HUB](https://www.ultralytics.com/hub) Inference API returns a J
```bash
curl -X POST "https://predict.ultralytics.com" \
-H "x-api-key: API_KEY" \
-F "model=https://hub.ultralytics.com/models/MODEL_ID" \
-F "file=@/path/to/image.jpg" \
-F "imgsz=640" \
-F "conf=0.25" \
-F "iou=0.45"
-H "x-api-key: API_KEY" \
-F "model=https://hub.ultralytics.com/models/MODEL_ID" \
-F "file=@/path/to/image.jpg" \
-F "imgsz=640" \
-F "conf=0.25" \
-F "iou=0.45"
```
=== "Python"
@ -222,12 +222,12 @@ The [Ultralytics HUB](https://www.ultralytics.com/hub) Inference API returns a J
```bash
curl -X POST "https://predict.ultralytics.com" \
-H "x-api-key: API_KEY" \
-F "model=https://hub.ultralytics.com/models/MODEL_ID" \
-F "file=@/path/to/image.jpg" \
-F "imgsz=640" \
-F "conf=0.25" \
-F "iou=0.45"
-H "x-api-key: API_KEY" \
-F "model=https://hub.ultralytics.com/models/MODEL_ID" \
-F "file=@/path/to/image.jpg" \
-F "imgsz=640" \
-F "conf=0.25" \
-F "iou=0.45"
```
=== "Python"
@ -309,12 +309,12 @@ The [Ultralytics HUB](https://www.ultralytics.com/hub) Inference API returns a J
```bash
curl -X POST "https://predict.ultralytics.com" \
-H "x-api-key: API_KEY" \
-F "model=https://hub.ultralytics.com/models/MODEL_ID" \
-F "file=@/path/to/image.jpg" \
-F "imgsz=640" \
-F "conf=0.25" \
-F "iou=0.45"
-H "x-api-key: API_KEY" \
-F "model=https://hub.ultralytics.com/models/MODEL_ID" \
-F "file=@/path/to/image.jpg" \
-F "imgsz=640" \
-F "conf=0.25" \
-F "iou=0.45"
```
=== "Python"
@ -400,12 +400,12 @@ The [Ultralytics HUB](https://www.ultralytics.com/hub) Inference API returns a J
```bash
curl -X POST "https://predict.ultralytics.com" \
-H "x-api-key: API_KEY" \
-F "model=https://hub.ultralytics.com/models/MODEL_ID" \
-F "file=@/path/to/image.jpg" \
-F "imgsz=640" \
-F "conf=0.25" \
-F "iou=0.45"
-H "x-api-key: API_KEY" \
-F "model=https://hub.ultralytics.com/models/MODEL_ID" \
-F "file=@/path/to/image.jpg" \
-F "imgsz=640" \
-F "conf=0.25" \
-F "iou=0.45"
```
=== "Python"
@ -501,12 +501,12 @@ The [Ultralytics HUB](https://www.ultralytics.com/hub) Inference API returns a J
```bash
curl -X POST "https://predict.ultralytics.com" \
-H "x-api-key: API_KEY" \
-F "model=https://hub.ultralytics.com/models/MODEL_ID" \
-F "file=@/path/to/image.jpg" \
-F "imgsz=640" \
-F "conf=0.25" \
-F "iou=0.45"
-H "x-api-key: API_KEY" \
-F "model=https://hub.ultralytics.com/models/MODEL_ID" \
-F "file=@/path/to/image.jpg" \
-F "imgsz=640" \
-F "conf=0.25" \
-F "iou=0.45"
```
=== "Python"

View File

@ -165,7 +165,7 @@ ClearML's remote execution feature facilitates the reproduction and manipulation
Deploying a ClearML Agent is straightforward and can be done on various machines using the following command:
```bash
clearml-agent daemon --queue <queues_to_listen_to> [--docker]
clearml-agent daemon --queue QUEUES_TO_LISTEN_TO [--docker]
```
This setup is applicable to cloud VMs, local GPUs, or laptops. [ClearML Autoscalers](https://clear.ml/docs/latest/docs/cloud_autoscaling/autoscaling_overview/) help manage cloud workloads on platforms like AWS, GCP, and Azure, automating the deployment of agents and adjusting resources based on your resource budget.

View File

@ -45,7 +45,7 @@ After installing the required packages, you'll need to sign up, get a [Comet API
```bash
# Set your Comet Api Key
export COMET_API_KEY=<Your API Key>
export COMET_API_KEY=YOUR_API_KEY
```
Then, you can initialize your Comet project. Comet will automatically detect the API key and proceed with the setup.
@ -196,7 +196,7 @@ To integrate Comet ML with Ultralytics YOLO11, follow these steps:
2. **Set up your Comet API Key**:
```bash
export COMET_API_KEY=<Your API Key>
export COMET_API_KEY=YOUR_API_KEY
```
3. **Initialize your Comet project in your Python code**:

View File

@ -99,7 +99,7 @@ Before diving into the usage instructions, be sure to check out the range of [YO
```bash
# Export a YOLO11n PyTorch model to CoreML format
yolo export model=yolo11n.pt format=coreml # creates 'yolo11n.mlpackage''
yolo export model=yolo11n.pt format=coreml # creates 'yolo11n.mlpackage''
# Run inference with the exported model
yolo predict model=yolo11n.mlpackage source='https://ultralytics.com/images/bus.jpg'

View File

@ -89,7 +89,7 @@ Before diving into the usage instructions, it's important to note that while all
```bash
# Export a YOLO11n PyTorch model to TFLite Edge TPU format
yolo export model=yolo11n.pt format=edgetpu # creates 'yolo11n_full_integer_quant_edgetpu.tflite'
yolo export model=yolo11n.pt format=edgetpu # creates 'yolo11n_full_integer_quant_edgetpu.tflite'
# Run inference with the exported model
yolo predict model=yolo11n_full_integer_quant_edgetpu.tflite source='https://ultralytics.com/images/bus.jpg'
@ -154,7 +154,7 @@ To export a YOLO11 model to TFLite Edge TPU format, you can follow these steps:
```bash
# Export a YOLO11n PyTorch model to TFLite Edge TPU format
yolo export model=yolo11n.pt format=edgetpu # creates 'yolo11n_full_integer_quant_edgetpu.tflite'
yolo export model=yolo11n.pt format=edgetpu # creates 'yolo11n_full_integer_quant_edgetpu.tflite'
# Run inference with the exported model
yolo predict model=yolo11n_full_integer_quant_edgetpu.tflite source='https://ultralytics.com/images/bus.jpg'

View File

@ -67,7 +67,7 @@ Make sure that MLflow logging is enabled in Ultralytics settings. Usually, this
1. **Set a Project Name**: You can set the project name via an environment variable:
```bash
export MLFLOW_EXPERIMENT_NAME=<your_experiment_name>
export MLFLOW_EXPERIMENT_NAME=YOUR_EXPERIMENT_NAME
```
Or use the `project=<project>` argument when training a YOLO model, i.e. `yolo train project=my_project`.
@ -75,7 +75,7 @@ Make sure that MLflow logging is enabled in Ultralytics settings. Usually, this
2. **Set a Run Name**: Similar to setting a project name, you can set the run name via an environment variable:
```bash
export MLFLOW_RUN=<your_run_name>
export MLFLOW_RUN=YOUR_RUN_NAME
```
Or use the `name=<name>` argument when training a YOLO model, i.e. `yolo train project=my_project name=my_name`.

View File

@ -60,7 +60,7 @@ Before diving into the usage instructions, it's important to note that while all
```bash
# Export a YOLO11n PyTorch model to MNN format
yolo export model=yolo11n.pt format=mnn # creates 'yolo11n.mnn'
yolo export model=yolo11n.pt format=mnn # creates 'yolo11n.mnn'
# Run inference with the exported model
yolo predict model='yolo11n.mnn' source='https://ultralytics.com/images/bus.jpg'
@ -311,9 +311,9 @@ To export your Ultralytics YOLO11 model to MNN format, follow these steps:
=== "CLI"
```bash
yolo export model=yolo11n.pt format=mnn # creates 'yolo11n.mnn' with fp32 weight
yolo export model=yolo11n.pt format=mnn half=True # creates 'yolo11n.mnn' with fp16 weight
yolo export model=yolo11n.pt format=mnn int8=True # creates 'yolo11n.mnn' with int8 weight
yolo export model=yolo11n.pt format=mnn # creates 'yolo11n.mnn' with fp32 weight
yolo export model=yolo11n.pt format=mnn half=True # creates 'yolo11n.mnn' with fp16 weight
yolo export model=yolo11n.pt format=mnn int8=True # creates 'yolo11n.mnn' with int8 weight
```
For detailed export options, check the [Export](../modes/export.md) page in the documentation.
@ -344,8 +344,8 @@ To predict with an exported YOLO11 MNN model, use the `predict` function from th
=== "CLI"
```bash
yolo predict model='yolo11n.mnn' source='https://ultralytics.com/images/bus.jpg' # predict with `fp32`
yolo predict model='yolo11n.mnn' source='https://ultralytics.com/images/bus.jpg' --half=True # predict with `fp16` if device support
yolo predict model='yolo11n.mnn' source='https://ultralytics.com/images/bus.jpg' # predict with `fp32`
yolo predict model='yolo11n.mnn' source='https://ultralytics.com/images/bus.jpg' --half=True # predict with `fp16` if device support
```
### What platforms are supported for MNN?

View File

@ -91,7 +91,7 @@ Before diving into the usage instructions, it's important to note that while all
```bash
# Export a YOLO11n PyTorch model to NCNN format
yolo export model=yolo11n.pt format=ncnn # creates '/yolo11n_ncnn_model'
yolo export model=yolo11n.pt format=ncnn # creates '/yolo11n_ncnn_model'
# Run inference with the exported model
yolo predict model='./yolo11n_ncnn_model' source='https://ultralytics.com/images/bus.jpg'
@ -148,7 +148,7 @@ To export your Ultralytics YOLO11 model to NCNN format, follow these steps:
- **CLI**: Use the `yolo` command with the `export` argument.
```bash
yolo export model=yolo11n.pt format=ncnn # creates '/yolo11n_ncnn_model'
yolo export model=yolo11n.pt format=ncnn # creates '/yolo11n_ncnn_model'
```
For detailed export options, check the [Export](../modes/export.md) page in the documentation.

View File

@ -107,7 +107,7 @@ Before diving into the usage instructions, be sure to check out the range of [YO
```bash
# Export a YOLO11n PyTorch model to ONNX format
yolo export model=yolo11n.pt format=onnx # creates 'yolo11n.onnx'
yolo export model=yolo11n.pt format=onnx # creates 'yolo11n.onnx'
# Run inference with the exported model
yolo predict model=yolo11n.onnx source='https://ultralytics.com/images/bus.jpg'
@ -182,7 +182,7 @@ To export your YOLO11 models to ONNX format using Ultralytics, follow these step
```bash
# Export a YOLO11n PyTorch model to ONNX format
yolo export model=yolo11n.pt format=onnx # creates 'yolo11n.onnx'
yolo export model=yolo11n.pt format=onnx # creates 'yolo11n.onnx'
# Run inference with the exported model
yolo predict model=yolo11n.onnx source='https://ultralytics.com/images/bus.jpg'

View File

@ -51,7 +51,7 @@ Export a YOLOv8n model to OpenVINO format and run inference with the exported mo
```bash
# Export a YOLOv8n PyTorch model to OpenVINO format
yolo export model=yolov8n.pt format=openvino # creates 'yolov8n_openvino_model/'
yolo export model=yolov8n.pt format=openvino # creates 'yolov8n_openvino_model/'
# Run inference with the exported model
yolo predict model=yolov8n_openvino_model source='https://ultralytics.com/images/bus.jpg'
@ -402,7 +402,7 @@ Exporting YOLOv8 models to the OpenVINO format can significantly enhance CPU spe
```bash
# Export a YOLOv8n PyTorch model to OpenVINO format
yolo export model=yolov8n.pt format=openvino # creates 'yolov8n_openvino_model/'
yolo export model=yolov8n.pt format=openvino # creates 'yolov8n_openvino_model/'
```
For more information, refer to the [export formats documentation](../modes/export.md).

View File

@ -104,7 +104,7 @@ Before diving into the usage instructions, it's important to note that while all
```bash
# Export a YOLO11n PyTorch model to PaddlePaddle format
yolo export model=yolo11n.pt format=paddle # creates '/yolo11n_paddle_model'
yolo export model=yolo11n.pt format=paddle # creates '/yolo11n_paddle_model'
# Run inference with the exported model
yolo predict model='./yolo11n_paddle_model' source='https://ultralytics.com/images/bus.jpg'
@ -170,7 +170,7 @@ Exporting Ultralytics YOLO11 models to PaddlePaddle format is straightforward. Y
```bash
# Export a YOLO11n PyTorch model to PaddlePaddle format
yolo export model=yolo11n.pt format=paddle # creates '/yolo11n_paddle_model'
yolo export model=yolo11n.pt format=paddle # creates '/yolo11n_paddle_model'
# Run inference with the exported model
yolo predict model='./yolo11n_paddle_model' source='https://ultralytics.com/images/bus.jpg'

View File

@ -196,7 +196,7 @@ To tune the hyperparameters of your Ultralytics YOLO11 model using Ray Tune, fol
```bash
pip install -U ultralytics "ray[tune]"
pip install wandb # optional for logging
pip install wandb # optional for logging
```
2. **Load your YOLO11 model and start tuning:**

View File

@ -89,7 +89,7 @@ For detailed instructions and best practices related to the installation process
```bash
# Export a YOLO11n PyTorch model to RKNN format
# 'name' can be one of rk3588, rk3576, rk3566, rk3568, rk3562, rv1103, rv1106, rv1103b, rv1106b, rk2118
yolo export model=yolo11n.pt format=rknn name=rk3588 # creates '/yolo11n_rknn_model'
yolo export model=yolo11n.pt format=rknn name=rk3588 # creates '/yolo11n_rknn_model'
```
### Export Arguments

View File

@ -146,7 +146,7 @@ After obtaining `packerOut.zip` from the IMX500 conversion process, you can pass
Step 1: Package the model into RPK file
```bash
imx500-package -i <path to packerOut.zip> -o <output folder>
imx500-package -i path/to/packerOut.zip -o path/to/output/folder
```
The above will generate a `network.rpk` file inside the specified output folder.
@ -156,14 +156,14 @@ Step 2: Clone `picamera2` repository, install it and navigate to the imx500 exam
```bash
git clone https://github.com/raspberrypi/picamera2
cd picamera2
pip install -e . --break-system-packages
pip install -e . --break-system-packages
cd examples/imx500
```
Step 3: Run YOLOv8 object detection, using the labels.txt file that has been generated during the IMX500 export.
```bash
python imx500_object_detection_demo.py --model <path to network.rpk> --fps 17 --bbox-normalization --ignore-dash-labels --bbox-order xy --labels <path to labels.txt>
python imx500_object_detection_demo.py --model path/to/network.rpk --fps 17 --bbox-normalization --ignore-dash-labels --bbox-order xy --labels path/to/labels.txt
```
Then you will be able to see live inference output as follows
@ -309,7 +309,7 @@ After exporting to IMX500 format:
1. Use the packager tool to create an RPK file:
```bash
imx500-package -i <path to packerOut.zip> -o <output folder>
imx500-package -i path/to/packerOut.zip -o path/to/output/folder
```
2. Clone and install picamera2:
@ -322,5 +322,5 @@ After exporting to IMX500 format:
3. Run inference using the generated RPK file:
```bash
python imx500_object_detection_demo.py --model <path to network.rpk> --fps 17 --bbox-normalization --labels <path to labels.txt>
python imx500_object_detection_demo.py --model path/to/network.rpk --fps 17 --bbox-normalization --labels path/to/labels.txt
```

View File

@ -47,7 +47,7 @@ When using Google Colab, it's important to set up TensorBoard before starting yo
=== "Python"
```python
```bash
%load_ext tensorboard
%tensorboard --logdir path/to/runs
```
@ -193,7 +193,7 @@ Yes, you can use TensorBoard in a Google Colab environment to train YOLO11 model
=== "Python"
```python
```bash
%load_ext tensorboard
%tensorboard --logdir path/to/runs
```

View File

@ -101,7 +101,7 @@ Before diving into the usage instructions, be sure to check out the range of [YO
```bash
# Export a YOLO11n PyTorch model to TensorRT format
yolo export model=yolo11n.pt format=engine # creates 'yolo11n.engine''
yolo export model=yolo11n.pt format=engine # creates 'yolo11n.engine''
# Run inference with the exported model
yolo predict model=yolo11n.engine source='https://ultralytics.com/images/bus.jpg'
@ -192,7 +192,7 @@ Experimentation by NVIDIA led them to recommend using at least 500 calibration i
```bash
# Export a YOLO11n PyTorch model to TensorRT format with INT8 quantization
yolo export model=yolo11n.pt format=engine batch=8 workspace=4 int8=True data=coco.yaml # creates 'yolov8n.engine''
yolo export model=yolo11n.pt format=engine batch=8 workspace=4 int8=True data=coco.yaml # creates 'yolov8n.engine''
# Run inference with the exported TensorRT quantized model
yolo predict model=yolov8n.engine source='https://ultralytics.com/images/bus.jpg'

View File

@ -97,7 +97,7 @@ Before diving into the usage instructions, it's important to note that while all
```bash
# Export a YOLO11n PyTorch model to TF GraphDef format
yolo export model=yolo11n.pt format=pb # creates 'yolo11n.pb'
yolo export model=yolo11n.pt format=pb # creates 'yolo11n.pb'
# Run inference with the exported model
yolo predict model='yolo11n.pb' source='https://ultralytics.com/images/bus.jpg'
@ -163,7 +163,7 @@ Ultralytics YOLO11 models can be exported to TensorFlow GraphDef (TF GraphDef) f
```bash
# Export a YOLO11n PyTorch model to TF GraphDef format
yolo export model="yolo11n.pt" format="pb" # creates 'yolo11n.pb'
yolo export model="yolo11n.pt" format="pb" # creates 'yolo11n.pb'
# Run inference with the exported model
yolo predict model="yolo11n.pb" source="https://ultralytics.com/images/bus.jpg"

View File

@ -91,7 +91,7 @@ Before diving into the usage instructions, it's important to note that while all
```bash
# Export a YOLO11n PyTorch model to TF SavedModel format
yolo export model=yolo11n.pt format=saved_model # creates '/yolo11n_saved_model'
yolo export model=yolo11n.pt format=saved_model # creates '/yolo11n_saved_model'
# Run inference with the exported model
yolo predict model='./yolo11n_saved_model' source='https://ultralytics.com/images/bus.jpg'
@ -158,7 +158,7 @@ Exporting an Ultralytics YOLO model to the TensorFlow SavedModel format is strai
```bash
# Export the YOLO11 model to TF SavedModel format
yolo export model=yolo11n.pt format=saved_model # creates '/yolo11n_saved_model'
yolo export model=yolo11n.pt format=saved_model # creates '/yolo11n_saved_model'
# Run inference with the exported model
yolo predict model='./yolo11n_saved_model' source='https://ultralytics.com/images/bus.jpg'

View File

@ -89,7 +89,7 @@ Before diving into the usage instructions, it's important to note that while all
```bash
# Export a YOLO11n PyTorch model to TF.js format
yolo export model=yolo11n.pt format=tfjs # creates '/yolo11n_web_model'
yolo export model=yolo11n.pt format=tfjs # creates '/yolo11n_web_model'
# Run inference with the exported model
yolo predict model='./yolo11n_web_model' source='https://ultralytics.com/images/bus.jpg'
@ -158,7 +158,7 @@ Exporting Ultralytics YOLO11 models to TensorFlow.js (TF.js) format is straightf
```bash
# Export a YOLO11n PyTorch model to TF.js format
yolo export model=yolo11n.pt format=tfjs # creates '/yolo11n_web_model'
yolo export model=yolo11n.pt format=tfjs # creates '/yolo11n_web_model'
# Run inference with the exported model
yolo predict model='./yolo11n_web_model' source='https://ultralytics.com/images/bus.jpg'

View File

@ -95,7 +95,7 @@ Before diving into the usage instructions, it's important to note that while all
```bash
# Export a YOLO11n PyTorch model to TFLite format
yolo export model=yolo11n.pt format=tflite # creates 'yolo11n_float32.tflite'
yolo export model=yolo11n.pt format=tflite # creates 'yolo11n_float32.tflite'
# Run inference with the exported model
yolo predict model='yolo11n_float32.tflite' source='https://ultralytics.com/images/bus.jpg'
@ -158,7 +158,7 @@ model.export(format="tflite") # creates 'yolo11n_float32.tflite'
For CLI users, you can achieve this with:
```bash
yolo export model=yolo11n.pt format=tflite # creates 'yolo11n_float32.tflite'
yolo export model=yolo11n.pt format=tflite # creates 'yolo11n_float32.tflite'
```
For more details, visit the [Ultralytics export guide](../modes/export.md).

View File

@ -99,7 +99,7 @@ Before diving into the usage instructions, it's important to note that while all
```bash
# Export a YOLO11n PyTorch model to TorchScript format
yolo export model=yolo11n.pt format=torchscript # creates 'yolo11n.torchscript'
yolo export model=yolo11n.pt format=torchscript # creates 'yolo11n.torchscript'
# Run inference with the exported model
yolo predict model=yolo11n.torchscript source='https://ultralytics.com/images/bus.jpg'
@ -169,7 +169,7 @@ To export a YOLO11 model to TorchScript, you can use the following example code:
```bash
# Export a YOLO11n PyTorch model to TorchScript format
yolo export model=yolo11n.pt format=torchscript # creates 'yolo11n.torchscript'
yolo export model=yolo11n.pt format=torchscript # creates 'yolo11n.torchscript'
# Run inference with the exported model
yolo predict model=yolo11n.torchscript source='https://ultralytics.com/images/bus.jpg'

View File

@ -65,14 +65,14 @@ Start by initializing the Weights & Biases environment in your workspace. You ca
import wandb
# Initialize your Weights & Biases environment
wandb.login(key="<API_KEY>")
wandb.login(key="YOUR_API_KEY")
```
=== "CLI"
```bash
# Initialize your Weights & Biases environment
wandb login <API_KEY>
wandb login YOUR_API_KEY
```
Navigate to the [Weights & Biases authorization page](https://wandb.ai/authorize) to create and retrieve your API key. Use this key to authenticate your environment with W&B.
@ -181,7 +181,7 @@ To integrate Weights & Biases with Ultralytics YOLO11:
```python
import wandb
wandb.login(key="<API_KEY>")
wandb.login(key="YOUR_API_KEY")
```
3. Train your YOLO11 model with W&B logging enabled:

View File

@ -215,7 +215,7 @@ To perform object tracking on an image, use the `track` method as shown below:
=== "CLI"
```bash
yolo segment track model=FastSAM-s.pt source="path/to/video/file.mp4" imgsz=640
yolo segment track model=FastSAM-s.pt source="path/to/video.mp4" imgsz=640
```
## FastSAM official Usage

View File

@ -190,7 +190,7 @@ Model validation on a dataset is streamlined as follows:
```bash
# Track with a YOLO-World model on the video with a specified image size
yolo track model=yolov8s-world.pt imgsz=640 source="path/to/video/file.mp4"
yolo track model=yolov8s-world.pt imgsz=640 source="path/to/video.mp4"
```
!!! note

View File

@ -66,8 +66,8 @@ Export a YOLO11n model to a different format like ONNX or TensorRT. See the Argu
=== "CLI"
```bash
yolo export model=yolo11n.pt format=onnx # export official model
yolo export model=path/to/best.pt format=onnx # export custom trained model
yolo export model=yolo11n.pt format=onnx # export official model
yolo export model=path/to/best.pt format=onnx # export custom trained model
```
## Arguments
@ -108,8 +108,8 @@ Exporting a YOLO11 model to ONNX format is straightforward with Ultralytics. It
=== "CLI"
```bash
yolo export model=yolo11n.pt format=onnx # export official model
yolo export model=path/to/best.pt format=onnx # export custom trained model
yolo export model=yolo11n.pt format=onnx # export official model
yolo export model=path/to/best.pt format=onnx # export custom trained model
```
For more details on the process, including advanced options like handling different input sizes, refer to the [ONNX integration guide](../integrations/onnx.md).
@ -142,7 +142,7 @@ INT8 quantization is an excellent way to compress the model and speed up inferen
=== "CLI"
```bash
yolo export model=yolo11n.pt format=engine int8=True # export TensorRT model with INT8 quantization
yolo export model=yolo11n.pt format=engine int8=True # export TensorRT model with INT8 quantization
```
INT8 quantization can be applied to various formats, such as [TensorRT](../integrations/tensorrt.md), [OpenVINO](../integrations/openvino.md), and [CoreML](../integrations/coreml.md). For optimal quantization results, provide a representative [dataset](https://docs.ultralytics.com/datasets/) using the `data` parameter.

View File

@ -84,10 +84,10 @@ To run the tracker on video streams, use a trained Detect, Segment or Pose model
```bash
# Perform tracking with various models using the command line interface
yolo track model=yolo11n.pt source="https://youtu.be/LNwODJXcvt4" # Official Detect model
yolo track model=yolo11n.pt source="https://youtu.be/LNwODJXcvt4" # Official Detect model
yolo track model=yolo11n-seg.pt source="https://youtu.be/LNwODJXcvt4" # Official Segment model
yolo track model=yolo11n-pose.pt source="https://youtu.be/LNwODJXcvt4" # Official Pose model
yolo track model=path/to/best.pt source="https://youtu.be/LNwODJXcvt4" # Custom trained model
yolo track model=yolo11n-pose.pt source="https://youtu.be/LNwODJXcvt4" # Official Pose model
yolo track model=path/to/best.pt source="https://youtu.be/LNwODJXcvt4" # Custom trained model
# Track using ByteTrack tracker
yolo track model=path/to/best.pt tracker="bytetrack.yaml"

View File

@ -257,7 +257,7 @@ To use TensorBoard in [Google Colab](https://colab.research.google.com/github/ul
```bash
load_ext tensorboard
tensorboard --logdir ultralytics/runs # replace with 'runs' directory
tensorboard --logdir ultralytics/runs # replace with 'runs' directory
```
To use TensorBoard locally run the below command and view results at <http://localhost:6006/>.
@ -267,7 +267,7 @@ To use TensorBoard locally run the below command and view results at <http://loc
=== "CLI"
```bash
tensorboard --logdir ultralytics/runs # replace with 'runs' directory
tensorboard --logdir ultralytics/runs # replace with 'runs' directory
```
This will load TensorBoard and direct it to the directory where your training logs are saved.

View File

@ -71,8 +71,8 @@ Validate trained YOLO11n model [accuracy](https://www.ultralytics.com/glossary/a
=== "CLI"
```bash
yolo detect val model=yolo11n.pt # val official model
yolo detect val model=path/to/best.pt # val custom model
yolo detect val model=yolo11n.pt # val official model
yolo detect val model=path/to/best.pt # val custom model
```
## Arguments for YOLO Model Validation

View File

@ -76,8 +76,8 @@ Ultralytics offers a variety of installation methods, including pip, conda, and
sudo docker pull $t
# Run the ultralytics image in a container with GPU support
sudo docker run -it --ipc=host --gpus all $t # all GPUs
sudo docker run -it --ipc=host --gpus '"device=2,3"' $t # specify GPUs
sudo docker run -it --ipc=host --gpus all $t # all GPUs
sudo docker run -it --ipc=host --gpus '"device=2,3"' $t # specify GPUs
```
=== "Git clone"
@ -122,8 +122,8 @@ Ultralytics offers a variety of installation methods, including pip, conda, and
sudo docker pull $t
# Run the ultralytics image in a container with GPU support
sudo docker run -it --ipc=host --gpus all $t # all GPUs
sudo docker run -it --ipc=host --gpus '"device=2,3"' $t # specify GPUs
sudo docker run -it --ipc=host --gpus all $t # all GPUs
sudo docker run -it --ipc=host --gpus '"device=2,3"' $t # specify GPUs
```
The above command initializes a Docker container with the latest `ultralytics` image. The `-it` flags assign a pseudo-TTY and keep stdin open, allowing interaction with the container. The `--ipc=host` flag sets the IPC (Inter-Process Communication) namespace to the host, which is essential for sharing memory between processes. The `--gpus all` flag enables access to all available GPUs inside the container, crucial for tasks requiring GPU computation.
@ -201,7 +201,7 @@ The Ultralytics command-line interface (CLI) allows for simple single-line comma
```bash
yolo solutions count show=True
yolo solutions count source="path/to/video/file.mp4" # specify video file path
yolo solutions count source="path/to/video.mp4" # specify video file path
```
=== "Workout"
@ -210,11 +210,11 @@ The Ultralytics command-line interface (CLI) allows for simple single-line comma
```bash
yolo solutions workout show=True
yolo solutions workout source="path/to/video/file.mp4" # specify video file path
yolo solutions workout source="path/to/video.mp4" # specify video file path
# Use keypoints for ab-workouts
yolo solutions workout kpts=[5, 11, 13] # left side
yolo solutions workout kpts=[6, 12, 14] # right side
yolo solutions workout kpts=[5, 11, 13] # left side
yolo solutions workout kpts=[6, 12, 14] # right side
```
=== "Queue"
@ -223,9 +223,9 @@ The Ultralytics command-line interface (CLI) allows for simple single-line comma
```bash
yolo solutions queue show=True
yolo solutions queue source="path/to/video/file.mp4" # specify video file path
yolo solutions queue source="path/to/video.mp4" # specify video file path
yolo solutions queue region=[(20, 400), (1080, 400), (1080, 360), (20, 360)] # configure queue coordinates
yolo solutions queue region="[(20, 400), (1080, 400), (1080, 360), (20, 360)]" # configure queue coordinates
```
=== "Inference with Streamlit"
@ -234,7 +234,7 @@ The Ultralytics command-line interface (CLI) allows for simple single-line comma
```bash
yolo solutions inference
yolo solutions inference model="path/to/model.pt" # use model fine-tuned with Ultralytics Python package
yolo solutions inference model="path/to/model.pt" # use model fine-tuned with Ultralytics Python package
```
=== "Special"

View File

@ -115,9 +115,9 @@ For more details, refer to the [`SolutionResults` class documentation](https://d
- **ARGS** (optional) are custom `arg=value` pairs, such as `show_in=True`, to override default settings.
```bash
yolo solutions count show=True # for object counting
yolo solutions count show=True # for object counting
yolo solutions source="path/to/video/file.mp4" # specify video file path
yolo solutions source="path/to/video.mp4" # specify video file path
```
### Contribute to Our Solutions

View File

@ -101,7 +101,7 @@ Validate trained YOLO11n-cls model [accuracy](https://www.ultralytics.com/glossa
```bash
yolo classify val model=yolo11n-cls.pt # val official model
yolo classify val model=path/to/best.pt # val custom model
yolo classify val model=path/to/best.pt # val custom model
```
## Predict
@ -127,7 +127,7 @@ Use a trained YOLO11n-cls model to run predictions on images.
```bash
yolo classify predict model=yolo11n-cls.pt source='https://ultralytics.com/images/bus.jpg' # predict with official model
yolo classify predict model=path/to/best.pt source='https://ultralytics.com/images/bus.jpg' # predict with custom model
yolo classify predict model=path/to/best.pt source='https://ultralytics.com/images/bus.jpg' # predict with custom model
```
See full `predict` mode details in the [Predict](../modes/predict.md) page.
@ -155,7 +155,7 @@ Export a YOLO11n-cls model to a different format like ONNX, CoreML, etc.
```bash
yolo export model=yolo11n-cls.pt format=onnx # export official model
yolo export model=path/to/best.pt format=onnx # export custom trained model
yolo export model=path/to/best.pt format=onnx # export custom trained model
```
Available YOLO11-cls export formats are in the table below. You can export to any format using the `format` argument, i.e. `format='onnx'` or `format='engine'`. You can predict or validate directly on exported models, i.e. `yolo predict model=yolo11n-cls.onnx`. Usage examples are shown for your model after export completes.
@ -221,7 +221,7 @@ You can export a trained YOLO11 model to various formats using Python or CLI com
=== "CLI"
```bash
yolo export model=yolo11n-cls.pt format=onnx # export the trained model to ONNX format
yolo export model=yolo11n-cls.pt format=onnx # export the trained model to ONNX format
```
For detailed export options, refer to the [Export](../modes/export.md) page.
@ -249,7 +249,7 @@ To validate a trained model's accuracy on a dataset like MNIST160, you can use t
=== "CLI"
```bash
yolo classify val model=yolo11n-cls.pt # validate the trained model
yolo classify val model=yolo11n-cls.pt # validate the trained model
```
For more information, visit the [Validate](#val) section.

View File

@ -101,8 +101,8 @@ Validate trained YOLO11n model [accuracy](https://www.ultralytics.com/glossary/a
=== "CLI"
```bash
yolo detect val model=yolo11n.pt # val official model
yolo detect val model=path/to/best.pt # val custom model
yolo detect val model=yolo11n.pt # val official model
yolo detect val model=path/to/best.pt # val custom model
```
## Predict
@ -136,8 +136,8 @@ Use a trained YOLO11n model to run predictions on images.
=== "CLI"
```bash
yolo detect predict model=yolo11n.pt source='https://ultralytics.com/images/bus.jpg' # predict with official model
yolo detect predict model=path/to/best.pt source='https://ultralytics.com/images/bus.jpg' # predict with custom model
yolo detect predict model=yolo11n.pt source='https://ultralytics.com/images/bus.jpg' # predict with official model
yolo detect predict model=path/to/best.pt source='https://ultralytics.com/images/bus.jpg' # predict with custom model
```
See full `predict` mode details in the [Predict](../modes/predict.md) page.
@ -164,8 +164,8 @@ Export a YOLO11n model to a different format like ONNX, CoreML, etc.
=== "CLI"
```bash
yolo export model=yolo11n.pt format=onnx # export official model
yolo export model=path/to/best.pt format=onnx # export custom trained model
yolo export model=yolo11n.pt format=onnx # export official model
yolo export model=path/to/best.pt format=onnx # export custom trained model
```
Available YOLO11 export formats are in the table below. You can export to any format using the `format` argument, i.e. `format='onnx'` or `format='engine'`. You can predict or validate directly on exported models, i.e. `yolo predict model=yolo11n.onnx`. Usage examples are shown for your model after export completes.

View File

@ -96,7 +96,7 @@ To use Ultralytics YOLO11 for object detection, follow these steps:
```bash
# Run YOLO detection from the command line
yolo detect model=yolo11n.pt source="image.jpg" # Adjust model and source as needed
yolo detect model=yolo11n.pt source="image.jpg" # Adjust model and source as needed
```
For more detailed instructions, check out our [detection examples](detect.md).

View File

@ -127,8 +127,8 @@ Validate trained YOLO11n-obb model [accuracy](https://www.ultralytics.com/glossa
=== "CLI"
```bash
yolo obb val model=yolo11n-obb.pt data=dota8.yaml # val official model
yolo obb val model=path/to/best.pt data=path/to/data.yaml # val custom model
yolo obb val model=yolo11n-obb.pt data=dota8.yaml # val official model
yolo obb val model=path/to/best.pt data=path/to/data.yaml # val custom model
```
## Predict
@ -161,7 +161,7 @@ Use a trained YOLO11n-obb model to run predictions on images.
```bash
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
yolo obb predict model=path/to/best.pt source='https://ultralytics.com/images/boats.jpg' # predict with custom model
```
<p align="center">
@ -200,7 +200,7 @@ Export a YOLO11n-obb model to a different format like ONNX, CoreML, etc.
```bash
yolo export model=yolo11n-obb.pt format=onnx # export official model
yolo export model=path/to/best.pt format=onnx # export custom trained model
yolo export model=path/to/best.pt format=onnx # export custom trained model
```
Available YOLO11-obb export formats are in the table below. You can export to any format using the `format` argument, i.e. `format='onnx'` or `format='engine'`. You can predict or validate directly on exported models, i.e. `yolo predict model=yolo11n-obb.onnx`. Usage examples are shown for your model after export completes.

View File

@ -124,8 +124,8 @@ Validate trained YOLO11n-pose model [accuracy](https://www.ultralytics.com/gloss
=== "CLI"
```bash
yolo pose val model=yolo11n-pose.pt # val official model
yolo pose val model=path/to/best.pt # val custom model
yolo pose val model=yolo11n-pose.pt # val official model
yolo pose val model=path/to/best.pt # val custom model
```
## Predict
@ -156,8 +156,8 @@ Use a trained YOLO11n-pose model to run predictions on images. The [predict mode
=== "CLI"
```bash
yolo pose predict model=yolo11n-pose.pt source='https://ultralytics.com/images/bus.jpg' # predict with official model
yolo pose predict model=path/to/best.pt source='https://ultralytics.com/images/bus.jpg' # predict with custom model
yolo pose predict model=yolo11n-pose.pt source='https://ultralytics.com/images/bus.jpg' # predict with official model
yolo pose predict model=path/to/best.pt source='https://ultralytics.com/images/bus.jpg' # predict with custom model
```
See full `predict` mode details in the [Predict](../modes/predict.md) page.
@ -184,8 +184,8 @@ Export a YOLO11n Pose model to a different format like ONNX, CoreML, etc. This a
=== "CLI"
```bash
yolo export model=yolo11n-pose.pt format=onnx # export official model
yolo export model=path/to/best.pt format=onnx # export custom trained model
yolo export model=yolo11n-pose.pt format=onnx # export official model
yolo export model=path/to/best.pt format=onnx # export custom trained model
```
Available YOLO11-pose export formats are in the table below. You can export to any format using the `format` argument, i.e. `format='onnx'` or `format='engine'`. You can predict or validate directly on exported models, i.e. `yolo predict model=yolo11n-pose.onnx`. Usage examples are shown for your model after export completes.

View File

@ -107,7 +107,7 @@ Validate trained YOLO11n-seg model [accuracy](https://www.ultralytics.com/glossa
```bash
yolo segment val model=yolo11n-seg.pt # val official model
yolo segment val model=path/to/best.pt # val custom model
yolo segment val model=path/to/best.pt # val custom model
```
## Predict
@ -139,7 +139,7 @@ Use a trained YOLO11n-seg model to run predictions on images.
```bash
yolo segment predict model=yolo11n-seg.pt source='https://ultralytics.com/images/bus.jpg' # predict with official model
yolo segment predict model=path/to/best.pt source='https://ultralytics.com/images/bus.jpg' # predict with custom model
yolo segment predict model=path/to/best.pt source='https://ultralytics.com/images/bus.jpg' # predict with custom model
```
See full `predict` mode details in the [Predict](../modes/predict.md) page.
@ -167,7 +167,7 @@ Export a YOLO11n-seg model to a different format like ONNX, CoreML, etc.
```bash
yolo export model=yolo11n-seg.pt format=onnx # export official model
yolo export model=path/to/best.pt format=onnx # export custom trained model
yolo export model=path/to/best.pt format=onnx # export custom trained model
```
Available YOLO11-seg export formats are in the table below. You can export to any format using the `format` argument, i.e. `format='onnx'` or `format='engine'`. You can predict or validate directly on exported models, i.e. `yolo predict model=yolo11n-seg.onnx`. Usage examples are shown for your model after export completes.

View File

@ -247,7 +247,7 @@ Ultralytics provides ready-to-use solutions for common computer vision applicati
```bash
yolo solutions count show=True
yolo solutions count source="path/to/video/file.mp4" # specify video file path
yolo solutions count source="path/to/video.mp4" # specify video file path
```
=== "Workout"
@ -256,11 +256,11 @@ Ultralytics provides ready-to-use solutions for common computer vision applicati
```bash
yolo solutions workout show=True
yolo solutions workout source="path/to/video/file.mp4" # specify video file path
yolo solutions workout source="path/to/video.mp4" # specify video file path
# Use keypoints for ab-workouts
yolo solutions workout kpts=[5, 11, 13] # left side
yolo solutions workout kpts=[6, 12, 14] # right side
yolo solutions workout kpts=[5, 11, 13] # left side
yolo solutions workout kpts=[6, 12, 14] # right side
```
=== "Queue"
@ -269,8 +269,8 @@ Ultralytics provides ready-to-use solutions for common computer vision applicati
```bash
yolo solutions queue show=True
yolo solutions queue source="path/to/video/file.mp4" # specify video file path
yolo solutions queue region=[(20, 400), (1080, 400), (1080, 360), (20, 360)] # configure queue coordinates
yolo solutions queue source="path/to/video.mp4" # specify video file path
yolo solutions queue region="[(20, 400), (1080, 400), (1080, 360), (20, 360)]" # configure queue coordinates
```
=== "Inference"
@ -279,7 +279,7 @@ Ultralytics provides ready-to-use solutions for common computer vision applicati
```bash
yolo solutions inference
yolo solutions inference model="path/to/model.pt" # use custom model
yolo solutions inference model="path/to/model.pt" # use custom model
```
=== "Help"

View File

@ -107,7 +107,7 @@ from ultralytics.models.yolo.detect import DetectionTrainer
# Create a custom trainer
class MyCustomTrainer(DetectionTrainer):
def get_model(self, cfg, weights):
# Custom model implementation
"""Custom code implementation."""
...

View File

@ -397,7 +397,7 @@ Ultralytics includes an `Annotator` class for annotating various data types. It'
from ultralytics.utils.plotting import colors
# User defined video path and model file
cap = cv2.VideoCapture("Path/to/video/file.mp4")
cap = cv2.VideoCapture("path/to/video.mp4")
model = YOLO(model="yolo11s-seg.pt") # Model file i.e. yolo11s.pt or yolo11m-seg.pt
if not cap.isOpened():
@ -573,7 +573,7 @@ from ultralytics.utils.plotting import colors
model = YOLO("yolo11s.pt")
names = model.names
cap = cv2.VideoCapture("path/to/video/file.mp4")
cap = cv2.VideoCapture("path/to/video.mp4")
w, h, fps = (int(cap.get(x)) for x in (cv2.CAP_PROP_FRAME_WIDTH, cv2.CAP_PROP_FRAME_HEIGHT, cv2.CAP_PROP_FPS))
writer = cv2.VideoWriter("Ultralytics circle annotation.avi", cv2.VideoWriter_fourcc(*"MJPG"), fps, (w, h))
@ -613,7 +613,7 @@ from ultralytics.utils.plotting import colors
model = YOLO("yolo11s.pt")
names = model.names
cap = cv2.VideoCapture("path/to/video/file.mp4")
cap = cv2.VideoCapture("path/to/video.mp4")
w, h, fps = (int(cap.get(x)) for x in (cv2.CAP_PROP_FRAME_WIDTH, cv2.CAP_PROP_FRAME_HEIGHT, cv2.CAP_PROP_FPS))
writer = cv2.VideoWriter("Ultralytics text annotation.avi", cv2.VideoWriter_fourcc(*"MJPG"), fps, (w, h))

View File

@ -59,9 +59,9 @@ Once your instance is running, select its checkbox and click Connect to access t
Logged into your instance, you're now ready to clone the YOLOv5 repository and install dependencies within a Python 3.8 or later environment. YOLOv5's models and datasets will automatically download from the latest [release](https://github.com/ultralytics/yolov5/releases).
```bash
git clone https://github.com/ultralytics/yolov5 # clone repository
git clone https://github.com/ultralytics/yolov5 # clone repository
cd yolov5
pip install -r requirements.txt # install dependencies
pip install -r requirements.txt # install dependencies
```
With your environment set up, you can begin [training](https://docs.ultralytics.com/modes/train/), [validating](https://docs.ultralytics.com/modes/val/), performing [inference](https://docs.ultralytics.com/modes/predict/), and [exporting](https://docs.ultralytics.com/modes/export/) your YOLOv5 models:
@ -85,11 +85,11 @@ python export.py --weights yolov5s.pt --include onnx coreml tflite
To add more swap memory, which can be a savior for large datasets, run:
```bash
sudo fallocate -l 64G /swapfile # allocate 64GB swap file
sudo chmod 600 /swapfile # modify permissions
sudo mkswap /swapfile # set up a Linux swap area
sudo swapon /swapfile # activate swap file
free -h # verify swap memory
sudo fallocate -l 64G /swapfile # allocate 64GB swap file
sudo chmod 600 /swapfile # modify permissions
sudo mkswap /swapfile # set up a Linux swap area
sudo swapon /swapfile # activate swap file
free -h # verify swap memory
```
And that's it! 🎉 You've successfully created an AWS Deep Learning instance and run YOLOv5. Whether you're just starting with [object detection](https://www.ultralytics.com/glossary/object-detection) or scaling up for production, this setup can help you achieve your machine learning goals. Happy training, validating, and deploying! If you encounter any hiccups along the way, the robust AWS documentation and the active Ultralytics community are here to support you.

View File

@ -58,7 +58,7 @@ Install the required dependencies:
```bash
pip install -r requirements.txt
pip install onnx>=1.12.0
pip install onnx
```
### Perform YOLOv5 tasks

View File

@ -75,7 +75,7 @@ sudo fallocate -l 64G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
free -h # confirm the memory increment
free -h # confirm the memory increment
```
## Training Custom Datasets

View File

@ -13,9 +13,9 @@ Embark on your journey into the dynamic realm of real-time [object detection](ht
Prepare for launch by cloning the repository and establishing the environment. This ensures that all the necessary [requirements](https://github.com/ultralytics/yolov5/blob/master/requirements.txt) are installed. Check that you have [**Python>=3.8.0**](https://www.python.org/) and [**PyTorch>=1.8**](https://pytorch.org/get-started/locally/) ready for takeoff.
```bash
git clone https://github.com/ultralytics/yolov5 # clone repository
git clone https://github.com/ultralytics/yolov5 # clone repository
cd yolov5
pip install -r requirements.txt # install dependencies
pip install -r requirements.txt # install dependencies
```
## Inference with [PyTorch](https://www.ultralytics.com/glossary/pytorch) Hub
@ -43,16 +43,16 @@ results.print() # Other options: .show(), .save(), .crop(), .pandas(), etc.
Harness `detect.py` for versatile inference on various sources. It automatically fetches [models](https://github.com/ultralytics/yolov5/tree/master/models) from the latest YOLOv5 [release](https://github.com/ultralytics/yolov5/releases) and saves results with ease.
```bash
python detect.py --weights yolov5s.pt --source 0 # webcam
image.jpg # image
video.mp4 # video
screen # screenshot
path/ # directory
list.txt # list of images
list.streams # list of streams
'path/*.jpg' # glob
'https://youtu.be/LNwODJXcvt4' # YouTube
'rtsp://example.com/media.mp4' # RTSP, RTMP, HTTP stream
python detect.py --weights yolov5s.pt --source 0 # webcam
python detect.py --weights yolov5s.pt --sourceimage.jpg # image
python detect.py --weights yolov5s.pt --sourcevideo.mp4 # video
python detect.py --weights yolov5s.pt --sourcescreen # screenshot
python detect.py --weights yolov5s.pt --sourcepath/ # directory
python detect.py --weights yolov5s.pt --sourcelist.txt # list of images
python detect.py --weights yolov5s.pt --sourcelist.streams # list of streams
python detect.py --weights yolov5s.pt --source'path/*.jpg' # glob
python detect.py --weights yolov5s.pt --source'https://youtu.be/LNwODJXcvt4' # YouTube
python detect.py --weights yolov5s.pt --source'rtsp://example.com/media.mp4' # RTSP, RTMP, HTTP stream
```
## Training
@ -60,11 +60,11 @@ python detect.py --weights yolov5s.pt --source 0 #
Replicate the YOLOv5 [COCO](https://github.com/ultralytics/yolov5/blob/master/data/scripts/get_coco.sh) benchmarks with the instructions below. The necessary [models](https://github.com/ultralytics/yolov5/tree/master/models) and [datasets](https://github.com/ultralytics/yolov5/tree/master/data) are pulled directly from the latest YOLOv5 [release](https://github.com/ultralytics/yolov5/releases). Training YOLOv5n/s/m/l/x on a V100 GPU should typically take 1/2/4/6/8 days respectively (note that [Multi-GPU](./tutorials/multi_gpu_training.md) setups work faster). Maximize performance by using the highest possible `--batch-size` or use `--batch-size -1` for the YOLOv5 [AutoBatch](https://github.com/ultralytics/yolov5/pull/5092) feature. The following [batch sizes](https://www.ultralytics.com/glossary/batch-size) are ideal for V100-16GB GPUs.
```bash
python train.py --data coco.yaml --epochs 300 --weights '' --cfg yolov5n.yaml --batch-size 128
yolov5s 64
yolov5m 40
yolov5l 24
yolov5x 16
python train.py --data coco.yaml --epochs 300 --weights '' --cfg yolov5n.yaml --batch-size 128
python train.py --data coco.yaml --epochs 300 --weights '' --cfg yolov5s.yaml --batch-size 64
python train.py --data coco.yaml --epochs 300 --weights '' --cfg yolov5m.yaml --batch-size 40
python train.py --data coco.yaml --epochs 300 --weights '' --cfg yolov5l.yaml --batch-size 24
python train.py --data coco.yaml --epochs 300 --weights '' --cfg yolov5x.yaml --batch-size 16
```
<img width="800" src="https://github.com/ultralytics/docs/releases/download/0/yolov5-training-curves.avif" alt="YOLO training curves">

View File

@ -59,7 +59,7 @@ That's it! You're done 😎
To enable ClearML experiment tracking, simply install the ClearML pip package.
```bash
pip install clearml>=1.2.0
pip install clearml
```
This will enable integration with the YOLOv5 training script. Every training run from now on will be captured and stored by the ClearML [experiment manager](https://docs.ultralytics.com/integrations/clearml/).
@ -157,7 +157,7 @@ clearml-data close
Now that you have a ClearML dataset, you can very simply use it to train custom YOLOv5 🚀 models!
```bash
python train.py --img 640 --batch 16 --epochs 3 --data clearml://<your_dataset_id> --weights yolov5s.pt --cache
python train.py --img 640 --batch 16 --epochs 3 --data clearml://YOUR_DATASET_ID --weights yolov5s.pt --cache
```
<br>
@ -192,7 +192,7 @@ In short: every experiment tracked by the experiment manager contains enough inf
You can turn any machine (a cloud VM, a local GPU machine, your own laptop...) into a ClearML agent by simply running:
```bash
clearml-agent daemon --queue <queues_to_listen_to> [--docker]
clearml-agent daemon --queue QUEUES_TO_LISTEN_TO [--docker]
```
### Cloning, Editing And Enqueuing

View File

@ -33,8 +33,8 @@ You can either set your credentials through environment variables:
**Environment Variables**
```shell
export COMET_API_KEY=<Your Comet API Key>
export COMET_PROJECT_NAME=<Your Comet Project Name> # This will default to 'yolov5'
export COMET_API_KEY=YOUR_API_KEY
export COMET_PROJECT_NAME=YOUR_COMET_PROJECT_NAME # This will default to 'yolov5'
```
Or create a `.comet.config` file in your working directory and set your credentials there:
@ -43,8 +43,8 @@ Or create a `.comet.config` file in your working directory and set your credenti
```
[comet]
api_key=<Your Comet API Key>
project_name=<Your Comet Project Name> # This will default to 'yolov5'
api_key=YOUR_API_KEY
project_name=YOUR_COMET_PROJECT_NAME # This will default to 'yolov5'
```
### Run the Training Script
@ -92,14 +92,14 @@ By default, Comet will log the following items:
Comet can be configured to log additional data either through command line flags passed to the training script or through environment variables:
```shell
export COMET_MODE=online # Set whether to run Comet in 'online' or 'offline' mode. Defaults to online
export COMET_MODEL_NAME=<your model name> #Set the name for the saved model. Defaults to yolov5
export COMET_LOG_CONFUSION_MATRIX=false # Set to disable logging a Comet Confusion Matrix. Defaults to true
export COMET_MAX_IMAGE_UPLOADS=<number of allowed images to upload to Comet> # Controls how many total image predictions to log to Comet. Defaults to 100.
export COMET_LOG_PER_CLASS_METRICS=true # Set to log evaluation metrics for each detected class at the end of training. Defaults to false
export COMET_DEFAULT_CHECKPOINT_FILENAME=<your checkpoint filename> # Set this if you would like to resume training from a different checkpoint. Defaults to 'last.pt'
export COMET_LOG_BATCH_LEVEL_METRICS=true # Set this if you would like to log training metrics at the batch level. Defaults to false.
export COMET_LOG_PREDICTIONS=true # Set this to false to disable logging model predictions
export COMET_MODE=online # Set whether to run Comet in 'online' or 'offline' mode. Defaults to online
export COMET_MODEL_NAME="yolov5" # Set the name for the saved model. Defaults to yolov5
export COMET_LOG_CONFUSION_MATRIX=false # Set to disable logging a Comet Confusion Matrix. Defaults to true
export COMET_MAX_IMAGE_UPLOADS=30 # Controls how many total image predictions to log to Comet. Defaults to 100.
export COMET_LOG_PER_CLASS_METRICS=true # Set to log evaluation metrics for each detected class at the end of training. Defaults to false
export COMET_DEFAULT_CHECKPOINT_FILENAME="last.pt" # Set this if you would like to resume training from a different checkpoint. Defaults to 'last.pt'
export COMET_LOG_BATCH_LEVEL_METRICS=true # Set this if you would like to log training metrics at the batch level. Defaults to false.
export COMET_LOG_PREDICTIONS=true # Set this to false to disable logging model predictions
```
## Logging Checkpoints with Comet
@ -108,12 +108,12 @@ Logging Models to Comet is disabled by default. To enable it, pass the `save-per
```shell
python train.py \
--img 640 \
--batch 16 \
--epochs 5 \
--data coco128.yaml \
--weights yolov5s.pt \
--save-period 1
--img 640 \
--batch 16 \
--epochs 5 \
--data coco128.yaml \
--weights yolov5s.pt \
--save-period 1
```
## Logging Model Predictions
@ -128,12 +128,12 @@ Here is an [example project using the Panel](https://www.comet.com/examples/come
```shell
python train.py \
--img 640 \
--batch 16 \
--epochs 5 \
--data coco128.yaml \
--weights yolov5s.pt \
--bbox_interval 2
--img 640 \
--batch 16 \
--epochs 5 \
--data coco128.yaml \
--weights yolov5s.pt \
--bbox_interval 2
```
### Controlling the number of Prediction Images logged to Comet
@ -142,12 +142,12 @@ When logging predictions from YOLOv5, Comet will log the images associated with
```shell
env COMET_MAX_IMAGE_UPLOADS=200 python train.py \
--img 640 \
--batch 16 \
--epochs 5 \
--data coco128.yaml \
--weights yolov5s.pt \
--bbox_interval 1
--img 640 \
--batch 16 \
--epochs 5 \
--data coco128.yaml \
--weights yolov5s.pt \
--bbox_interval 1
```
### Logging Class Level Metrics
@ -156,11 +156,11 @@ Use the `COMET_LOG_PER_CLASS_METRICS` environment variable to log mAP, precision
```shell
env COMET_LOG_PER_CLASS_METRICS=true python train.py \
--img 640 \
--batch 16 \
--epochs 5 \
--data coco128.yaml \
--weights yolov5s.pt
--img 640 \
--batch 16 \
--epochs 5 \
--data coco128.yaml \
--weights yolov5s.pt
```
## Uploading a Dataset to Comet Artifacts
@ -171,12 +171,12 @@ The dataset should be organized as described in the [YOLOv5 documentation](train
```shell
python train.py \
--img 640 \
--batch 16 \
--epochs 5 \
--data coco128.yaml \
--weights yolov5s.pt \
--upload_dataset
--img 640 \
--batch 16 \
--epochs 5 \
--data coco128.yaml \
--weights yolov5s.pt \
--upload_dataset
```
You can find the uploaded dataset in the Artifacts tab in your Comet Workspace:
@ -195,20 +195,20 @@ Artifacts are versioned and also support adding metadata about the dataset. Come
If you would like to use a dataset from Comet Artifacts, set the `path` variable in your dataset `yaml` file to point to the following Artifact resource URL:
```
# contents of artifact.yaml file
path: "comet://<workspace name>/<artifact name>:<artifact version or alias>"
```yaml
# Contents of artifact.yaml file
path: "comet://WORKSPACE_NAME>/ARTIFACT_NAME:ARTIFACT_VERSION_OR_ALIAS"
```
Then pass this file to your training script in the following way:
```shell
python train.py \
--img 640 \
--batch 16 \
--epochs 5 \
--data artifact.yaml \
--weights yolov5s.pt
--img 640 \
--batch 16 \
--epochs 5 \
--data artifact.yaml \
--weights yolov5s.pt
```
Artifacts also allow you to track the lineage of data as it flows through your experimentation workflow. Here you can see a graph that shows you all the experiments that have used your uploaded dataset:
@ -219,13 +219,13 @@ Artifacts also allow you to track the lineage of data as it flows through your e
If your training run is interrupted for any reason, e.g., disrupted internet connection, you can resume the run using the `resume` flag and the Comet Run Path.
The Run Path has the following format `comet://<your workspace name>/<your project name>/<experiment id>`.
The Run Path has the following format `comet://WORKSPACE_NAME/PROJECT_NAME/EXPERIMENT_ID`.
This will restore the run to its state before the interruption, which includes restoring the model from a checkpoint, restoring all hyperparameters and training arguments, and downloading Comet dataset Artifacts if they were used in the original run. The resumed run will continue logging to the existing Experiment in the Comet UI:
```shell
python train.py \
--resume "comet://<your run path>"
--resume "comet://YOUR_RUN_PATH"
```
## Hyperparameter Search with the Comet Optimizer
@ -250,13 +250,6 @@ python utils/loggers/comet/hpo.py \
--bbox_interval 1
```
### Running a Sweep in Parallel
```shell
comet optimizer -j <set number of workers> utils/loggers/comet/hpo.py \
utils/loggers/comet/optimizer_config.json"
```
## Visualizing Results
Comet provides a number of ways to visualize the results of your sweep. Take a look at a [project with a completed sweep here](https://www.comet.com/examples/comet-example-yolov5/view/PrlArHGuuhDTKC1UuBmTtOSXD/panels?utm_source=yolov5&utm_medium=partner&utm_campaign=partner_yolov5_2022&utm_content=github).

View File

@ -21,9 +21,9 @@ This makes genetic algorithms a suitable candidate for hyperparameter searches.
Clone repo and install [requirements.txt](https://github.com/ultralytics/yolov5/blob/master/requirements.txt) in a [**Python>=3.8.0**](https://www.python.org/) environment, including [**PyTorch>=1.8**](https://pytorch.org/get-started/locally/). [Models](https://github.com/ultralytics/yolov5/tree/master/models) and [datasets](https://github.com/ultralytics/yolov5/tree/master/data) download automatically from the latest YOLOv5 [release](https://github.com/ultralytics/yolov5/releases).
```bash
git clone https://github.com/ultralytics/yolov5 # clone
git clone https://github.com/ultralytics/yolov5 # clone
cd yolov5
pip install -r requirements.txt # install
pip install -r requirements.txt # install
```
## 1. Initialize Hyperparameters
@ -92,19 +92,23 @@ To evolve hyperparameters **specific to this scenario**, starting from our initi
# Single-GPU
python train.py --epochs 10 --data coco128.yaml --weights yolov5s.pt --cache --evolve
# Multi-GPU
for i in 0 1 2 3 4 5 6 7; do
sleep $(expr 30 \* $i) && # 30-second delay (optional)
echo 'Starting GPU '$i'...' &&
nohup python train.py --epochs 10 --data coco128.yaml --weights yolov5s.pt --cache --device $i --evolve > evolve_gpu_$i.log &
# Multi-GPU with delay
for i in {0..7}; do
sleep $((30 * i)) # 30-second delay (optional)
echo "Starting GPU $i..."
nohup python train.py --epochs 10 --data coco128.yaml --weights yolov5s.pt --cache --device $i --evolve > "evolve_gpu_$i.log" &
done
# Multi-GPU bash-while (not recommended)
for i in 0 1 2 3 4 5 6 7; do
sleep $(expr 30 \* $i) && # 30-second delay (optional)
echo 'Starting GPU '$i'...' &&
"$(while true; do nohup python train.py... --device $i --evolve 1 > evolve_gpu_$i.log; done)" &
done
# Continuous training (use with caution)
# for i in {0..7}; do
# sleep $((30 * i)) # 30-second delay (optional)
# echo "Starting continuous training on GPU $i..."
# (
# while true; do
# python train.py --epochs 10 --data coco128.yaml --weights yolov5s.pt --cache --device $i --evolve > "evolve_gpu_$i.log"
# done
# ) &
# done
```
The default evolution settings will run the base scenario 300 times, i.e. for 300 generations. You can modify generations via the `--evolve` argument, i.e. `python train.py --evolve 1000`.

View File

@ -17,9 +17,9 @@ From [ensemble learning](https://en.wikipedia.org/wiki/Ensemble_learning):
Clone repo and install [requirements.txt](https://github.com/ultralytics/yolov5/blob/master/requirements.txt) in a [**Python>=3.8.0**](https://www.python.org/) environment, including [**PyTorch>=1.8**](https://pytorch.org/get-started/locally/). [Models](https://github.com/ultralytics/yolov5/tree/master/models) and [datasets](https://github.com/ultralytics/yolov5/tree/master/data) download automatically from the latest YOLOv5 [release](https://github.com/ultralytics/yolov5/releases).
```bash
git clone https://github.com/ultralytics/yolov5 # clone
git clone https://github.com/ultralytics/yolov5 # clone
cd yolov5
pip install -r requirements.txt # install
pip install -r requirements.txt # install
```
## Test Normally
@ -32,7 +32,7 @@ python val.py --weights yolov5x.pt --data coco.yaml --img 640 --half
Output:
```shell
```output
val: data=./data/coco.yaml, weights=['yolov5x.pt'], batch_size=32, imgsz=640, conf_thres=0.001, iou_thres=0.65, task=val, device=, single_cls=False, augment=False, verbose=False, save_txt=False, save_hybrid=False, save_conf=False, save_json=True, project=runs/val, name=exp, exist_ok=False, half=True
YOLOv5 🚀 v5.0-267-g6a3ee7c torch 1.9.0+cu102 CUDA:0 (Tesla P100-PCIE-16GB, 16280.875MB)
@ -74,7 +74,7 @@ python val.py --weights yolov5x.pt yolov5l6.pt --data coco.yaml --img 640 --half
Output:
```shell
```output
val: data=./data/coco.yaml, weights=['yolov5x.pt', 'yolov5l6.pt'], batch_size=32, imgsz=640, conf_thres=0.001, iou_thres=0.6, task=val, device=, single_cls=False, augment=False, verbose=False, save_txt=False, save_hybrid=False, save_conf=False, save_json=True, project=runs/val, name=exp, exist_ok=False, half=True
YOLOv5 🚀 v5.0-267-g6a3ee7c torch 1.9.0+cu102 CUDA:0 (Tesla P100-PCIE-16GB, 16280.875MB)
@ -115,7 +115,7 @@ python detect.py --weights yolov5x.pt yolov5l6.pt --img 640 --source data/images
Output:
```bash
```output
YOLOv5 🚀 v5.0-267-g6a3ee7c torch 1.9.0+cu102 CUDA:0 (Tesla P100-PCIE-16GB, 16280.875MB)
Fusing layers...

View File

@ -13,9 +13,9 @@ keywords: YOLOv5 export, TFLite, ONNX, CoreML, TensorRT, model conversion, YOLOv
Clone repo and install [requirements.txt](https://github.com/ultralytics/yolov5/blob/master/requirements.txt) in a [**Python>=3.8.0**](https://www.python.org/) environment, including [**PyTorch>=1.8**](https://pytorch.org/get-started/locally/). [Models](https://github.com/ultralytics/yolov5/tree/master/models) and [datasets](https://github.com/ultralytics/yolov5/tree/master/data) download automatically from the latest YOLOv5 [release](https://github.com/ultralytics/yolov5/releases).
```bash
git clone https://github.com/ultralytics/yolov5 # clone
git clone https://github.com/ultralytics/yolov5 # clone
cd yolov5
pip install -r requirements.txt # install
pip install -r requirements.txt # install
```
For [TensorRT](https://developer.nvidia.com/tensorrt) export example (requires GPU) see our Colab [notebook](https://colab.research.google.com/github/ultralytics/yolov5/blob/master/tutorial.ipynb#scrollTo=VTRwsvA9u7ln&line=2&uniqifier=1) appendix section. <a href="https://colab.research.google.com/github/ultralytics/yolov5/blob/master/tutorial.ipynb"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"></a>
@ -112,7 +112,7 @@ python export.py --weights yolov5s.pt --include torchscript onnx
Output:
```bash
```output
export: data=data/coco128.yaml, weights=['yolov5s.pt'], imgsz=[640, 640], batch_size=1, device=cpu, half=False, inplace=False, train=False, keras=False, optimize=False, int8=False, dynamic=False, simplify=False, opset=12, verbose=False, workspace=4, nms=False, agnostic_nms=False, topk_per_class=100, topk_all=100, iou_thres=0.45, conf_thres=0.25, include=['torchscript', 'onnx']
YOLOv5 🚀 v6.2-104-ge3e5122 Python-3.8.0 torch-1.12.1+cu113 CPU
@ -151,33 +151,33 @@ The 3 exported models will be saved alongside the original PyTorch model:
`detect.py` runs inference on exported models:
```bash
python detect.py --weights yolov5s.pt # PyTorch
yolov5s.torchscript # TorchScript
yolov5s.onnx # ONNX Runtime or OpenCV DNN with dnn=True
yolov5s_openvino_model # OpenVINO
yolov5s.engine # TensorRT
yolov5s.mlmodel # CoreML (macOS only)
yolov5s_saved_model # TensorFlow SavedModel
yolov5s.pb # TensorFlow GraphDef
yolov5s.tflite # TensorFlow Lite
yolov5s_edgetpu.tflite # TensorFlow Edge TPU
yolov5s_paddle_model # PaddlePaddle
python detect.py --weights yolov5s.pt # PyTorch
python detect.py --weights yolov5s.torchscript # TorchScript
python detect.py --weights yolov5s.onnx # ONNX Runtime or OpenCV DNN with dnn=True
python detect.py --weights yolov5s_openvino_model # OpenVINO
python detect.py --weights yolov5s.engine # TensorRT
python detect.py --weights yolov5s.mlmodel # CoreML (macOS only)
python detect.py --weights yolov5s_saved_model # TensorFlow SavedModel
python detect.py --weights yolov5s.pb # TensorFlow GraphDef
python detect.py --weights yolov5s.tflite # TensorFlow Lite
python detect.py --weights yolov5s_edgetpu.tflite # TensorFlow Edge TPU
python detect.py --weights yolov5s_paddle_model # PaddlePaddle
```
`val.py` runs validation on exported models:
```bash
python val.py --weights yolov5s.pt # PyTorch
yolov5s.torchscript # TorchScript
yolov5s.onnx # ONNX Runtime or OpenCV DNN with dnn=True
yolov5s_openvino_model # OpenVINO
yolov5s.engine # TensorRT
yolov5s.mlmodel # CoreML (macOS Only)
yolov5s_saved_model # TensorFlow SavedModel
yolov5s.pb # TensorFlow GraphDef
yolov5s.tflite # TensorFlow Lite
yolov5s_edgetpu.tflite # TensorFlow Edge TPU
yolov5s_paddle_model # PaddlePaddle
python val.py --weights yolov5s.pt # PyTorch
python val.py --weights yolov5s.torchscript # TorchScript
python val.py --weights yolov5s.onnx # ONNX Runtime or OpenCV DNN with dnn=True
python val.py --weights yolov5s_openvino_model # OpenVINO
python val.py --weights yolov5s.engine # TensorRT
python val.py --weights yolov5s.mlmodel # CoreML (macOS Only)
python val.py --weights yolov5s_saved_model # TensorFlow SavedModel
python val.py --weights yolov5s.pb # TensorFlow GraphDef
python val.py --weights yolov5s.tflite # TensorFlow Lite
python val.py --weights yolov5s_edgetpu.tflite # TensorFlow Edge TPU
python val.py --weights yolov5s_paddle_model # PaddlePaddle
```
Use PyTorch Hub with exported YOLOv5 models:
@ -215,8 +215,8 @@ results.print() # or .show(), .save(), .crop(), .pandas(), etc.
```bash
python export.py --weights yolov5s.pt --include onnx
python detect.py --weights yolov5s.onnx --dnn # detect
python val.py --weights yolov5s.onnx --dnn # validate
python detect.py --weights yolov5s.onnx --dnn # detect
python val.py --weights yolov5s.onnx --dnn # validate
```
## C++ Inference

View File

@ -24,9 +24,9 @@ Pruning works by identifying and removing parameters that contribute minimally t
Clone repo and install [requirements.txt](https://github.com/ultralytics/yolov5/blob/master/requirements.txt) in a [**Python>=3.8.0**](https://www.python.org/) environment, including [**PyTorch>=1.8**](https://pytorch.org/get-started/locally/). [Models](https://github.com/ultralytics/yolov5/tree/master/models) and [datasets](https://github.com/ultralytics/yolov5/tree/master/data) download automatically from the latest YOLOv5 [release](https://github.com/ultralytics/yolov5/releases).
```bash
git clone https://github.com/ultralytics/yolov5 # clone
git clone https://github.com/ultralytics/yolov5 # clone
cd yolov5
pip install -r requirements.txt # install
pip install -r requirements.txt # install
```
## Test Baseline Performance
@ -39,7 +39,7 @@ python val.py --weights yolov5x.pt --data coco.yaml --img 640 --half
Output:
```shell
```output
val: data=/content/yolov5/data/coco.yaml, weights=['yolov5x.pt'], batch_size=32, imgsz=640, conf_thres=0.001, iou_thres=0.65, task=val, device=, workers=8, single_cls=False, augment=False, verbose=False, save_txt=False, save_hybrid=False, save_conf=False, save_json=True, project=runs/val, name=exp, exist_ok=False, half=True, dnn=False
YOLOv5 🚀 v6.0-224-g4c40933 torch 1.10.0+cu111 CUDA:0 (Tesla V100-SXM2-16GB, 16160MiB)
@ -75,7 +75,7 @@ We can apply pruning to the model using the `torch_utils.prune()` command. To te
30% pruned output:
```bash
```output
val: data=/content/yolov5/data/coco.yaml, weights=['yolov5x.pt'], batch_size=32, imgsz=640, conf_thres=0.001, iou_thres=0.65, task=val, device=, workers=8, single_cls=False, augment=False, verbose=False, save_txt=False, save_hybrid=False, save_conf=False, save_json=True, project=runs/val, name=exp, exist_ok=False, half=True, dnn=False
YOLOv5 🚀 v6.0-224-g4c40933 torch 1.10.0+cu111 CUDA:0 (Tesla V100-SXM2-16GB, 16160MiB)

View File

@ -13,9 +13,9 @@ This guide explains how to properly use **multiple** GPUs to train a dataset wit
Clone repo and install [requirements.txt](https://github.com/ultralytics/yolov5/blob/master/requirements.txt) in a [**Python>=3.8.0**](https://www.python.org/) environment, including [**PyTorch>=1.8**](https://pytorch.org/get-started/locally/). [Models](https://github.com/ultralytics/yolov5/tree/master/models) and [datasets](https://github.com/ultralytics/yolov5/tree/master/data) download automatically from the latest YOLOv5 [release](https://github.com/ultralytics/yolov5/releases).
```bash
git clone https://github.com/ultralytics/yolov5 # clone
git clone https://github.com/ultralytics/yolov5 # clone
cd yolov5
pip install -r requirements.txt # install
pip install -r requirements.txt # install
```
!!! tip "ProTip!"

View File

@ -130,8 +130,8 @@ Spin up the Server with the pruned-quantized YOLOv5s:
```bash
deepsparse.server \
--task yolo \
--model_path zoo:cv/detection/yolov5-s/pytorch/ultralytics/coco/pruned65_quant-none
--task yolo \
--model_path zoo:cv/detection/yolov5-s/pytorch/ultralytics/coco/pruned65_quant-none
```
An example request, using Python's `requests` package:
@ -184,10 +184,10 @@ At batch 32, ONNX Runtime achieves 42 images/sec with the standard dense YOLOv5s
```bash
deepsparse.benchmark zoo:cv/detection/yolov5-s/pytorch/ultralytics/coco/base-none -s sync -b 32 -nstreams 1 -e onnxruntime
> Original Model Path: zoo:cv/detection/yolov5-s/pytorch/ultralytics/coco/base-none
> Batch Size: 32
> Scenario: sync
> Throughput (items/sec): 41.9025
# Original Model Path: zoo:cv/detection/yolov5-s/pytorch/ultralytics/coco/base-none
# Batch Size: 32
# Scenario: sync
# Throughput (items/sec): 41.9025
```
#### DeepSparse Dense Performance
@ -199,10 +199,10 @@ At batch 32, DeepSparse achieves 70 images/sec with the standard dense YOLOv5s,
```bash
deepsparse.benchmark zoo:cv/detection/yolov5-s/pytorch/ultralytics/coco/base-none -s sync -b 32 -nstreams 1
> Original Model Path: zoo:cv/detection/yolov5-s/pytorch/ultralytics/coco/base-none
> Batch Size: 32
> Scenario: sync
> Throughput (items/sec): 69.5546
# Original Model Path: zoo:cv/detection/yolov5-s/pytorch/ultralytics/coco/base-none
# Batch Size: 32
# Scenario: sync
# Throughput (items/sec): 69.5546
```
#### DeepSparse Sparse Performance
@ -214,10 +214,10 @@ At batch 32, DeepSparse achieves 241 images/sec with the pruned-quantized YOLOv5
```bash
deepsparse.benchmark zoo:cv/detection/yolov5-s/pytorch/ultralytics/coco/pruned65_quant-none -s sync -b 32 -nstreams 1
> Original Model Path: zoo:cv/detection/yolov5-s/pytorch/ultralytics/coco/pruned65_quant-none
> Batch Size: 32
> Scenario: sync
> Throughput (items/sec): 241.2452
# Original Model Path: zoo:cv/detection/yolov5-s/pytorch/ultralytics/coco/pruned65_quant-none
# Batch Size: 32
# Scenario: sync
# Throughput (items/sec): 241.2452
```
### Batch 1 Performance Comparison
@ -231,10 +231,10 @@ At batch 1, ONNX Runtime achieves 48 images/sec with the standard, dense YOLOv5s
```bash
deepsparse.benchmark zoo:cv/detection/yolov5-s/pytorch/ultralytics/coco/base-none -s sync -b 1 -nstreams 1 -e onnxruntime
> Original Model Path: zoo:cv/detection/yolov5-s/pytorch/ultralytics/coco/base-none
> Batch Size: 1
> Scenario: sync
> Throughput (items/sec): 48.0921
# Original Model Path: zoo:cv/detection/yolov5-s/pytorch/ultralytics/coco/base-none
# Batch Size: 1
# Scenario: sync
# Throughput (items/sec): 48.0921
```
#### DeepSparse Sparse Performance
@ -244,10 +244,10 @@ At batch 1, DeepSparse achieves 135 items/sec with a pruned-quantized YOLOv5s, *
```bash
deepsparse.benchmark zoo:cv/detection/yolov5-s/pytorch/ultralytics/coco/pruned65_quant-none -s sync -b 1 -nstreams 1
> Original Model Path: zoo:cv/detection/yolov5-s/pytorch/ultralytics/coco/pruned65_quant-none
> Batch Size: 1
> Scenario: sync
> Throughput (items/sec): 134.9468
# Original Model Path: zoo:cv/detection/yolov5-s/pytorch/ultralytics/coco/pruned65_quant-none
# Batch Size: 1
# Scenario: sync
# Throughput (items/sec): 134.9468
```
Since `c6i.8xlarge` instances have VNNI instructions, DeepSparse's throughput can be pushed further if weights are pruned in blocks of 4.
@ -257,10 +257,10 @@ At batch 1, DeepSparse achieves 180 items/sec with a 4-block pruned-quantized YO
```bash
deepsparse.benchmark zoo:cv/detection/yolov5-s/pytorch/ultralytics/coco/pruned35_quant-none-vnni -s sync -b 1 -nstreams 1
> Original Model Path: zoo:cv/detection/yolov5-s/pytorch/ultralytics/coco/pruned35_quant-none-vnni
> Batch Size: 1
> Scenario: sync
> Throughput (items/sec): 179.7375
# Original Model Path: zoo:cv/detection/yolov5-s/pytorch/ultralytics/coco/pruned35_quant-none-vnni
# Batch Size: 1
# Scenario: sync
# Throughput (items/sec): 179.7375
```
## Get Started With DeepSparse

View File

@ -13,9 +13,9 @@ keywords: YOLOv5, Test-Time Augmentation, TTA, machine learning, deep learning,
Clone repo and install [requirements.txt](https://github.com/ultralytics/yolov5/blob/master/requirements.txt) in a [**Python>=3.8.0**](https://www.python.org/) environment, including [**PyTorch>=1.8**](https://pytorch.org/get-started/locally/). [Models](https://github.com/ultralytics/yolov5/tree/master/models) and [datasets](https://github.com/ultralytics/yolov5/tree/master/data) download automatically from the latest YOLOv5 [release](https://github.com/ultralytics/yolov5/releases).
```bash
git clone https://github.com/ultralytics/yolov5 # clone
git clone https://github.com/ultralytics/yolov5 # clone
cd yolov5
pip install -r requirements.txt # install
pip install -r requirements.txt # install
```
## Test Normally
@ -28,7 +28,7 @@ python val.py --weights yolov5x.pt --data coco.yaml --img 640 --half
Output:
```shell
```output
val: data=./data/coco.yaml, weights=['yolov5x.pt'], batch_size=32, imgsz=640, conf_thres=0.001, iou_thres=0.65, task=val, device=, single_cls=False, augment=False, verbose=False, save_txt=False, save_hybrid=False, save_conf=False, save_json=True, project=runs/val, name=exp, exist_ok=False, half=True
YOLOv5 🚀 v5.0-267-g6a3ee7c torch 1.9.0+cu102 CUDA:0 (Tesla P100-PCIE-16GB, 16280.875MB)
@ -67,7 +67,7 @@ python val.py --weights yolov5x.pt --data coco.yaml --img 832 --augment --half
Output:
```shell
```output
val: data=./data/coco.yaml, weights=['yolov5x.pt'], batch_size=32, imgsz=832, conf_thres=0.001, iou_thres=0.6, task=val, device=, single_cls=False, augment=True, verbose=False, save_txt=False, save_hybrid=False, save_conf=False, save_json=True, project=runs/val, name=exp, exist_ok=False, half=True
YOLOv5 🚀 v5.0-267-g6a3ee7c torch 1.9.0+cu102 CUDA:0 (Tesla P100-PCIE-16GB, 16280.875MB)
@ -107,7 +107,7 @@ python detect.py --weights yolov5s.pt --img 832 --source data/images --augment
Output:
```bash
```output
YOLOv5 🚀 v5.0-267-g6a3ee7c torch 1.9.0+cu102 CUDA:0 (Tesla P100-PCIE-16GB, 16280.875MB)
Downloading https://github.com/ultralytics/yolov5/releases/download/v5.0/yolov5s.pt to yolov5s.pt...

View File

@ -36,19 +36,19 @@ Larger models like YOLOv5x and [YOLOv5x6](https://github.com/ultralytics/yolov5/
```shell
python train.py --data custom.yaml --weights yolov5s.pt
yolov5m.pt
yolov5l.pt
yolov5x.pt
custom_pretrained.pt
python train.py --data custom.yaml --weights yolov5m.pt
python train.py --data custom.yaml --weights yolov5l.pt
python train.py --data custom.yaml --weights yolov5x.pt
python train.py --data custom.yaml --weights custom_pretrained.pt
```
- **Start from Scratch.** Recommended for large datasets (i.e. [COCO](https://github.com/ultralytics/yolov5/blob/master/data/coco.yaml), [Objects365](https://github.com/ultralytics/yolov5/blob/master/data/Objects365.yaml), [OIv6](https://storage.googleapis.com/openimages/web/index.html)). Pass the model architecture YAML you are interested in, along with an empty `--weights ''` argument:
```bash
python train.py --data custom.yaml --weights '' --cfg yolov5s.yaml
yolov5m.yaml
yolov5l.yaml
yolov5x.yaml
python train.py --data custom.yaml --weights '' --cfg yolov5m.yaml
python train.py --data custom.yaml --weights '' --cfg yolov5l.yaml
python train.py --data custom.yaml --weights '' --cfg yolov5x.yaml
```
## Training Settings

View File

@ -13,9 +13,9 @@ keywords: YOLOv5, custom dataset, model training, object detection, machine lear
Clone repo and install [requirements.txt](https://github.com/ultralytics/yolov5/blob/master/requirements.txt) in a [**Python>=3.8.0**](https://www.python.org/) environment, including [**PyTorch>=1.8**](https://pytorch.org/get-started/locally/). [Models](https://github.com/ultralytics/yolov5/tree/master/models) and [datasets](https://github.com/ultralytics/yolov5/tree/master/data) download automatically from the latest YOLOv5 [release](https://github.com/ultralytics/yolov5/releases).
```bash
git clone https://github.com/ultralytics/yolov5 # clone
git clone https://github.com/ultralytics/yolov5 # clone
cd yolov5
pip install -r requirements.txt # install
pip install -r requirements.txt # install
```
## Train On Custom Data
@ -119,8 +119,8 @@ The label file corresponding to the above image contains 2 persons (class `0`) a
Organize your train and val images and labels according to the example below. YOLOv5 assumes `/coco128` is inside a `/datasets` directory **next to** the `/yolov5` directory. **YOLOv5 locates labels automatically for each image** by replacing the last instance of `/images/` in each image path with `/labels/`. For example:
```bash
../datasets/coco128/images/im0.jpg # image
../datasets/coco128/labels/im0.txt # label
../datasets/coco128/images/im0.jpg # image
../datasets/coco128/labels/im0.txt # label
```
<p align="center"><img width="700" src="https://github.com/ultralytics/docs/releases/download/0/yolov5-dataset-structure.avif" alt="YOLOv5 dataset structure"></p>
@ -158,9 +158,9 @@ All training results are saved to `runs/train/` with incrementing run directorie
Getting started is easy:
```shell
pip install comet_ml # 1. install
export COMET_API_KEY=<Your API Key> # 2. paste API key
python train.py --img 640 --epochs 3 --data coco128.yaml --weights yolov5s.pt # 3. train
pip install comet_ml # 1. install
export COMET_API_KEY=YOUR_API_KEY # 2. paste API key
python train.py --img 640 --epochs 3 --data coco128.yaml --weights yolov5s.pt # 3. train
```
To learn more about all the supported Comet features for this integration, check out the [Comet Tutorial](./comet_logging_integration.md). If you'd like to learn more about Comet, head over to our [documentation](https://bit.ly/yolov5-colab-comet-docs). Get started by trying out the Comet Colab Notebook: [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1RG0WOQyxlDlo5Km8GogJpIEJlg_5lyYO?usp=sharing)

View File

@ -13,9 +13,9 @@ keywords: YOLOv5, transfer learning, freeze layers, machine learning, deep learn
Clone the repo and install [requirements.txt](https://github.com/ultralytics/yolov5/blob/master/requirements.txt) in a [**Python>=3.8.0**](https://www.python.org/) environment, including [**PyTorch>=1.8**](https://pytorch.org/get-started/locally/). [Models](https://github.com/ultralytics/yolov5/tree/master/models) and [datasets](https://github.com/ultralytics/yolov5/tree/master/data) download automatically from the latest YOLOv5 [release](https://github.com/ultralytics/yolov5/releases).
```bash
git clone https://github.com/ultralytics/yolov5 # clone
git clone https://github.com/ultralytics/yolov5 # clone
cd yolov5
pip install -r requirements.txt # install
pip install -r requirements.txt # install
```
## How Layer Freezing Works

View File

@ -46,17 +46,16 @@ Please follow the Rust official installation. (https://www.rust-lang.org/tools/i
pip install -U ultralytics
# export onnx model with dynamic shapes
yolo export model=yolov8m.pt format=onnx simplify dynamic
yolo export model=yolov8m-cls.pt format=onnx simplify dynamic
yolo export model=yolov8m-pose.pt format=onnx simplify dynamic
yolo export model=yolov8m-seg.pt format=onnx simplify dynamic
yolo export model=yolov8m.pt format=onnx simplify dynamic
yolo export model=yolov8m-cls.pt format=onnx simplify dynamic
yolo export model=yolov8m-pose.pt format=onnx simplify dynamic
yolo export model=yolov8m-seg.pt format=onnx simplify dynamic
# export onnx model with constant shapes
yolo export model=yolov8m.pt format=onnx simplify
yolo export model=yolov8m-cls.pt format=onnx simplify
yolo export model=yolov8m-pose.pt format=onnx simplify
yolo export model=yolov8m-seg.pt format=onnx simplify
yolo export model=yolov8m.pt format=onnx simplify
yolo export model=yolov8m-cls.pt format=onnx simplify
yolo export model=yolov8m-pose.pt format=onnx simplify
yolo export model=yolov8m-seg.pt format=onnx simplify
```
### 2. Run Inference
@ -64,25 +63,25 @@ yolo export model=yolov8m-seg.pt format=onnx simplify
It will perform inference with the ONNX model on the source image.
```bash
cargo run --release -- --model <MODEL> --source <SOURCE>
cargo run --release -- --model MODEL --source SOURCE
```
Set `--cuda` to use CUDA execution provider to speed up inference.
```bash
cargo run --release -- --cuda --model <MODEL> --source <SOURCE>
cargo run --release -- --cuda --model MODEL --source SOURCE
```
Set `--trt` to use TensorRT execution provider, and you can set `--fp16` at the same time to use TensorRT FP16 engine.
```bash
cargo run --release -- --trt --fp16 --model <MODEL> --source <SOURCE>
cargo run --release -- --trt --fp16 --model MODEL --source SOURCE
```
Set `--device_id` to select which device to run. When you have only one GPU, and you set `device_id` to 1 will not cause program panic, the `ort` would automatically fall back to `CPU` EP.
```bash
cargo run --release -- --cuda --device_id 0 --model <MODEL> --source <SOURCE>
cargo run --release -- --cuda --device_id 0 --model MODEL --source SOURCE
```
Set `--batch` to do multi-batch-size inference.
@ -90,24 +89,24 @@ Set `--batch` to do multi-batch-size inference.
If you're using `--trt`, you can also set `--batch-min` and `--batch-max` to explicitly specify min/max/opt batch for dynamic batch input.(https://onnxruntime.ai/docs/execution-providers/TensorRT-ExecutionProvider.html#explicit-shape-range-for-dynamic-shape-input).(Note that the ONNX model should be exported with dynamic shapes.)
```bash
cargo run --release -- --cuda --batch 2 --model <MODEL> --source <SOURCE>
cargo run --release -- --cuda --batch 2 --model MODEL --source SOURCE
```
Set `--height` and `--width` to do dynamic image size inference. (Note that the ONNX model should be exported with dynamic shapes.)
```bash
cargo run --release -- --cuda --width 480 --height 640 --model <MODEL> --source <SOURCE>
cargo run --release -- --cuda --width 480 --height 640 --model MODEL --source SOURCE
```
Set `--profile` to check time consumed in each stage.(Note that the model usually needs to take 1~3 times dry run to warmup. Make sure to run enough times to evaluate the result.)
```bash
cargo run --release -- --trt --fp16 --profile --model <MODEL> --source <SOURCE>
cargo run --release -- --trt --fp16 --profile --model MODEL --source SOURCE
```
Results: (yolov8m.onnx, batch=1, 3 times, trt, fp16, RTX 3060Ti)
```bash
```output
==> 0
[Model Preprocess]: 12.75788ms
[ORT H2D]: 237.118µs
@ -163,7 +162,7 @@ cargo run --release -- --model ../assets/weights/yolov8m-cls-dyn.onnx --source .
You will see result like:
```bash
```output
Summary:
> Task: Classify (Ultralytics 8.0.217)
> EP: Cpu
@ -208,5 +207,5 @@ cargo run --release -- --trt --model ../assets/weights/yolov8m-pose.onnx --sourc
using `TensorRT` EP and FP16 model `--fp16`
```bash
cargo run --release -- --trt --fp16 --model ../assets/weights/yolov8m-seg.onnx --source ../assets/images/0172.jpg --plot
cargo run --release -- --trt --fp16 --model ../assets/weights/yolov8m-seg.onnx --source ../assets/images/0172.jpg --plot
```

View File

@ -40,10 +40,10 @@ Follow these steps to build the project:
## 🛠️ Usage
Once built, you can run inference on an image using the following command:
Once built, you can run inference on an image using the following command with an XML or ONNX model:
```bash
./detect <model_path.{onnx, xml}> <image_path.jpg>
./detect path/to/model.xml path/to/image.jpg
```
## 🔄 Exporting YOLOv8 Models

View File

@ -15,8 +15,8 @@ Install the required packages using pip. You will need `ultralytics` for exporti
```bash
pip install ultralytics
pip install onnxruntime-gpu # For GPU support
# pip install onnxruntime # Use this instead if you don't have an NVIDIA GPU
pip install onnxruntime-gpu # For GPU support
# pip install onnxruntime # For CPU-only support
pip install numpy
pip install opencv-python
```
@ -36,7 +36,7 @@ yolo export model=yolov8s-seg.pt imgsz=640 format=onnx opset=12 simplify
Perform inference with the exported ONNX model on your images.
```bash
python main.py --model <MODEL_PATH> --source <IMAGE_PATH>
python main.py --model MODEL_PATH --source IMAGE_PATH
```
### Example Output

View File

@ -99,7 +99,7 @@
"from ultralytics import solutions\n",
"\n",
"# Open video file\n",
"cap = cv2.VideoCapture(\"path/to/video/file.mp4\")\n",
"cap = cv2.VideoCapture(\"path/to/video.mp4\")\n",
"assert cap.isOpened(), \"Error reading video file\"\n",
"\n",
"# Get video properties\n",

View File

@ -107,7 +107,7 @@
"from ultralytics import solutions\n",
"\n",
"# Open the video file\n",
"cap = cv2.VideoCapture(\"path/to/video/file.mp4\")\n",
"cap = cv2.VideoCapture(\"path/to/video.mp4\")\n",
"assert cap.isOpened(), \"Error reading video file\"\n",
"\n",
"# Get video properties: width, height, and frames per second (fps)\n",

View File

@ -111,7 +111,7 @@
},
"outputs": [],
"source": [
"!yolo track source=\"/path/to/video/file.mp4\" save=True"
"!yolo track source=\"/path/to/video.mp4\" save=True"
]
},
{
@ -147,7 +147,7 @@
"model = YOLO(\"yolo11n-seg.pt\")\n",
"\n",
"# Open the video file\n",
"cap = cv2.VideoCapture(\"path/to/video/file.mp4\")\n",
"cap = cv2.VideoCapture(\"path/to/video.mp4\")\n",
"\n",
"# Retrieve video properties: width, height, and frames per second\n",
"w, h, fps = (int(cap.get(x)) for x in (cv2.CAP_PROP_FRAME_WIDTH, cv2.CAP_PROP_FRAME_HEIGHT, cv2.CAP_PROP_FPS))\n",

View File

@ -87,13 +87,13 @@ SOLUTIONS_HELP_MSG = f"""
at https://docs.ultralytics.com/usage/cfg
1. Call object counting solution
yolo solutions count source="path/to/video/file.mp4" region=[(20, 400), (1080, 400), (1080, 360), (20, 360)]
yolo solutions count source="path/to/video.mp4" region="[(20, 400), (1080, 400), (1080, 360), (20, 360)]"
2. Call heatmaps solution
yolo solutions heatmap colormap=cv2.COLORMAP_PARULA model=yolo11n.pt
3. Call queue management solution
yolo solutions queue region=[(20, 400), (1080, 400), (1080, 360), (20, 360)] model=yolo11n.pt
yolo solutions queue region="[(20, 400), (1080, 400), (1080, 360), (20, 360)]" model=yolo11n.pt
4. Call workouts monitoring solution for push-ups
yolo solutions workout model=yolo11n-pose.pt kpts=[6, 8, 10]
@ -102,7 +102,7 @@ SOLUTIONS_HELP_MSG = f"""
yolo solutions analytics analytics_type="pie"
6. Track objects within specific zones
yolo solutions trackzone source="path/to/video/file.mp4" region=[(150, 150), (1130, 150), (1130, 570), (150, 570)]
yolo solutions trackzone source="path/to/video.mp4" region="[(150, 150), (1130, 150), (1130, 570), (150, 570)]"
7. Streamlit real-time webcam inference GUI
yolo streamlit-predict
@ -130,7 +130,7 @@ CLI_HELP_MSG = f"""
yolo export model=yolo11n-cls.pt format=onnx imgsz=224,128
5. Ultralytics solutions usage
yolo solutions count or in {list(SOLUTION_MAP.keys())[1:-1]} source="path/to/video/file.mp4"
yolo solutions count or in {list(SOLUTION_MAP.keys())[1:-1]} source="path/to/video.mp4"
6. Run special commands:
yolo help
@ -643,7 +643,7 @@ def handle_yolo_solutions(args: List[str]) -> None:
>>> handle_yolo_solutions(["count"])
Run analytics with custom configuration:
>>> handle_yolo_solutions(["analytics", "conf=0.25", "source=path/to/video/file.mp4"])
>>> handle_yolo_solutions(["analytics", "conf=0.25", "source=path/to/video.mp4"])
Run inference with custom configuration, requires Streamlit version 1.29.0 or higher.
>>> handle_yolo_solutions(["inference", "model=yolo11n.pt"])

View File

@ -26,7 +26,7 @@ class QueueManager(BaseSolution):
display_output: Displays the processed output.
Examples:
>>> cap = cv2.VideoCapture("Path/to/video/file.mp4")
>>> cap = cv2.VideoCapture("path/to/video.mp4")
>>> queue_manager = QueueManager(region=[100, 100, 200, 200, 300, 300])
>>> while cap.isOpened():
>>> success, im0 = cap.read()

View File

@ -58,10 +58,10 @@ results = model.track(
```bash
# Perform tracking with various models using the command line interface
yolo track model=yolo11n.pt source="https://youtu.be/LNwODJXcvt4" # Official Detect model
yolo track model=yolo11n.pt source="https://youtu.be/LNwODJXcvt4" # Official Detect model
yolo track model=yolo11n-seg.pt source="https://youtu.be/LNwODJXcvt4" # Official Segment model
yolo track model=yolo11n-pose.pt source="https://youtu.be/LNwODJXcvt4" # Official Pose model
yolo track model=path/to/best.pt source="https://youtu.be/LNwODJXcvt4" # Custom trained model
yolo track model=yolo11n-pose.pt source="https://youtu.be/LNwODJXcvt4" # Official Pose model
yolo track model=path/to/best.pt source="https://youtu.be/LNwODJXcvt4" # Custom trained model
# Track using ByteTrack tracker
yolo track model=path/to/best.pt tracker="bytetrack.yaml"