Add eval_dir args to specific evaluation directory

The default directory is test. Sometimes, we also need to evaluate the train-rendered images to compare the implications of different resolution parameters.
This commit is contained in:
Matt Li 2024-11-12 17:46:01 -05:00 committed by GitHub
parent 54c035f783
commit d7eeefa3e7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -33,7 +33,7 @@ def readImages(renders_dir, gt_dir):
image_names.append(fname) image_names.append(fname)
return renders, gts, image_names return renders, gts, image_names
def evaluate(model_paths): def evaluate(model_paths, eval_dir):
full_dict = {} full_dict = {}
per_view_dict = {} per_view_dict = {}
@ -49,7 +49,7 @@ def evaluate(model_paths):
full_dict_polytopeonly[scene_dir] = {} full_dict_polytopeonly[scene_dir] = {}
per_view_dict_polytopeonly[scene_dir] = {} per_view_dict_polytopeonly[scene_dir] = {}
test_dir = Path(scene_dir) / "test" test_dir = Path(scene_dir) / eval_dir
for method in os.listdir(test_dir): for method in os.listdir(test_dir):
print("Method:", method) print("Method:", method)
@ -99,5 +99,6 @@ if __name__ == "__main__":
# Set up command line argument parser # Set up command line argument parser
parser = ArgumentParser(description="Training script parameters") parser = ArgumentParser(description="Training script parameters")
parser.add_argument('--model_paths', '-m', required=True, nargs="+", type=str, default=[]) parser.add_argument('--model_paths', '-m', required=True, nargs="+", type=str, default=[])
parser.add_argument('--eval_dir', required=False, default="test", type=str)
args = parser.parse_args() args = parser.parse_args()
evaluate(args.model_paths) evaluate(args.model_paths, args.eval_dir)