thtrieu / darkflow

Translate darknet to tensorflow. Load trained weights, retrain/fine-tune using tensorflow, export constant graph def to mobile devices
GNU General Public License v3.0
6.13k stars 2.08k forks source link

Structure of Output layer Tiny-Yolo #901

Open erivera1802 opened 6 years ago

erivera1802 commented 6 years ago

Hi , I have succesfully tested the Tiny.Yolo net, now Im trying to use the pb file from it in a tensorflow code. however, I dont understand the output of the network. I got an Output tensor with dimensions: [1,13,13,425], I know that 13 is the dimension of the grid,and the 425 represents the bounding boxes and probabilities, but how is the exact distribution of the values in the last dimension (The one with 425 numbers), I mean, what values are size, position or confidence?

cweigel commented 6 years ago

Have a look of the implementation of box_constructor function in https://github.com/thtrieu/darkflow/blob/master/darkflow/cython_utils/cy_yolo2_findboxes.pyx. You'll find out the structure and together with the YOLO9000 paper get the ideas why it's done like this.

Fattouh92 commented 6 years ago

I run inference on frozen graph from c++ and get an output tensor of dims 1x588. Do I need a reshape before constructing boxes or how did you @erivera1802 get those dims?

erivera1802 commented 6 years ago

@Fattouh92 That was my direct output, I didnt use reshape.