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:
Glenn Jocher 2024-05-18 18:58:06 +02:00 committed by GitHub
parent 2af71d15a6
commit fceea033ad
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
128 changed files with 1067 additions and 1018 deletions

View file

@ -42,8 +42,8 @@ Measuring the gap between two objects is known as distance calculation within a
=== "Video Stream"
```python
from ultralytics import YOLO, solutions
import cv2
from ultralytics import YOLO, solutions
model = YOLO("yolov8n.pt")
names = model.model.names
@ -53,7 +53,7 @@ Measuring the gap between two objects is known as distance calculation within a
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
video_writer = cv2.VideoWriter("distance_calculation.avi", cv2.VideoWriter_fourcc(*'mp4v'), fps, (w, h))
video_writer = cv2.VideoWriter("distance_calculation.avi", cv2.VideoWriter_fourcc(*"mp4v"), fps, (w, h))
# Init distance-calculation obj
dist_obj = solutions.DistanceCalculation(names=names, view_img=True)
@ -71,7 +71,6 @@ Measuring the gap between two objects is known as distance calculation within a
cap.release()
video_writer.release()
cv2.destroyAllWindows()
```
???+ tip "Note"