From 4a85c5a4f7597791942cf3e25d1ad500d9511a82 Mon Sep 17 00:00:00 2001 From: Ethan Weber Date: Tue, 13 Dec 2022 21:12:17 +0000 Subject: [PATCH] small update --- nerfstudio/pipelines/base_pipeline.py | 2 ++ scripts/datasets/process_mipnerf360.py | 35 +++++++++++++++----------- 2 files changed, 22 insertions(+), 15 deletions(-) diff --git a/nerfstudio/pipelines/base_pipeline.py b/nerfstudio/pipelines/base_pipeline.py index 02d79d110..0bb77a29b 100644 --- a/nerfstudio/pipelines/base_pipeline.py +++ b/nerfstudio/pipelines/base_pipeline.py @@ -354,6 +354,7 @@ class VanillaPipeline(Pipeline): raise ValueError( "You must set datamanager.camera_optimizer.mode to optimize to optimize the camera poses." ) + # TODO: make this a parameter num_pose_iters = 100 for i in range(num_pose_iters): print("pose iter: ", i) @@ -369,6 +370,7 @@ class VanillaPipeline(Pipeline): # optimize appearance on half image if self.config.eval_optimize_appearance: + # TODO: make this a parameter num_appearance_iters = 100 side = random.choice([0, 1]) half_width = width // 2 diff --git a/scripts/datasets/process_mipnerf360.py b/scripts/datasets/process_mipnerf360.py index ef7996ce0..d4d039b79 100644 --- a/scripts/datasets/process_mipnerf360.py +++ b/scripts/datasets/process_mipnerf360.py @@ -29,15 +29,17 @@ from nerfstudio.utils.scripts import run_command # mipnerf 360 experiments splits = ["bicycle", "garden", "stump", "room", "counter", "kitchen", "bonsai"] # 7 splits -gpus = [0, 1, 3, 4, 5, 6, 7] +# method = "nerfacto" +method = "instant-ngp" +gpus = [0, 3, 6, 7, 8, 9, 3] commands = [] for split, gpu in zip(splits, gpus): - wandb_name = f"mipnerf360-{split}" + wandb_name = f"mipnerf360-{split}-{method}" command = " ".join( ( f"CUDA_VISIBLE_DEVICES={gpu}", - "ns-train nerfacto", + f"ns-train {method}", "--vis wandb", f"--wandb-name {wandb_name}", f"--data data/_prep/images/mipnerf360/processed/{split}", @@ -51,16 +53,19 @@ for split, gpu in zip(splits, gpus): ) print(command) commands.append(command) -# import subprocess -# import sys -# def f(cmd): -# out = subprocess.run(cmd, capture_output=False, shell=True, check=False) -# if out.returncode != 0: -# print(f"Error running command: {cmd}") -# sys.exit(1) -# if out.stdout is not None: -# return out.stdout.decode("utf-8") +import subprocess +import sys +def f(cmd): + out = subprocess.run(cmd, capture_output=False, shell=True, check=False) + if out.returncode != 0: + print(f"Error running command: {cmd}") + sys.exit(1) + if out.stdout is not None: + return out.stdout.decode("utf-8") -# from multiprocessing import Pool -# with Pool() as p: -# print(p.map(f, commands)) +from multiprocessing import Pool +with Pool() as p: + print(p.map(f, commands)) + + +# evaluation...