Skip to content

FPS measurement on Jetson xavier NX (8gb) #5

@sshhj89

Description

@sshhj89

Hi,

Your publication is interesting and I would like to reproduce result especially about FPS.

This is my code to measure the FPS

from core.models.cabinet import CABiNet
import torch
import time
import numpy as np
from ptflops import get_model_complexity_info

net = CABiNet(n_classes=19, backbone_weights="core/models/pretrained_backbones/mobilenetv3-small-55df8e1f.pth")
net.cuda()
net.eval()

time_avg = []
for i in range(0,120):
# imgs = imgs.cuda()
imgs = torch.randn(1, 3, 1024, 1024, requires_grad=False).cuda()
print("imgs size: ",imgs.shape)
start_time = time.time()
out = net(imgs)[0]

torch.cuda.synchronize()

end_time = time.time()
print("out size: ",out.shape)
print("time: ", end_time-start_time)
time_avg.append(end_time-start_time)

print("avg time: ", np.mean(time_avg[10:-10]))

I was wondering that it is about 8fps with 2048x1024 resolution.
However, with my device, I cannot reproduce the result of FPS with 1024x2048 resolution and can measure the FPS of 8 fps 1024x1024 image resolution.

Could you help the measurement codes?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions