DeepMotionEditing / deep-motion-editing

An end-to-end library for editing and rendering motion of 3D characters with deep learning [SIGGRAPH 2020]
BSD 2-Clause "Simplified" License
1.58k stars 256 forks source link

what's the role of the function "find_seq" defined in the class "SkeletonPool" in skeleton.py? #38

Closed ANYMS-A closed 4 years ago

ANYMS-A commented 4 years ago

Hi=.=, it's me again,

Could you please describe the role of the function "find_seq" defined in the class "SkeletonPool" in skeleton.py as well as the role of the attribute "self.seq_list" for me?

According to my understanding so far, after the Skeleton pooling, we need a new topology to help us to calculate the neigboring list/matrix for the next Skeleton convolution layer.

But I haven't make it clear after reading the code.

Many thanks!

PeizhuoLi commented 4 years ago

Note that in skeletal pooling, we only pool on "sequences". Here sequence means a sequence of connected vertices in the tree topology that doesn't contain any branch. (Thus, a single joint with more than one child forms a sequence with length 1.) find_seq finds sequences recursively, and stores the result of dividing the tree into sequences in self.seq_list.

After getting self.seq_list, we can apply pooling on the sequences easily. The new topology is then stored in self.new_edges.

Hope this will help.

ANYMS-A commented 4 years ago

Note that in skeletal pooling, we only pool on "sequences". Here sequence means a sequence of connected vertices in the tree topology that doesn't contain any branch. (Thus, a single joint with more than one child forms a sequence with length 1.) find_seq finds sequences recursively, and stores the result of dividing the tree into sequences in self.seq_list.

After getting self.seq_list, we can apply pooling on the sequences easily. The new topology is then stored in self.new_edges.

Hope this will help.

Thanks for the replying! Almost get it, besides, there is also one thing I'd like to ask:

As mentioned in the paper, the skeleton pooling removes the nodes with degree 2. But for the initial skeleton graph(e.g. Fig.2 showed in the paper), there are many nodes with degree 2, but it seems that you just remove part of those nodes after the first pooling layer. Then how to determine which node should be removed or not among all those nodes with degree 2?

Many thanks!

PeizhuoLi commented 4 years ago

In one pooling operation we pool two adjacent joints into one. If the length of a sequence is odd, we keep the nearest one to root and pool the others.

ANYMS-A commented 4 years ago

Thanks!