changed yolo dataset for no label images

This commit is contained in:
2026-06-05 14:31:40 +02:00
parent fe90bfa39b
commit 760caefbfe
2 changed files with 0 additions and 4 deletions
-1
View File
@@ -34,7 +34,6 @@ def visualize_boxes(label, image, threshold=0.95):
boxes_to_draw, grids_to_draw_obj, grids_to_draw_noobj = convert_prediction(label, image, threshold)
if len(boxes_to_draw) == 0:
print("no labels")
return
boxes_to_draw = torch.tensor(boxes_to_draw)
grids_to_draw_noobj = torch.tensor(grids_to_draw_noobj)
grids_to_draw_obj = torch.tensor(grids_to_draw_obj)
-3
View File
@@ -119,9 +119,6 @@ class YoloDataset(Dataset):
boxes = augmented["bboxes"]
labels = augmented["labels"]
if len(boxes) == 0:
return self.__getitem__((idx + 1) % len(self.image_ids))
ground_truth = list(zip(boxes, labels))
#[S, S, (x+y+w+h+c+C)]
targets = np.zeros((self.grid, self.grid, 5 + self.num_classes), dtype=np.float32)