Apply ruff==0.9.0 formatting (#13486)
* Refactor code for speed and clarity * Auto-format by https://ultralytics.com/actions --------- Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
This commit is contained in:
1 parent
6981c2742a
commit
86fd1ab270
20 files changed
+53
-84
No files matched your search
@@ -132,9 +132,7 @@ class LoadImagesAndLabelsAndMasks(LoadImagesAndLabels): # for training/testing
|
||||
index = self.indices[index] # linear, shuffled, or image_weights
|
||||
|
||||
hyp = self.hyp
|
||||
mosaic = self.mosaic and random.random() < hyp["mosaic"]
|
||||
masks = []
|
||||
if mosaic:
|
||||
if mosaic := self.mosaic and random.random() < hyp["mosaic"]:
|
||||
# Load mosaic
|
||||
img, labels, segments = self.load_mosaic(index)
|
||||
shapes = None
|
||||
@@ -180,6 +178,7 @@ class LoadImagesAndLabelsAndMasks(LoadImagesAndLabels): # for training/testing
|
||||
)
|
||||
|
||||
nl = len(labels) # number of labels
|
||||
masks = []
|
||||
if nl:
|
||||
labels[:, 1:5] = xyxy2xywhn(labels[:, 1:5], w=img.shape[1], h=img.shape[0], clip=True, eps=1e-3)
|
||||
if self.overlap:
|
||||
|
||||
Reference in new issue
Block a user