skhu101 / GauHuman

Code for our CVPR'2024 paper "GauHuman: Articulated Gaussian Splatting from Monocular Human Videos"
Other
339 stars 29 forks source link

about new observation rendering #29

Closed HandSomeWay closed 6 months ago

HandSomeWay commented 7 months ago

Hi,I want to render all the resulting images with a fixed camera, Here is my code, i just change the parameters about the camera

# lights is the fixed camera
    if lights is not None:
        # Set up rasterization configuration
        tanfovx = math.tan(lights[0].FoVx * 0.5)
        tanfovy = math.tan(lights[0].FoVy * 0.5)

        raster_settings = GaussianRasterizationSettings(
            image_height=int(lights[0].height),# change
            image_width=int(lights[0].width),# change
            tanfovx=tanfovx,   # change
            tanfovy=tanfovy,
            bg=bg_color,
            scale_modifier=scaling_modifier,
            viewmatrix=lights[0].viewmatrix,# change
            projmatrix=lights[0].projmatrix,# change
            sh_degree=pc.active_sh_degree,
            campos=lights[0].position,# change
            prefiltered=False,
            debug=pipe.debug
        )

    else:
        # Set up rasterization configuration
        tanfovx = math.tan(viewpoint_camera.FoVx * 0.5)
        tanfovy = math.tan(viewpoint_camera.FoVy * 0.5)

        raster_settings = GaussianRasterizationSettings(
            image_height=int(viewpoint_camera.image_height),
            image_width=int(viewpoint_camera.image_width),
            tanfovx=tanfovx,
            tanfovy=tanfovy,
            bg=bg_color,
            scale_modifier=scaling_modifier,
            viewmatrix=viewpoint_camera.world_view_transform,
            projmatrix=viewpoint_camera.full_proj_transform,
            sh_degree=pc.active_sh_degree,
            campos=viewpoint_camera.camera_center,
            prefiltered=False,
            debug=pipe.debug
        )

    rasterizer = GaussianRasterizer(raster_settings=raster_settings)

and i got some missing in results image image image

could you tell me how to deal with it?

skhu101 commented 7 months ago

Hi, one solution is to use the lookat camera. I've attached the code for you to look over. You can set the novel_view_vis flag to be True to enable this function. ZJUMoCapRefine_lookat_camera.py.zip

HandSomeWay commented 7 months ago

Thanks a lot! I will try it