def __getitem__()

in contactopt/loader.py [0:0]


    def __getitem__(self, idx):
        sample = self.dataset[idx]

        out = dict()
        out['obj_faces'] = torch.Tensor(sample['ho_gt'].obj_faces)
        out['obj_sampled_idx'] = torch.Tensor(sample['obj_sampled_idx']).long()

        out['obj_verts_gt'] = torch.Tensor(sample['ho_gt'].obj_verts)
        out['obj_sampled_verts_gt'] = out['obj_verts_gt'][out['obj_sampled_idx'], :]
        out['obj_contact_gt'] = torch.Tensor(sample['ho_gt'].obj_contact)
        out['hand_contact_gt'] = torch.Tensor(sample['ho_gt'].hand_contact)
        out['hand_pose_gt'] = torch.Tensor(sample['ho_gt'].hand_pose)
        out['hand_beta_gt'] = torch.Tensor(sample['ho_gt'].hand_beta)
        out['hand_mTc_gt'] = torch.Tensor(sample['ho_gt'].hand_mTc)
        out['hand_verts_gt'] = torch.Tensor(sample['ho_gt'].hand_verts)

        out['obj_verts_aug'] = torch.Tensor(sample['ho_aug'].obj_verts)
        out['obj_sampled_verts_aug'] = out['obj_verts_aug'][out['obj_sampled_idx'], :]
        out['hand_pose_aug'] = torch.Tensor(sample['ho_aug'].hand_pose)
        out['hand_beta_aug'] = torch.Tensor(sample['ho_aug'].hand_beta)
        out['hand_mTc_aug'] = torch.Tensor(sample['ho_aug'].hand_mTc)
        out['hand_verts_aug'] = torch.Tensor(sample['ho_aug'].hand_verts)

        out['hand_feats_aug'] = torch.Tensor(sample['hand_feats_aug'])
        out['obj_feats_aug'] = torch.Tensor(sample['obj_feats_aug'])
        out['obj_normals_aug'] = torch.Tensor(sample['ho_aug'].obj_normals)

        if self.train:
            out['obj_sampled_verts_aug'] += torch.randn(out['obj_sampled_verts_aug'].shape) * self.aug_vert_jitter

        return out