Shortcuts

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)[源代码]

The interface to build and execute webcam applications from configs.

参数
  • nodes (list[dict]) – Node configs. See webcam.nodes.Node for details

  • name (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)[源代码]

Initialize self. See help(type(self)) for accurate signature.

Methods

__init__(nodes[, name, camera_id, …])

Initialize self.

run()

Start the executor.

Read the Docs v: latest
Versions
latest
1.x
v1.0.0rc0
v0.29.0
v0.28.0
v0.27.0
dev-1.x
Downloads
pdf
html
epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.