(model_refine, output_3D, input_2D, gt_3D, batch_cam, pad, root_joint)
| 57 | |
| 58 | |
| 59 | def refine_model(model_refine, output_3D, input_2D, gt_3D, batch_cam, pad, root_joint): |
| 60 | input_2D_single = input_2D[:, pad, :, :].unsqueeze(1) |
| 61 | |
| 62 | if output_3D.size(1) > 1: |
| 63 | output_3D_single = output_3D[:, pad, :, :].unsqueeze(1) |
| 64 | else: |
| 65 | output_3D_single = output_3D |
| 66 | |
| 67 | if gt_3D.size(1) > 1: |
| 68 | gt_3D_single = gt_3D[:, pad, :, :].unsqueeze(1) |
| 69 | else: |
| 70 | gt_3D_single = gt_3D |
| 71 | |
| 72 | uvd = torch.cat((input_2D_single, output_3D_single[:, :, :, 2].unsqueeze(-1)), -1) |
| 73 | xyz = get_uvd2xyz(uvd, gt_3D_single, batch_cam) |
| 74 | xyz[:, :, root_joint, :] = 0 |
| 75 | refine_out = model_refine(output_3D_single, xyz) |
| 76 | |
| 77 | return refine_out |
| 78 |
no test coverage detected