found diff

This commit is contained in:
2023-03-30 13:44:59 +00:00
parent 0a65dbd75d
commit a27f5caf0c
4 changed files with 38 additions and 10 deletions
+5 -5
View File
@@ -1,10 +1,10 @@
import os
os.environ["CUDA_VISIBLE_DEVICES"] = '5'
os.environ["CUDA_VISIBLE_DEVICES"] = '7'
import numpy as np
from smpl_tf import SMPL as SMPL_tf
from smpl_torch import SMPL as SMPL_torch
from smpl_tf import SMPL as SMPL_tf
from utils import plot_mesh, plot_mesh_2
from time import time
@@ -17,7 +17,7 @@ if __name__ == '__main__':
smpl_tf : SMPL_tf = SMPL_tf('model_files')
smpl_torch : SMPL_torch = SMPL_torch(device=device, path='model_files')
np.random.seed(4444)
pose = ((np.random.rand(4, 72) - 0.5) * 0.4).astype(np.float32)
betas = ((np.random.rand(4, 10) - 0.5) * 0.06).astype(np.float32)
betas = np.concatenate((betas, np.array([0,1,0,1], dtype=np.float32)[:,None]), axis=1)
@@ -37,10 +37,10 @@ if __name__ == '__main__':
# plot_mesh(result[0].cpu().numpy(), model.f).show()
R = smpl_tf.run_rodrigues(pose)
result_tf, joints_torch, _, _ = smpl_tf.run(R, betas)
result_tf, joints_tf, _, _ = smpl_tf.run(R, betas)
s = time()
R = smpl_tf.run_rodrigues(pose)
result_tf, joints_torch, v_shaped_2, v_posed_2 = smpl_tf.run(R, betas)
result_tf, joints_tf, v_shaped_2, v_posed_2 = smpl_tf.run(R, betas)
print(time() - s)
result_torch = result_torch.cpu().numpy()