PyTorch-YOLOv3
PyTorch-YOLOv3 copied to clipboard
a question about how to deal with a image without bboxs
Does yolov3 deals with losses of images without bbox? if is, the code might can be revise a little。
def collate_fn(self, batch): paths, imgs, targets = list(zip(*batch)) # Remove empty placeholder targets targets = [boxes for boxes in targets if boxes is not None] # Add sample index to targets for i, boxes in enumerate(targets): boxes[:, 0] = i targets = torch.cat(targets, 0)
#if we first remove empty placeholder, the add sample index to targets, there might be cases that the index are wrong . for example, a batch targets [bboxs_0, None, bboxs_2], in this way , bboxs_2 ,which is the bboxes of image no.2 in the batch will be index to 1.
I hope someone can examplain for me ,THX