mirror of
https://github.com/THU-MIG/yolov10.git
synced 2025-05-23 21:44:22 +08:00
Fix __len__
and single_cls
(#249)
This commit is contained in:
parent
88c9418087
commit
53fa0f4550
@ -110,7 +110,7 @@ class BaseDataset(Dataset):
|
||||
if segments:
|
||||
self.labels[i]["segments"] = segments[j]
|
||||
if self.single_cls:
|
||||
self.labels[i]["cls"] = 0
|
||||
self.labels[i]["cls"][:, 0] = 0
|
||||
|
||||
def load_image(self, i):
|
||||
# Loads 1 image from dataset index 'i', returns (im, resized hw)
|
||||
@ -191,7 +191,7 @@ class BaseDataset(Dataset):
|
||||
return label
|
||||
|
||||
def __len__(self):
|
||||
return len(self.im_files)
|
||||
return len(self.labels)
|
||||
|
||||
def update_labels_info(self, label):
|
||||
"""custom your label format here"""
|
||||
|
Loading…
x
Reference in New Issue
Block a user