mmpose.apis.webcam.WebcamExecutor¶
- class mmpose.apis.webcam.WebcamExecutor(nodes: List[Dict], name: str = 'MMPose Webcam App', camera_id: Union[int, str] = 0, camera_max_fps: int = 30, camera_frame_shape: Optional[Tuple[int, int]] = None, synchronous: bool = False, buffer_sizes: Optional[Dict[str, int]] = None)[source]¶
The interface to build and execute webcam applications from configs.
- Parameters
nodes (list[dict]) – Node configs. See
webcam.nodes.Node
for detailsname (str) – Executor name. Default: ‘MMPose Webcam App’.
camera_id (int | str) – The camera ID (usually the ID of the default camera is 0). Alternatively a file path or a URL can be given to load from a video or image file.
camera_frame_shape (tuple, optional) – Set the frame shape of the camera in (width, height). If not given, the default frame shape will be used. This argument is only valid when using a camera as the input source. Default:
None
camera_max_fps (int) – Video reading maximum FPS. Default: 30
buffer_sizes (dict, optional) – A dict to specify buffer sizes. The key is the buffer name and the value is the buffer size. Default:
None
- Example::
>>> cfg = dict( >>> name='Test Webcam', >>> camera_id=0, >>> camera_max_fps=30, >>> nodes=[ >>> dict( >>> type='MonitorNode', >>> name='monitor', >>> enable_key='m', >>> enable=False, >>> input_buffer='_frame_', >>> output_buffer='display'), >>> dict( >>> type='RecorderNode', >>> name='recorder', >>> out_video_file='webcam_output.mp4', >>> input_buffer='display', >>> output_buffer='_display_') >>> ])
>>> executor = WebcamExecutor(**cfg)
- __init__(nodes: List[Dict], name: str = 'MMPose Webcam App', camera_id: Union[int, str] = 0, camera_max_fps: int = 30, camera_frame_shape: Optional[Tuple[int, int]] = None, synchronous: bool = False, buffer_sizes: Optional[Dict[str, int]] = None)[source]¶
Initialize self. See help(type(self)) for accurate signature.
Methods
__init__
(nodes[, name, camera_id, …])Initialize self.
run
()Start the executor.