full_eval.py 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. #
  2. # Copyright (C) 2023, Inria
  3. # GRAPHDECO research group, https://team.inria.fr/graphdeco
  4. # All rights reserved.
  5. #
  6. # This software is free for non-commercial, research and evaluation use
  7. # under the terms of the LICENSE.md file.
  8. #
  9. # For inquiries contact george.drettakis@inria.fr
  10. #
  11. import os
  12. from argparse import ArgumentParser
  13. mipnerf360_outdoor_scenes = ["bicycle", "flowers", "garden", "stump", "treehill"]
  14. mipnerf360_indoor_scenes = ["room", "counter", "kitchen", "bonsai"]
  15. tanks_and_temples_scenes = ["truck", "train"]
  16. deep_blending_scenes = ["drjohnson", "playroom"]
  17. parser = ArgumentParser(description="Full evaluation script parameters")
  18. parser.add_argument("--skip_training", action="store_true")
  19. parser.add_argument("--skip_rendering", action="store_true")
  20. parser.add_argument("--skip_metrics", action="store_true")
  21. parser.add_argument("--output_path", default="./eval")
  22. args, _ = parser.parse_known_args()
  23. all_scenes = []
  24. all_scenes.extend(mipnerf360_outdoor_scenes)
  25. all_scenes.extend(mipnerf360_indoor_scenes)
  26. all_scenes.extend(tanks_and_temples_scenes)
  27. all_scenes.extend(deep_blending_scenes)
  28. if not args.skip_training or not args.skip_rendering:
  29. parser.add_argument('--mipnerf360', "-m360", required=True, type=str)
  30. parser.add_argument("--tanksandtemples", "-tat", required=True, type=str)
  31. parser.add_argument("--deepblending", "-db", required=True, type=str)
  32. args = parser.parse_args()
  33. if not args.skip_training:
  34. common_args = " --quiet --eval --test_iterations -1 "
  35. for scene in mipnerf360_outdoor_scenes:
  36. source = args.mipnerf360 + "/" + scene
  37. os.system("python train.py -s " + source + " -i images_4 -m " + args.output_path + "/" + scene + common_args)
  38. for scene in mipnerf360_indoor_scenes:
  39. source = args.mipnerf360 + "/" + scene
  40. os.system("python train.py -s " + source + " -i images_2 -m " + args.output_path + "/" + scene + common_args)
  41. for scene in tanks_and_temples_scenes:
  42. source = args.tanksandtemples + "/" + scene
  43. os.system("python train.py -s " + source + " -m " + args.output_path + "/" + scene + common_args)
  44. for scene in deep_blending_scenes:
  45. source = args.deepblending + "/" + scene
  46. os.system("python train.py -s " + source + " -m " + args.output_path + "/" + scene + common_args)
  47. if not args.skip_rendering:
  48. all_sources = []
  49. for scene in mipnerf360_outdoor_scenes:
  50. all_sources.append(args.mipnerf360 + "/" + scene)
  51. for scene in mipnerf360_indoor_scenes:
  52. all_sources.append(args.mipnerf360 + "/" + scene)
  53. for scene in tanks_and_temples_scenes:
  54. all_sources.append(args.tanksandtemples + "/" + scene)
  55. for scene in deep_blending_scenes:
  56. all_sources.append(args.deepblending + "/" + scene)
  57. common_args = " --quiet --eval --skip_train"
  58. for scene, source in zip(all_scenes, all_sources):
  59. os.system("python render.py --iteration 7000 -s " + source + " -m " + args.output_path + "/" + scene + common_args)
  60. os.system("python render.py --iteration 30000 -s " + source + " -m " + args.output_path + "/" + scene + common_args)
  61. if not args.skip_metrics:
  62. scenes_string = ""
  63. for scene in all_scenes:
  64. scenes_string += "\"" + args.output_path + "/" + scene + "\" "
  65. os.system("python metrics.py -m " + scenes_string)