Standardize license headers in Python files (#13490)

* Refactor code for speed and clarity

* Auto-format by https://ultralytics.com/actions

---------

Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
This commit is contained in:
authored and GitHub committed 2025-01-15 15:31:19 +01:00
1 parent 6420a1db87
commit c568972d59
52 files changed
+67 -64

No files matched your search

+4 -4
View File
@@ -1,4 +1,4 @@
# Ultralytics YOLOv5 🚀, AGPL-3.0 license
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
"""Dataloaders and dataset utils."""
import contextlib
@@ -355,9 +355,9 @@ class LoadImages:
self._new_video(videos[0]) # new video
else:
self.cap = None
assert (
self.nf > 0
), f"No images or videos found in {p}. Supported formats are:\nimages: {IMG_FORMATS}\nvideos: {VID_FORMATS}"
assert self.nf > 0, (
f"No images or videos found in {p}. Supported formats are:\nimages: {IMG_FORMATS}\nvideos: {VID_FORMATS}"
)
def __iter__(self):
"""Initializes iterator by resetting count and returns the iterator object itself."""