Shortcuts

mmpose.apis.webcam.utils.limit_max_fps

mmpose.apis.webcam.utils.limit_max_fps(fps: float)[源代码]

A context manager to limit maximum frequence of entering the context.

参数

fps (float) – The maximum frequence of entering the context

Example::
>>> from mmpose.apis.webcam.utils import limit_max_fps
>>> import cv2
>>> while True:
...     with limit_max_fps(20):
...         cv2.imshow(img)  # display image at most 20 fps