David
David

Reputation: 75

YoloV5s How to output FPS from inference time

New to Yolo and python, I'm using the PyTorch detect.py script from

https://github.com/ultralytics/yolov5/blob/master/detect.py

and I want to output the FPS.

When I run my model I get the inference time of the detection per frame. (I'm assuming). the output range between 1.5 to 1.7 s

How can I convert the inference time estimate to FPS? or output the FPS using this code?

Thanks in advance.

Upvotes: 2

Views: 6152

Answers (1)

Louis Lac
Louis Lac

Reputation: 6436

The definition of FPS is 1 / inference_time, just compute this value. In your case, with an inference time of around 1.5 s, you should obtain around 0.66 fps.

Upvotes: 2

Related Questions