mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-11-27 19:40:17 +08:00
update benchmarking; add clip to mipnerf lpips
This commit is contained in:
1 parent
d0f0f8da2d
commit
39b67e6fe9
2 files changed
+3
-5
No files matched your search
@@ -173,7 +173,7 @@ class MipNerfGraph(Graph):
|
|||||||
coarse_psnr = self.psnr(image, rgb_coarse)
|
coarse_psnr = self.psnr(image, rgb_coarse)
|
||||||
fine_psnr = self.psnr(image, rgb_fine)
|
fine_psnr = self.psnr(image, rgb_fine)
|
||||||
fine_ssim = self.ssim(image, rgb_fine)
|
fine_ssim = self.ssim(image, rgb_fine)
|
||||||
fine_lpips = self.lpips(image, rgb_fine)
|
fine_lpips = self.lpips(image, torch.clip(rgb_fine, min=-1, max=1))
|
||||||
|
|
||||||
writer.put_scalar(name=f"psnr/val_{image_idx}-coarse", scalar=float(coarse_psnr), step=step)
|
writer.put_scalar(name=f"psnr/val_{image_idx}-coarse", scalar=float(coarse_psnr), step=step)
|
||||||
writer.put_scalar(name=f"psnr/val_{image_idx}-fine", scalar=float(fine_psnr), step=step)
|
writer.put_scalar(name=f"psnr/val_{image_idx}-fine", scalar=float(fine_psnr), step=step)
|
||||||
|
|||||||
@@ -55,8 +55,6 @@ def _load_hydra_config(hydra_dir: str) -> DictConfig:
|
|||||||
hydra_dir = f"{hydra_dir}/{basename}"
|
hydra_dir = f"{hydra_dir}/{basename}"
|
||||||
initialize(config_path=os.path.join("../../", hydra_dir, ".hydra/"))
|
initialize(config_path=os.path.join("../../", hydra_dir, ".hydra/"))
|
||||||
config = compose("config.yaml")
|
config = compose("config.yaml")
|
||||||
## set the tensorboard to a /tmp/ output file for now
|
|
||||||
config.logging.writer.TensorboardWriter.log_dir = "/tmp/"
|
|
||||||
return config
|
return config
|
||||||
|
|
||||||
|
|
||||||
@@ -81,7 +79,7 @@ def main(args):
|
|||||||
"meta info": {"graph": args.graph, "benchmark_date": args.benchmark_date, "hydra": args.hydra_base_dir},
|
"meta info": {"graph": args.graph, "benchmark_date": args.benchmark_date, "hydra": args.hydra_base_dir},
|
||||||
"results": benchmarks,
|
"results": benchmarks,
|
||||||
}
|
}
|
||||||
json_file = os.path.join(args.hydra_base_dir, f"{args.timestamp}.json")
|
json_file = os.path.join(args.hydra_base_dir, f"{args.benchmark_date}.json")
|
||||||
with open(json_file, "w", encoding="utf8") as f:
|
with open(json_file, "w", encoding="utf8") as f:
|
||||||
json.dump(benchmark_info, f, indent=2)
|
json.dump(benchmark_info, f, indent=2)
|
||||||
logging.info("saved benchmark results to %s", json_file)
|
logging.info("saved benchmark results to %s", json_file)
|
||||||
@@ -91,6 +89,6 @@ if __name__ == "__main__":
|
|||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
parser.add_argument("-g", "--graph", type=str, required=True, help="name of nerf graph to benchmark")
|
parser.add_argument("-g", "--graph", type=str, required=True, help="name of nerf graph to benchmark")
|
||||||
parser.add_argument("-d", "--benchmark_date", type=str, required=True, help="timestamp of run to benchmark")
|
parser.add_argument("-d", "--benchmark_date", type=str, required=True, help="timestamp of run to benchmark")
|
||||||
parser.add_argument("-h", "--hydra_base_dir", type=str, required=True, help="hydra base output path")
|
parser.add_argument("-o", "--hydra_base_dir", type=str, default="outputs/", help="hydra base output path")
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
main(args)
|
main(args)
|
||||||
Reference in new issue
Block a user