How can I build a tree structure with this file 9k.tree?
yaxiongchi opened this issue · comments
can somebody explain what is the structure of 9000 label tree? In the file 9k.tree, for example the n0000245 -1, n0566538625 4, what does the -1 and 4 mean? How can I build a tree structure with this file 9k.tree?
-1 means the root of tree
4: the index of father node
@yaxiongchi does it answer your question?
Thanks @anphunl :)
I'd like to visualize the tree structure, and I don't get it (possibly because I am an artist). Why are there only two values in each line? The line number is important, too, right?
@anphunl I didn't understand your explanation at all. Can you show with a small example what that means?
@ghost I understand that -1
or 4
represents the parent node but what does n0000245
or n0566538625
represents here in the following case? n0000245 -1, n0566538625 4
@yaxiongchi
@ghost @kulkarnikeerti
From the file https://github.com/pjreddie/darknet/blob/1e729804f61c8627eb257fba8b83f74e04945db7/data/9k.tree
- The index of a node is the line number and starts at 0.
- For each line, the structure is NODE_NAME FATHER_INDEX
- If father index is -1, it's root (or we can consider it's child of a abstract node).
So:
- n00002452 (index 0), n00020827 (index 1) n00002684 (index 2) n11425580 (index 3) are 4 root nodes.
- n05220461 (index 4) and n09225146 (index 5) are children of n00002452
- n05538625, n01900150, n05225602 are children of n05220461
n00002452... are the labels https://github.com/pjreddie/darknet/blob/1e729804f61c8627eb257fba8b83f74e04945db7/data/9k.labels
Their names are in https://github.com/pjreddie/darknet/blob/1e729804f61c8627eb257fba8b83f74e04945db7/data/9k.names
n00002452 -1
n00020827 -1
n00002684 -1
n11425580 -1
n05220461 0
n09225146 0
n05538625 4
n01900150 4
n05225602 4
n05418717 8
n05302499 8
n05578095 8
n09475179 5
n09376198 5
n14877585 1
n15046900 1
n00019613 1
n00021265 1
n15067877 14
n09436708 14
n14915184 15
n07555863 15
@anphunl Thanks a lot for the great explanation. I just have few more quarries regarding the yolo9000 as I could not find more cleared answers anywhere. If you have more information it would be great if you can please answer them.
- So
n00021265
represents label given to a particular object. Are these labels manually given or auto assigned when the tree is created? - If it were generated along with the tree, how one can create such a tree for a custom data (again, I failed to find more information on this)?
- I know, that for any yolo model we will have an
img
and.txt
file with bounding boxes and label_id as an input to model training. How one can use these hierarchical data as an input to the model training? Because, we have separate files for.names
,.labels
and.tree
. I don't understand how the input is given to the model
I hope I am not disturbing you with so many silly questions. But, unfortunately I could not find more information on this.
Thanks in advance.