scripts/preprocess_amass_3dpw.py [151:165]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        n_frames = poses.shape[0]
        n_shards = n_frames // max_possible_len
        joints = []
        for j in range(n_shards+1):
            sf = j*max_possible_len
            ef = None if j == n_shards else (j+1)*max_possible_len
            with torch.no_grad():
                ps = torch.from_numpy(poses[sf:ef]).to(dtype=torch.float32, device=C.DEVICE)
                ts = torch.from_numpy(trans[sf:ef]).to(dtype=torch.float32, device=C.DEVICE)
                bs = torch.from_numpy(betas).to(dtype=torch.float32, device=C.DEVICE)
                _, js = smpl_layer(poses_body=ps[:, 3:], betas=bs, poses_root=ps[:, :3], trans=ts)
                joints.append(js[:, :(1 + C.N_JOINTS)].reshape(-1, (1 + C.N_JOINTS)*3).detach().cpu().numpy())

        joints = np.concatenate(joints, axis=0)  # (N_FRAMES, 66)
        assert joints.shape[0] == n_frames
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



scripts/preprocess_amass_3dpw.py [218:233]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
            n_frames = poses.shape[0]

            n_shards = n_frames // max_possible_len
            joints = []
            for j in range(n_shards+1):
                sf = j*max_possible_len
                ef = None if j == n_shards else (j+1)*max_possible_len
                with torch.no_grad():
                    ps = torch.from_numpy(poses[sf:ef]).to(dtype=torch.float32, device=C.DEVICE)
                    ts = torch.from_numpy(trans[sf:ef]).to(dtype=torch.float32, device=C.DEVICE)
                    bs = torch.from_numpy(betas).to(dtype=torch.float32, device=C.DEVICE)
                    _, js = smpl_layer(poses_body=ps[:, 3:], betas=bs, poses_root=ps[:, :3], trans=ts)
                    joints.append(js[:, :(1 + C.N_JOINTS)].reshape(-1, (1 + C.N_JOINTS)*3).detach().cpu().numpy())

            joints = np.concatenate(joints, axis=0)  # (N_FRAMES, 66)
            assert joints.shape[0] == n_frames
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



