PyCharm Code Inspect fixes for Solutions and Examples (#18393)
Co-authored-by: UltralyticsAssistant <web@ultralytics.com> Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
parent
3e65fc2421
commit
b1af683d7a
13 changed files with 92 additions and 62 deletions
|
|
@ -79,18 +79,14 @@ Queue management using [Ultralytics YOLO11](https://github.com/ultralytics/ultra
|
|||
# Process video
|
||||
while cap.isOpened():
|
||||
success, im0 = cap.read()
|
||||
|
||||
if success:
|
||||
out = queue.process_queue(im0)
|
||||
video_writer.write(im0)
|
||||
if cv2.waitKey(1) & 0xFF == ord("q"):
|
||||
break
|
||||
continue
|
||||
|
||||
print("Video frame is empty or video processing has been successfully completed.")
|
||||
break
|
||||
if not success:
|
||||
print("Video frame is empty or video processing has been successfully completed.")
|
||||
break
|
||||
out = queue.process_queue(im0)
|
||||
video_writer.write(im0)
|
||||
|
||||
cap.release()
|
||||
video_writer.release()
|
||||
cv2.destroyAllWindows()
|
||||
```
|
||||
|
||||
|
|
|
|||
|
|
@ -81,18 +81,14 @@ keywords: Ultralytics YOLO11, speed estimation, object tracking, computer vision
|
|||
# Process video
|
||||
while cap.isOpened():
|
||||
success, im0 = cap.read()
|
||||
|
||||
if success:
|
||||
out = speed.estimate_speed(im0)
|
||||
video_writer.write(im0)
|
||||
if cv2.waitKey(1) & 0xFF == ord("q"):
|
||||
break
|
||||
continue
|
||||
|
||||
print("Video frame is empty or video processing has been successfully completed.")
|
||||
break
|
||||
if not success:
|
||||
print("Video frame is empty or video processing has been successfully completed.")
|
||||
break
|
||||
out = speed.estimate_speed(im0)
|
||||
video_writer.write(im0)
|
||||
|
||||
cap.release()
|
||||
video_writer.release()
|
||||
cv2.destroyAllWindows()
|
||||
```
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue