mp.tasks.vision.drawing_utils.draw_detection
Stay organized with collections
Save and categorize content based on your preferences.
Draws the detction bounding box and keypoints on the image.
mp.tasks.vision.drawing_utils.draw_detection(
image: np.ndarray,
detection: mp.tasks.components.containers.Detection,
keypoint_drawing_spec: mp.tasks.vision.drawing_utils.DrawingSpec = DrawingSpec(color=RED_COLOR),
bbox_drawing_spec: mp.tasks.vision.drawing_utils.DrawingSpec = DrawingSpec()
)
Args |
image
|
A three channel BGR image represented as numpy ndarray.
|
detection
|
A detection object with a bounding box.
|
keypoint_drawing_spec
|
A DrawingSpec object that specifies the keypoints'
drawing settings such as color, line thickness, and circle radius.
|
bbox_drawing_spec
|
A DrawingSpec object that specifies the bounding box's
drawing settings such as color and line thickness.
|
Raises |
ValueError
|
If the input image is not three channel BGR.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-11-05 UTC.
[null,null,["Last updated 2026-11-05 UTC."],[],[]]