mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-12-04 23:08:44 +08:00
Making install_checks use colmap_cmd (#3204)
check_colmap_installed() in nerfstudio.utils.install_checks.py previously didn't use the colmap_cmd attribute of ColmapConverterToNerfstudioDataset. This change addresses that so an alternative colmap_cmd can actually be used
This commit is contained in:
1 parent
012a47d8b0
commit
d220600b8b
2 files changed
+5
-4
No files matched your search
@@ -246,7 +246,7 @@ class ColmapConverterToNerfstudioDataset(BaseConverterToNerfstudioDataset):
|
|||||||
def __post_init__(self) -> None:
|
def __post_init__(self) -> None:
|
||||||
super().__post_init__()
|
super().__post_init__()
|
||||||
install_checks.check_ffmpeg_installed()
|
install_checks.check_ffmpeg_installed()
|
||||||
install_checks.check_colmap_installed()
|
install_checks.check_colmap_installed(self.colmap_cmd)
|
||||||
|
|
||||||
if self.crop_bottom < 0.0 or self.crop_bottom > 1:
|
if self.crop_bottom < 0.0 or self.crop_bottom > 1:
|
||||||
raise RuntimeError("crop_bottom must be set between 0 and 1.")
|
raise RuntimeError("crop_bottom must be set between 0 and 1.")
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
"""Helpers for checking if programs are installed"""
|
"""Helpers for checking if programs are installed"""
|
||||||
|
|
||||||
import shutil
|
import shutil
|
||||||
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from nerfstudio.utils.rich_utils import CONSOLE
|
from nerfstudio.utils.rich_utils import CONSOLE
|
||||||
@@ -29,10 +30,10 @@ def check_ffmpeg_installed():
|
|||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
def check_colmap_installed():
|
def check_colmap_installed(colmap_cmd: str):
|
||||||
"""Checks if colmap is installed."""
|
"""Checks if colmap is installed."""
|
||||||
colmap_path = shutil.which("colmap")
|
out = subprocess.run(f"{colmap_cmd} -h", capture_output=True, shell=True, check=False)
|
||||||
if colmap_path is None:
|
if out.returncode != 0:
|
||||||
CONSOLE.print("[bold red]Could not find COLMAP. Please install COLMAP.")
|
CONSOLE.print("[bold red]Could not find COLMAP. Please install COLMAP.")
|
||||||
print("See https://colmap.github.io/install.html for installation instructions.")
|
print("See https://colmap.github.io/install.html for installation instructions.")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|||||||
Reference in new issue
Block a user