MCPcopy Create free account
hub / github.com/Vegetebird/GraphMLP / refine_model

Function refine_model

model/block/refine.py:59–77  ·  view source on GitHub ↗
(model_refine, output_3D, input_2D, gt_3D, batch_cam, pad, root_joint)

Source from the content-addressed store, hash-verified

57
58
59def 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

Callers 2

trainFunction · 0.90
testFunction · 0.90

Calls 1

get_uvd2xyzFunction · 0.85

Tested by

no test coverage detected