gliese581gg / YOLO_tensorflow

tensorflow implementation of 'YOLO : Real-Time Object Detection'
Other
1.72k stars 655 forks source link

missing something #17

Open vishnureghu007 opened 7 years ago

vishnureghu007 commented 7 years ago

Could you please explain what is happening in the below lines. The final fc layer of 1470 values are split into 3 branches for class prob--scales--and boxes But how it is used to predict the exact boxes and the dimensions are confusing me.

class_probs = np.reshape(output[0:980],(7,7,20)) scales = np.reshape(output[980:1078],(7,7,2)) boxes = np.reshape(output[1078:],(7,7,2,4)) offset = np.transpose(np.reshape(np.array([np.arange(7)]*14),(2,7,7)),(1,2,0))

boxes[:,:,:,0] += offset boxes[:,:,:,1] += np.transpose(offset,(1,0,2)) boxes[:,:,:,0:2] = boxes[:,:,:,0:2] / 7.0 boxes[:,:,:,2] = np.multiply(boxes[:,:,:,2],boxes[:,:,:,2]) boxes[:,:,:,3] = np.multiply(boxes[:,:,:,3],boxes[:,:,:,3])