experiencor / keras-yolo2

Easy training on custom dataset. Various backends (MobileNet and SqueezeNet) supported. A YOLO demo to detect raccoon run entirely in brower is accessible at https://git.io/vF7vI (not on Windows).
MIT License
1.73k stars 785 forks source link

issue about the b_batch in the line 171 in the preprocessing.py #360

Open NextGuido opened 5 years ago

NextGuido commented 5 years ago

I don't understand the shape of b_batch. Its shape is (batch_size, 1, 1, 1, self.config['TRUE_BOX_BUFFER'], 4), but I don't know the reason for so many 1 in it. Could someone tell me what are these for?

jganzabal commented 5 years ago

I actually don't really understand why this hack is needed. Tensor b_batch is one of the outputs of the generator so then you need that to be part of the input of your model. That ends in the final hack of the Lambda layer so that the Model register that input that was never used in all the process (At least from what I could see in the code). Why not just instead of doing all this you just change what the generator returns: instead of this line: return [x_batch, b_batch], y_batch this line: return x_batch, y_batch I guess I am missing something, but I could really figured it out

EDIT: Ok, there is a discussion here that makes things clearer: https://github.com/experiencor/keras-yolo2/issues/172