Pytorch3d 使用pytorch3d.renderer.PerspectiveCameras

使用自己的相机参数,记得设置in_ndc=False

原本写法:

    cameras = pytorch3d.renderer.PerspectiveCameras(image_size=(height, width),device=device,focal_length=((cams['fx'],cams['fy']),),principal_point=((cams['center_x'],cams['center_y']),),in_ndc=False)

错误信息:

ValueError: Wrong number (2) of cameras for 1 meshes

正确写法:

    cameras = pytorch3d.renderer.PerspectiveCameras(image_size=((height, width),),device=device,focal_length=((cams['fx'],cams['fy']),),principal_point=((cams['center_x'],cams['center_y']),),in_ndc=False)

主要区别在于image_size=部分的写法

你可能感兴趣的:(pytorch,3d,人工智能,ubuntu,python,深度学习)