Use mp.ImageFormat instead of just ImageFormat

Fixes https://github.com/google/mediapipe/issues/4911

PiperOrigin-RevId: 577003083
This commit is contained in:
Sebastian Schmidt 2023-10-26 15:24:15 -07:00 committed by Copybara-Service
parent 5459705038
commit 2cb0100fe6

View File

@ -52,9 +52,9 @@ void ImageSubmodule(pybind11::module* module) {
```python
import cv2
cv_mat = cv2.imread(input_file)[:, :, ::-1]
rgb_frame = mp.Image(image_format=ImageFormat.SRGB, data=cv_mat)
rgb_frame = mp.Image(image_format=mp.ImageFormat.SRGB, data=cv_mat)
gray_frame = mp.Image(
image_format=ImageFormat.GRAY,
image_format=mp.ImageFormat.GRAY8,
data=cv2.cvtColor(cv_mat, cv2.COLOR_RGB2GRAY))
from PIL import Image