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

eval_prepare looks dirty + some other questions #81

Open TheCrazyT opened 4 years ago

TheCrazyT commented 4 years ago

https://github.com/DeepMotionEditing/deep-motion-editing/blob/master/retargeting/eval_single_pair.py#L8

I just don't get why character names are hardcoded here. Also don't understand the meaning of the "_m" suffix of some characters. Are i'm right that it has an impact on the result?

Thats just some small weird things I have noticed.

PeizhuoLi commented 4 years ago

The whole test time code is indeed dirty and we are planning to make it more clean.

For the suffix "_m", we manually split some joints of characters in group A, so "_m" stands for modified. But here it is used as an identifier for characters in group A, which also means character without suffix "_m" is in group B.

We tried to build the test time code upon training time code but the latter one requires two groups to present. The hardcoded character name, they are "useless" for intra-structure test time, mainly as a placeholder. It can be any other character name in the same group.

TheCrazyT commented 4 years ago

I also modified the demo.py and wondered why it was expecting the animation file (like Baseball Pitching.bvh) for the destination character. I thought thats what it is supposed to generate based on the trained model?

I just placed a file inside with T-pose, but thats probably incorrect because it then leads to the following error:

Traceback (most recent call last):
  File "eval_single_pair.py", line 98, in <module>
    main()
  File "eval_single_pair.py", line 77, in main
    model = create_model(args, character_names, dataset)
  File "/content/deep-motion-editing/retargeting/models/__init__.py", line 5, in create_model
    return models.architecture.GAN_model(args, character_names, dataset)
  File "/content/deep-motion-editing/retargeting/models/architecture.py", line 23, in __init__
    model = IntegratedModel(args, dataset.joint_topologies[i], None, self.device, character_names[i])
  File "/content/deep-motion-editing/retargeting/models/integrated.py", line 40, in __init__
    self.auto_encoder = AE(args, topology=self.edges).to(device)
  File "/content/deep-motion-editing/retargeting/models/enc_and_dec.py", line 130, in __init__
    self.dec = Decoder(args, self.enc)
  File "/content/deep-motion-editing/retargeting/models/enc_and_dec.py", line 96, in __init__
    self.unpools.append(SkeletonUnpool(enc.pooling_list[args.num_layers - i - 1], in_channels // len(neighbor_list)))
  File "/content/deep-motion-editing/retargeting/models/skeleton.py", line 235, in __init__
    self.weight[j * channels_per_edge + c, i * channels_per_edge + c] = 1
IndexError: index 104 is out of bounds for dimension 0 with size 96
Fixing foot contact using IK...
100% 50/50 [00:01<00:00, 35.25it/s]

Maybe I just misunderstood the whole project. I thought you can just create animations for new models based on existing animations for different model-types.

PeizhuoLi commented 4 years ago

Requiring the animation file for the destination character is also because we're using training time code in test time, which will be fixed later. You can try to replace it with an animation file with the same HIERARCHY section but an arbitrary MOTION section, as long as the MOITON section have the same number of frames.

TheCrazyT commented 4 years ago

Well looks like I'm currently stuck. According to my script I have those characters:

Aj skeleton_type: 0 Mousey_m skeleton_type: 10 Goblin_m skeleton_type: 10 BigVegas skeleton_type: 0 Vampire_m skeleton_type: 10 Mremireh_m skeleton_type: 10 SportyGranny skeleton_type: 0 Kaya skeleton_type: 0

What i need is skeleton_type 2, but I guess there exist no pretrained data for those?

Maybe thats the reason i get( and similar errors using other characters): size mismatch for enc.layers.0.0.mask: copying a param with shape torch.Size([184, 92, 15]) from checkpoint, the shape in current model is torch.Size([152, 76, 15]). It is probably because skeleton_type does not match?

Edit: This info is mostly for me , but you can correct me if I'm wrong: Looking at that eval_prepare again ... i think that there are currently 2 trained "skeleton_type"s. Both are in pretrained folder and topology0 is skeleton_type=0.(or "group A") While topology1 is skeleton_type=10.(or "group B") so ... topology0 is character[0] and topology1 is character[1]. With the "_m" you encode the skeleton_type(or group) within the name itself to set it correctly. Not that a bad idea although i wonder why you did not used the skeleton_type as toplogy_number and as prefix for the character names. I guess it could be a bit cleaner that way.

PeizhuoLi commented 4 years ago

Regarding the pre-trained model settings, you are right. It was trained on skeleton_type=0 and skeleton_type=10.

I totally agree that changing the naming rules will be much clean. But in the cleaning work that we are doing now, we add an extra parameter in the eval_single_pair.py for user to manually specify the group of given character instead of using the character name trick, mainly considering in test time a network can only support two types of skeleton.