4.10.0
INFO: Created TensorFlow Lite XNNPACK delegate for CPU.
WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
W0000 00:00:1737428720.514260 68752 inference_feedback_manager.cc:114] Feedback manager requires a model with a single signature inference. Disabling support for feedback tensors.
Traceback (most recent call last):
File "c:\Users\matth\OneDrive\Documents\Python\OPENCV-18.py", line 18, in
results = findFace.process(frameRGB)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\matth\OneDrive\Documents\Python\PYAI3.12\Lib\site-packages\mediapipe\python\solutions\face_detection.py", line 105, in process
return super().process(input_data={'image': image})
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\matth\OneDrive\Documents\Python\PYAI3.12\Lib\site-packages\mediapipe\python\solution_base.py", line 332, in process
packet=self._make_packet(input_stream_type,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\matth\OneDrive\Documents\Python\PYAI3.12\Lib\site-packages\mediapipe\python\solution_base.py", line 568, in _make_packet
return getattr(packet_creator, 'create_' + packet_data_type.value)(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\matth\OneDrive\Documents\Python\PYAI3.12\Lib\site-packages\mediapipe\python\packet_creator.py", line 245, in create_image
return _packet_creator._create_image_from_pixel_data(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: _create_image_from_pixel_data(): incompatible function arguments. The following argument types are supported:
1. (format: mediapipe.python._framework_bindings.image_frame.ImageFormat, data: numpy.ndarray, copy: bool) -> mediapipe.python._framework_bindings.packet.Packet
Invoked with: , , True
У меня возникла проблема с медиапайпом, и я был бы признателен за помощь. Вот код, вызывающий ошибку: [code]import cv2 import time import mediapipe as mp print(cv2.__version__) width=640 height=360 cam=cv2.VideoCapture(0,cv2.CAP_DSHOW) cam.set(cv2.CAP_PROP_FRAME_WIDTH, width) cam.set(cv2.CAP_PROP_FRAME_HEIGHT, height) cam.set(cv2.CAP_PROP_FPS, 30)
while True: ignore, frame = cam.read() frameRGB = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB) results = findFace.process(frameRGB) if results.detections != None: for face in results.detections: drawFace.draw_detection(frame, face) bBox = findFace.location_data.relative_bounding_box topleft = (int(bBox.xmin * width), int(bBox.ymin * height)) bottomright = (int((bBox.xmin + bBox.width)*width), int((bBox.ymin+bBox.height)*height)) cv2.rectangle(frame, topleft, bottomright, (255, 0 , 0), 5) cv2.imshow('my WEBcam', frame) cv2.moveWindow('my WEBcam',0,0) if cv2.waitKey(1) & 0xff ==ord('q'): break cam.release() [/code] Вот как выглядит сообщение об ошибке, появляющееся на моем терминале: [code]4.10.0 INFO: Created TensorFlow Lite XNNPACK delegate for CPU. WARNING: All log messages before absl::InitializeLog() is called are written to STDERR W0000 00:00:1737428720.514260 68752 inference_feedback_manager.cc:114] Feedback manager requires a model with a single signature inference. Disabling support for feedback tensors. Traceback (most recent call last): File "c:\Users\matth\OneDrive\Documents\Python\OPENCV-18.py", line 18, in results = findFace.process(frameRGB) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\matth\OneDrive\Documents\Python\PYAI3.12\Lib\site-packages\mediapipe\python\solutions\face_detection.py", line 105, in process return super().process(input_data={'image': image}) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\matth\OneDrive\Documents\Python\PYAI3.12\Lib\site-packages\mediapipe\python\solution_base.py", line 332, in process packet=self._make_packet(input_stream_type, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\matth\OneDrive\Documents\Python\PYAI3.12\Lib\site-packages\mediapipe\python\solution_base.py", line 568, in _make_packet return getattr(packet_creator, 'create_' + packet_data_type.value)( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\matth\OneDrive\Documents\Python\PYAI3.12\Lib\site-packages\mediapipe\python\packet_creator.py", line 245, in create_image return _packet_creator._create_image_from_pixel_data( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: _create_image_from_pixel_data(): incompatible function arguments. The following argument types are supported: 1. (format: mediapipe.python._framework_bindings.image_frame.ImageFormat, data: numpy.ndarray, copy: bool) -> mediapipe.python._framework_bindings.packet.Packet
Invoked with: , , True [/code] Большое спасибо за уделенное время!!!