mmpose.apis.webcam.nodes.ObjectAssignerNode¶
- class mmpose.apis.webcam.nodes.ObjectAssignerNode(name: str, frame_buffer: str, object_buffer: str, output_buffer: Union[str, List[str]])[源代码]¶
Assign the object information to the frame message.
ObjectAssignerNode
enables asynchronous processing of model inference and video I/O, so the video will be captured and displayed smoothly regardless of the model inference speed. Specifically,ObjectAssignerNode
takes messages from both model branch and video I/O branch as its input, indicated as “object message” and “frame message” respectively. When an object message arrives it will update the latest object information; and when a frame message arrives, it will be assigned with the latest object information and output.Specially, if the webcam executor is set to synchrounous mode, the behavior of
ObjectAssignerNode
will be different: When an object message arrives, it will trigger an output of itself; and the frame messages will be ignored.- 参数
name (str) – The node name (also thread name)
frame_buffer (str) – Buffer name for frame messages
object_buffer (str) – Buffer name for object messages
output_buffer (str) – The name(s) of the output buffer(s)
- Example::
>>> cfg =dict( ... type='ObjectAssignerNode', ... name='object assigner', ... frame_buffer='_frame_', ... # `_frame_` is an executor-reserved buffer ... object_buffer='animal_pose', ... output_buffer='frame')
>>> from mmpose.apis.webcam.nodes import NODES >>> node = NODES.build(cfg)