CalciferZh / SMPL

NumPy, TensorFlow and PyTorch implementation of human body SMPL model and infant body SMIL model.
MIT License
881 stars 138 forks source link

there seems no great improvement with SMIL #60

Closed Charlulote closed 2 years ago

Charlulote commented 3 years ago

testing with cpu, i got this.

    model = SMIL(sparse=sparse).to(device, dtype, non_blocking=True)
    for i in range(3):
        pose = torch.from_numpy((np.random.rand(batch_size, pose_size) - 0.5) * 0.4) \
            .type(dtype).to(device)
        betas = torch.from_numpy((np.random.rand(batch_size, beta_size) - 0.5) * 0.06) \
            .type(dtype).to(device)
        trans = torch.from_numpy(np.zeros((batch_size, 3))).type(dtype).to(device)
        s = time()
        result, joints = model(betas, pose, trans)
        print(time() - s)
-----------------------
0.009973764419555664
0.008975744247436523
0.007978677749633789

And do the same with smpl.

0.014949560165405273
0.008976459503173828
0.00797891616821289

Is there anything wrong or misunderstood?

CalciferZh commented 2 years ago

Transferring data to and from gpu may take some time. Having batched input may also make some difference.