MCPcopy
hub / github.com/zju3dv/4K4D / read_model

Function read_model

easyvolcap/utils/colmap_utils.py:451–470  ·  view source on GitHub ↗
(path, ext="")

Source from the content-addressed store, hash-verified

449
450
451def read_model(path, ext=""):
452 # try to detect the extension automatically
453 if ext == "":
454 if detect_model_format(path, ".bin"):
455 ext = ".bin"
456 elif detect_model_format(path, ".txt"):
457 ext = ".txt"
458 else:
459 print("Provide model format: '.bin' or '.txt'")
460 return
461
462 if ext == ".txt":
463 cameras = read_cameras_text(os.path.join(path, "cameras" + ext))
464 images = read_images_text(os.path.join(path, "images" + ext))
465 points3D = read_points3D_text(os.path.join(path, "points3D") + ext)
466 else:
467 cameras = read_cameras_binary(os.path.join(path, "cameras" + ext))
468 images = read_images_binary(os.path.join(path, "images" + ext))
469 points3D = read_points3D_binary(os.path.join(path, "points3D") + ext)
470 return cameras, images, points3D
471
472
473def write_model(cameras, images, points3D, path, ext=".bin"):

Callers 3

filter_colmap.pyFile · 0.90
merge_colmap.pyFile · 0.90

Calls 8

printFunction · 0.85
read_cameras_textFunction · 0.85
read_images_textFunction · 0.85
read_points3D_textFunction · 0.85
read_cameras_binaryFunction · 0.85
read_images_binaryFunction · 0.85
read_points3D_binaryFunction · 0.85
detect_model_formatFunction · 0.70

Tested by

no test coverage detected