Avoid wrong path for windows user

This commit is contained in:
amcgi 2023-10-04 17:14:40 +02:00 committed by GitHub
parent 414b553ef1
commit f401aca104
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -131,13 +131,13 @@ def storePly(path, xyz, rgb):
def readColmapSceneInfo(path, images, eval, llffhold=8): def readColmapSceneInfo(path, images, eval, llffhold=8):
try: try:
cameras_extrinsic_file = os.path.join(path, "sparse/0", "images.bin") cameras_extrinsic_file = os.path.join(path, "sparse", "0", "images.bin")
cameras_intrinsic_file = os.path.join(path, "sparse/0", "cameras.bin") cameras_intrinsic_file = os.path.join(path, "sparse", "0", "cameras.bin")
cam_extrinsics = read_extrinsics_binary(cameras_extrinsic_file) cam_extrinsics = read_extrinsics_binary(cameras_extrinsic_file)
cam_intrinsics = read_intrinsics_binary(cameras_intrinsic_file) cam_intrinsics = read_intrinsics_binary(cameras_intrinsic_file)
except: except:
cameras_extrinsic_file = os.path.join(path, "sparse/0", "images.txt") cameras_extrinsic_file = os.path.join(path, "sparse", "0", "images.txt")
cameras_intrinsic_file = os.path.join(path, "sparse/0", "cameras.txt") cameras_intrinsic_file = os.path.join(path, "sparse", "0", "cameras.txt")
cam_extrinsics = read_extrinsics_text(cameras_extrinsic_file) cam_extrinsics = read_extrinsics_text(cameras_extrinsic_file)
cam_intrinsics = read_intrinsics_text(cameras_intrinsic_file) cam_intrinsics = read_intrinsics_text(cameras_intrinsic_file)
@ -154,9 +154,9 @@ def readColmapSceneInfo(path, images, eval, llffhold=8):
nerf_normalization = getNerfppNorm(train_cam_infos) nerf_normalization = getNerfppNorm(train_cam_infos)
ply_path = os.path.join(path, "sparse/0/points3D.ply") ply_path = os.path.join(path, "sparse", "0", "points3D.ply")
bin_path = os.path.join(path, "sparse/0/points3D.bin") bin_path = os.path.join(path, "sparse", "0", "points3D.bin")
txt_path = os.path.join(path, "sparse/0/points3D.txt") txt_path = os.path.join(path, "sparse", "0", "points3D.txt")
if not os.path.exists(ply_path): if not os.path.exists(ply_path):
print("Converting point3d.bin to .ply, will happen only the first time you open the scene.") print("Converting point3d.bin to .ply, will happen only the first time you open the scene.")
try: try: