Skip to content
Snippets Groups Projects
Commit be224c1c authored by Thomas Müller's avatar Thomas Müller
Browse files

`colmap2nerf.py`: only download ffmpeg and colmap if not installed system-wide

parent 198a6ef3
No related branches found
No related tags found
No related merge requests found
...@@ -54,7 +54,9 @@ def do_system(arg): ...@@ -54,7 +54,9 @@ def do_system(arg):
def run_ffmpeg(args): def run_ffmpeg(args):
ffmpeg_binary = "ffmpeg" ffmpeg_binary = "ffmpeg"
if os.name == 'nt':
# On Windows, if FFmpeg isn't found, try automatically downloading it from the internet
if os.name == "nt" and os.system(f"where {ffmpeg_binary} >nul 2>nul") != 0:
ffmpeg_glob = os.path.join(ROOT_DIR, "external", "ffmpeg", "*", "bin", "ffmpeg.exe") ffmpeg_glob = os.path.join(ROOT_DIR, "external", "ffmpeg", "*", "bin", "ffmpeg.exe")
candidates = glob(ffmpeg_glob) candidates = glob(ffmpeg_glob)
if not candidates: if not candidates:
...@@ -90,7 +92,9 @@ def run_ffmpeg(args): ...@@ -90,7 +92,9 @@ def run_ffmpeg(args):
def run_colmap(args): def run_colmap(args):
colmap_binary = "colmap" colmap_binary = "colmap"
if os.name == 'nt':
# On Windows, if FFmpeg isn't found, try automatically downloading it from the internet
if os.name == "nt" and os.system(f"where {colmap_binary} >nul 2>nul") != 0:
colmap_glob = os.path.join(ROOT_DIR, "external", "colmap", "*", "COLMAP.bat") colmap_glob = os.path.join(ROOT_DIR, "external", "colmap", "*", "COLMAP.bat")
candidates = glob(colmap_glob) candidates = glob(colmap_glob)
if not candidates: if not candidates:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment