1.The code used to measure the FPS in my code refers to the official script.
startTime = time.monotonic()
counter = 0
fps = 0
...
while True:
...
counter += 1
current_time = time.monotonic()
if (current_time - startTime) > 1:
fps = counter / (current_time - startTime)
counter = 0
startTime = current_time
...
cv2.putText(frame, "NN fps: {:.2f}".format(fps), (2, frame.shape[0] - 4), cv2.FONT_HERSHEY_TRIPLEX, 0.4, color)
2.The model I use for object detection was trained with YOLOv6, and the input size is 320.I have placed my model in Google Drive. You can access it through the following link: https://drive.google.com/file/d/1IBBZ1G9plWq77o01H24GI9mdWWw_DNJ4/view?usp=drive_link