Example updated for mp.Image in documentation

PiperOrigin-RevId: 579277510
This commit is contained in:
MediaPipe Team 2023-11-03 12:55:50 -07:00 committed by Copybara-Service
parent 1c46e43088
commit e22b7d5dd4
2 changed files with 2 additions and 2 deletions

View File

@ -51,7 +51,7 @@ void ImageSubmodule(pybind11::module* module) {
```python ```python
import cv2 import cv2
cv_mat = cv2.imread(input_file)[:, :, ::-1] cv_mat = cv2.imread(input_file)
rgb_frame = mp.Image(image_format=mp.ImageFormat.SRGB, data=cv_mat) rgb_frame = mp.Image(image_format=mp.ImageFormat.SRGB, data=cv_mat)
gray_frame = mp.Image( gray_frame = mp.Image(
image_format=mp.ImageFormat.GRAY8, image_format=mp.ImageFormat.GRAY8,

View File

@ -84,7 +84,7 @@ void ImageFrameSubmodule(pybind11::module* module) {
```python ```python
import cv2 import cv2
cv_mat = cv2.imread(input_file)[:, :, ::-1] cv_mat = cv2.imread(input_file)
rgb_frame = mp.ImageFrame(image_format=ImageFormat.SRGB, data=cv_mat) rgb_frame = mp.ImageFrame(image_format=ImageFormat.SRGB, data=cv_mat)
gray_frame = mp.ImageFrame( gray_frame = mp.ImageFrame(
image_format=ImageFormat.GRAY, image_format=ImageFormat.GRAY,