Reformat Markdown code blocks (#12795)
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com> Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
This commit is contained in:
parent
2af71d15a6
commit
fceea033ad
128 changed files with 1067 additions and 1018 deletions
|
|
@ -48,9 +48,7 @@ model = YOLO("yolov8n-pose.pt") # Load an official Pose model
|
|||
model = YOLO("path/to/best.pt") # Load a custom trained model
|
||||
|
||||
# Perform tracking with the model
|
||||
results = model.track(
|
||||
source="https://youtu.be/LNwODJXcvt4", show=True
|
||||
) # Tracking with default tracker
|
||||
results = model.track(source="https://youtu.be/LNwODJXcvt4", show=True) # Tracking with default tracker
|
||||
results = model.track(
|
||||
source="https://youtu.be/LNwODJXcvt4", show=True, tracker="bytetrack.yaml"
|
||||
) # Tracking with ByteTrack tracker
|
||||
|
|
@ -84,9 +82,7 @@ from ultralytics import YOLO
|
|||
|
||||
# Configure the tracking parameters and run the tracker
|
||||
model = YOLO("yolov8n.pt")
|
||||
results = model.track(
|
||||
source="https://youtu.be/LNwODJXcvt4", conf=0.3, iou=0.5, show=True
|
||||
)
|
||||
results = model.track(source="https://youtu.be/LNwODJXcvt4", conf=0.3, iou=0.5, show=True)
|
||||
```
|
||||
|
||||
#### CLI
|
||||
|
|
@ -107,9 +103,7 @@ from ultralytics import YOLO
|
|||
|
||||
# Load the model and run the tracker with a custom configuration file
|
||||
model = YOLO("yolov8n.pt")
|
||||
results = model.track(
|
||||
source="https://youtu.be/LNwODJXcvt4", tracker="custom_tracker.yaml"
|
||||
)
|
||||
results = model.track(source="https://youtu.be/LNwODJXcvt4", tracker="custom_tracker.yaml")
|
||||
```
|
||||
|
||||
#### CLI
|
||||
|
|
@ -182,7 +176,6 @@ from collections import defaultdict
|
|||
|
||||
import cv2
|
||||
import numpy as np
|
||||
|
||||
from ultralytics import YOLO
|
||||
|
||||
# Load the YOLOv8 model
|
||||
|
|
@ -290,12 +283,8 @@ video_file1 = "path/to/video1.mp4"
|
|||
video_file2 = "path/to/video2.mp4"
|
||||
|
||||
# Create the tracker threads
|
||||
tracker_thread1 = threading.Thread(
|
||||
target=run_tracker_in_thread, args=(video_file1, model1), daemon=True
|
||||
)
|
||||
tracker_thread2 = threading.Thread(
|
||||
target=run_tracker_in_thread, args=(video_file2, model2), daemon=True
|
||||
)
|
||||
tracker_thread1 = threading.Thread(target=run_tracker_in_thread, args=(video_file1, model1), daemon=True)
|
||||
tracker_thread2 = threading.Thread(target=run_tracker_in_thread, args=(video_file2, model2), daemon=True)
|
||||
|
||||
# Start the tracker threads
|
||||
tracker_thread1.start()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue