import torch
import pytorch3d
import fvcore
import iopath
print("PyTorch:", torch.__version__)
print("PyTorch3D:", pytorch3d.__version__)
print("fvcore:", fvcore.__version__)
print("iopath:", iopath.__version__)
print("CUDA available:", torch.cuda.is_available())
if torch.cuda.is_available():
print("CUDA version:", torch.version.cuda)
print("GPU:", torch.cuda.get_device_name(0))
print("Setup successful!")
$ python test.py
PyTorch: 2.7.1+cu128
PyTorch3D: 0.7.9
fvcore: 0.1.5.post20221221
iopath: 0.1.10
CUDA available: True
CUDA version: 12.8
GPU: NVIDIA A100-SXM4-40GB
Setup successful!
Each relative transformation is composed with the original camera extrinsics according to:
R = R_relative @ R_0
T = R_relative @ T_0 + T_relative
The four transformations, shown from left to right, are described below.
Transformation 1. Rotate 90° about the z-axisR_relative = [[ 0, 1, 0], T_relative = [0, 0, 0]
[-1, 0, 0],
[ 0, 0, 1]]
The relative rotation turns the camera by 90° about the z-axis while leaving its translation unchanged. As a result, the cow appears rotated within the image plane.
Transformation 2. Move the camera backwardR_relative = [[1, 0, 0], T_relative = [0, 0, 3]
[0, 1, 0],
[0, 0, 1]]
The identity rotation preserves the original camera orientation. The positive z-translation increases the camera's distance from the cow, so the cow occupies a smaller portion of the image.
Transformation 3. Translate the camera in the image planeR_relative = [[1, 0, 0], T_relative = [0.5, -0.5, 0]
[0, 1, 0],
[0, 0, 1]]
No additional rotation is applied. The translation changes the x- and y-components of the world-to-view transformation by +0.5 and -0.5, respectively, shifting the cow’s position in the rendered image.
Transformation 4. Rotate 90° about the y-axisR_relative = [[ 0, 0, 1], T_relative = [-3, 0, 3]
[ 0, 1, 0],
[-1, 0, 0]]
The relative rotation turns the camera by 90° about the y-axis, producinga side view of the cow. The additional translation repositions the camera so that the cow remains visible and stays approximately three units from the origin.