hustvl / 4DGaussians

[CVPR 2024] 4D Gaussian Splatting for Real-Time Dynamic Scene Rendering
https://guanjunwu.github.io/4dgs/
Apache License 2.0
2.25k stars 187 forks source link

how to render dynerf dataset #81

Closed lihongyi1234 closed 9 months ago

lihongyi1234 commented 9 months ago

hello, i have train dynerf dataset cook_spinach success. how can i render it

guanjunwu commented 9 months ago

Hi, this command: python render.py --model_path "output/dynerf/cook_spinach/" --skip_train --configs arguments/dynerf/default.py check your saved model&config path is correct to this model and config path

lihongyi1234 commented 9 months ago

image

Hi, I am sorry to interrupt you, I render the dynerf dataset cook_spinach failed, what's the problem is. I use the command you recommended

guanjunwu commented 9 months ago

Hi, can you show your training command and error log?

lihongyi1234 commented 9 months ago

this is my train configuration: image

this is my render error log: (pt1.13) lhy@PS-02:~/projects/4DGaussians$ python render.py --model_path "output/dynerf/cook_spinach/" --skip_train --configs arguments/dynerf/cook_spinach.py Looking for config file in output/dynerf/cook_spinach/cfg_args Config file found: output/dynerf/cook_spinach/cfg_args Rendering output/dynerf/cook_spinach/ feature_dim: 32 [10/02 19:04:11] Loading trained model at iteration 14000 [10/02 19:04:11] Reading camera 21/21 [10/02 19:04:18] Loading Training Cameras [10/02 19:04:19] Loading Test Cameras [10/02 19:04:19] Loading Video Cameras [10/02 19:04:19] Deformation Net Set aabb [ 98.39525 52.62214 432.66077] [-1.0754413e+02 -5.2726383e+01 7.2565190e-02] [10/02 19:04:19] Voxel Plane: set aabb= Parameter containing: tensor([[ 9.8395e+01, 5.2622e+01, 4.3266e+02], [-1.0754e+02, -5.2726e+01, 7.2565e-02]]) [10/02 19:04:19] loading model from existsoutput/dynerf/cook_spinach/point_cloud/iteration_14000 [10/02 19:04:22] point nums: 173935 [10/02 19:04:22] Rendering progress: 100%|█████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.18it/s] FPS: 0.7971460666192101 [10/02 19:04:24] IMAGEIO FFMPEG_WRITER WARNING: input image is not divisible by macro_block_size=16, resizing from (2400, 1799) to (2400, 1808) to ensure video compatibility with most codecs and players. To prevent resizing, make your input image divisible by the macro_block_size or set the macro_block_size to 1 (risking incompatibility). Traceback (most recent call last): File "/home/lhy/projects/4DGaussians/render.py", line 126, in render_sets(model.extract(args), hyperparam.extract(args), args.iteration, pipeline.extract(args), args.skip_train, args.skip_test, args.skip_video) File "/home/lhy/projects/4DGaussians/render.py", line 99, in render_sets render_set(dataset.model_path, "test", scene.loaded_iter, scene.getTestCameras(), gaussians, pipeline, background,cam_type) File "/home/lhy/projects/4DGaussians/render.py", line 86, in render_set imageio.mimwrite(os.path.join(modelpath, name, "ours{}".format(iteration), 'video_rgb.mp4'), render_images, fps=30) File "/home/lhy/software/anaconda/ENTER/envs/pt1.13/lib/python3.9/site-packages/imageio/v2.py", line 495, in mimwrite return file.write(ims, is_batch=True, **kwargs) File "/home/lhy/software/anaconda/ENTER/envs/pt1.13/lib/python3.9/site-packages/imageio/core/legacy_plugin_wrapper.py", line 253, in write writer.append_data(image, metadata) File "/home/lhy/software/anaconda/ENTER/envs/pt1.13/lib/python3.9/site-packages/imageio/core/format.py", line 590, in append_data return self._append_data(im, total_meta) File "/home/lhy/software/anaconda/ENTER/envs/pt1.13/lib/python3.9/site-packages/imageio/plugins/ffmpeg.py", line 591, in _append_data raise ValueError("All images in a movie should have same size") ValueError: All images in a movie should have same size

guanjunwu commented 9 months ago

emmm it seems like the problem is the version of imgaeio you can check the shape of rendered image first(because the error said All images in a movie should have same size) ,then try the other version of imageio or other video writer, such as opencv.videowriter

lihongyi1234 commented 9 months ago

![Uploading image.png…]()

render_image size looks different, is that right?

lihongyi1234 commented 9 months ago

微信图片_20240218094658

lihongyi1234 commented 9 months ago

render_images render_images[0].shape = (1799, 2400, 3), render_images[1].shape = (1800, 2400, 3), render_images[2].shape=(1799, 2400, 3). picture size is not different, it seems resize first