Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The Implementation For the FPS Measurement #37

Open
tingzhongyue opened this issue Sep 29, 2024 · 1 comment
Open

The Implementation For the FPS Measurement #37

tingzhongyue opened this issue Sep 29, 2024 · 1 comment

Comments

@tingzhongyue
Copy link

Thank you for your great work and contribution.

I would like to ask about the code range for measuring FPS.

Did you measure the time of the render function or just the time of the rasterizer?

@Kevin-2017
Copy link
Collaborator

We render the time with the render function. Below are the code snippets. :)

def measure_fps(view, gaussians, pipe, background):
    t1_start = perf_counter() 
    render_pkg = render(view, gaussians, pipe, background)
    t1_stop = perf_counter()
    time = t1_stop - t1_start
    return time


def get_fps(dataset, opt, pipe, checkpoint, args):
    ic("fps")
    first_iter = 0
    tb_writer = prepare_output_and_logger(dataset)
    gaussians = GaussianModel(dataset.sh_degree)
    scene = Scene(dataset, gaussians)
    gaussians.training_setup(opt)
    if checkpoint:
        (model_params, _) = torch.load(checkpoint)
        gaussians.restore(model_params, opt)

    bg_color = [1, 1, 1] if dataset.white_background else [0, 0, 0]
    background = torch.tensor(bg_color, dtype=torch.float32, device="cuda")
    first_iter += 1
    test_camera = scene.getTestCameras().copy().pop()
    t_list = [0]*1000
    for i in range(1000):
        t_list[i] = measure_fps(test_camera, gaussians, pipe, background)
    t_list.sort()
    t_list = t_list[100:900]
    fps = 1 / t_list.mean
    ic(fps)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants