From 2cb0100fe61a283ec9190cf755855eaf8305dafa Mon Sep 17 00:00:00 2001 From: Sebastian Schmidt Date: Thu, 26 Oct 2023 15:24:15 -0700 Subject: [PATCH] Use mp.ImageFormat instead of just ImageFormat Fixes https://github.com/google/mediapipe/issues/4911 PiperOrigin-RevId: 577003083 --- mediapipe/python/pybind/image.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mediapipe/python/pybind/image.cc b/mediapipe/python/pybind/image.cc index 800e883b4a..62437e4391 100644 --- a/mediapipe/python/pybind/image.cc +++ b/mediapipe/python/pybind/image.cc @@ -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