updates
This commit is contained in:
parent
09ca721f88
commit
aae39ca894
|
@ -579,6 +579,7 @@ def load_mosaic(self, index):
|
||||||
with open(label_path, 'r') as f:
|
with open(label_path, 'r') as f:
|
||||||
x = np.array([x.split() for x in f.read().splitlines()], dtype=np.float32)
|
x = np.array([x.split() for x in f.read().splitlines()], dtype=np.float32)
|
||||||
|
|
||||||
|
labels = []
|
||||||
if x.size > 0:
|
if x.size > 0:
|
||||||
# Normalized xywh to pixel xyxy format
|
# Normalized xywh to pixel xyxy format
|
||||||
labels = x.copy()
|
labels = x.copy()
|
||||||
|
@ -586,8 +587,8 @@ def load_mosaic(self, index):
|
||||||
labels[:, 2] = h * (x[:, 2] - x[:, 4] / 2) + padh
|
labels[:, 2] = h * (x[:, 2] - x[:, 4] / 2) + padh
|
||||||
labels[:, 3] = w * (x[:, 1] + x[:, 3] / 2) + padw
|
labels[:, 3] = w * (x[:, 1] + x[:, 3] / 2) + padw
|
||||||
labels[:, 4] = h * (x[:, 2] + x[:, 4] / 2) + padh
|
labels[:, 4] = h * (x[:, 2] + x[:, 4] / 2) + padh
|
||||||
|
|
||||||
labels4.append(labels)
|
labels4.append(labels)
|
||||||
|
|
||||||
if len(labels4):
|
if len(labels4):
|
||||||
labels4 = np.concatenate(labels4, 0)
|
labels4 = np.concatenate(labels4, 0)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue