Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data format? #1

Open
dritchie opened this issue Jul 22, 2017 · 2 comments
Open

Data format? #1

dritchie opened this issue Jul 22, 2017 · 2 comments

Comments

@dritchie
Copy link

dritchie commented Jul 22, 2017

I'm interested in training this model on some of my own data. I'd very much appreciate an explanation of the data format the code expects (i.e. the format of the data in 'trainingData_chair.mat'). I see that each chair example has four fields: 'boxes,' 'symshapes,' 'treekids,' and 'symparams.' I can guess at the function of each of these, but it would be super helpful if you could provide a brief explanation of how a symmetry hierarchy maps to this format.

@dritchie
Copy link
Author

I believe I've figured this out by poking around in the code. I'm posting what I've learned here in case anyone else has need of this information:

Data cell fields:

  • boxes: bounding boxes for all components of the shape.
  • symshapes: bounding boxes for the leaf nodes of the symmetry hierarchy tree.
  • treekids: map from tree node index to info about that node’s children. Entries for leaf nodes (corresponding to the bounding box info in symshapes) must come first.
    • If treekids(i, 1) == 0 and treekids(i, 2) == 0, then node i is a leaf node.
    • If treekids(i, 3) == 0, then node i is an adjacency node. treekids(i, 1) and treekids(1, 2) are the indices of its two children.
    • If treekids(i, 3) == 1, then node i is a symmetry node. treekids(i, 1) is its generator node. treekids(i, 2) is ignored (i.e. is 0).
  • symparams: the parameters of symmetry nodes. If node i is a symmetry node, then symparams{treekids(i, 1)} are its symmetry parameters. Some data points appear to have more entries in symparams than they have symmetry nodes; I’m not sure why this is, but it seems(?) that those entries can be ignored.

Bounding box format (12 entries):

  • center: entries 1-3
  • axis lengths: entries 4-6
  • axis 1: entries 7-9
  • axis 2: entries 10-12
    Axis 3 is computed as the cross product of axis 1 and axis 2.

Symmetry parameter format (8 entries):

  • If entry 1 == -1, then it’s a rotational symmetry
    • number of repetitions: 1 / (entry 8)
    • axis of rotation: entries 2-4
    • center of rotation: entries 5-7
  • If entry 1 == 0, then it’s a translational symmetry
    • displacement vector: entries 2-4
    • centroid of the last repetition of the generator node: entries 5-7
      • The number of repetitions is computed as length(end_centroid - start_centroid) / length(displacement). Not sure why this representation is used instead of storing the number of repetitions directly as with rotational symmetries.
    • entry 8 is unused (i.e. is 0).
  • If entry 1 == 1, then it’s a reflectional symmetry
    • reflection plane normal: entries 2-4
    • center of reflection: entries 5-7
    • entry 8 is unused (i.e. is 0).

@junli-lj
Copy link
Owner

Hi Dritchie,

Your understanding is correct. :-)

Actually you can define your own format for your training data. We use this format as we observed it works stable for the training, there might have better ones.

For the symparams, when two nodes are merged and if they have the same symmetry (like two adjacent parts of an armrest, reflective symmetry), their parent node should also have this symmetry. That's why it might happen more entries in symparams than symmetry nodes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants