jingtianyilong / YOLOv4-pytorch

This is a pytorch repository of YOLOv4 that can be trained with custom dataset.
31 stars 12 forks source link

Understanding some parameters #10

Open a-haja opened 3 years ago

a-haja commented 3 years ago

Hi Zijie,

It would be nice if you can explain to me the following:

1) Why the last label shape in dataset.py (__creat_label function) is 6+self.num_classes ? label = [np.zeros((int(train_output_size[i]), int(train_output_size[i]), anchors_per_scale, 6+self.num_classes)) for i in range(3)] Based on my understanding it should be 5+self.num_classes, where 5 is [x, y, w, h, conf]. I see that the 5th value is always 1.0 ( see https://github.com/jingtianyilong/YOLOv4-pytorch/blob/a536f6498f9e2b4b9ec42c39250d81df8c309d5e/utils/datasets.py#L316 and https://github.com/jingtianyilong/YOLOv4-pytorch/blob/a536f6498f9e2b4b9ec42c39250d81df8c309d5e/utils/datasets.py#L356 )

2) Why bbox_ind is calculated with regards to module 90? Shouldn't it be the index of the bbox based on the scale index and anchor index? https://github.com/jingtianyilong/YOLOv4-pytorch/blob/a536f6498f9e2b4b9ec42c39250d81df8c309d5e/utils/datasets.py#L359

3) Why the size of sbboxes, mbboxes and lbboxes is 150? https://github.com/jingtianyilong/YOLOv4-pytorch/blob/8a74bec5fac1438b3795edfc7cb78a1f96ab3b17/model/loss/yolo_loss.py#L40 size of these boxes should be 90 based on the current implementation https://github.com/jingtianyilong/YOLOv4-pytorch/blob/a536f6498f9e2b4b9ec42c39250d81df8c309d5e/utils/datasets.py#L319 Why 90 ?

Looking forward to hearing from you.