datlife / yolov2

YOLOv2 Implementation in TF/Keras. Allowing to experiment on different feature detectors (MobileNet, Darknet-19). Paper: https://arxiv.org/abs/1612.08242
49 stars 13 forks source link

Question about function 'flow_from_list' in data_generator.py #5

Open DasolHan opened 6 years ago

DasolHan commented 6 years ago

Hi Dat,

I just wonder why when create y_batch,

you don't consider about prior-anchor(created by k-mean clustering)

xc, yc, w, h = bbox.to_relative_size((float(width), float(height))) object_mask = np.concatenate([[xc, yc, w, h], [1.0], one_hot])

center_x = xc * grid_w center_y = yc * grid_h r = int(np.floor(center_x)) c = int(np.floor(center_y)) if r < grid_w and c < grid_h: y_batch[i, c, r, :, :] = N_ANCHORS * [object_mask] # Construct Feature map ground truth

According to upper codes, Don't consider prior-anchors, and do not find best anchor to fit with ground-truth.

just assign same object mask to all ANCHORS , even ground truth is not fit to other ANCHORS

Can you explain why you do not use prior-anchors for create y_batch, please?

Thank you