Reduce GPU memory usage: Decouple computing metrics from generating images
In evaluation, calling get_image_metrics_and_images eats up memory very quickly (16 GB GPU memory is not enough even to start evaluation, program crashes when using the provided eval bash script on Blender dataset). This is because generating rgb images, depth maps, and accumulation maps takes lots of GPU memory.
One possible resolution is to pass in a boolean through the function signature below to optionally generate the images:
https://github.com/nerfstudio-project/nerfstudio/blob/9bed69601f7497023fb2237a8cea5897e3492b72/nerfstudio/models/nerfacto.py#L254-L256
The user of this function should have a good idea about what they want to get out of this function when calling this function. If they don't need the images, they don't have to generate them.
And variables like combined_rgb, depth, combined_depth, acc, combined_acc, and the whole images_dict should be moved to CPU to reduce GPU memory usage if they are generated at all.