#๐ Type error with mediapipe face detection
5 messages ยท Page 1 of 1 (latest)
@sly ibex
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
Closes after a period of inactivity, or when you send !close.
Hey @sly ibex!
Please edit your message to use a code block
Add a py after the three backticks.
```py
print('Hello, world!')
```
This will result in the following:
print('Hello, world!')```
This random error comes up:
Traceback (most recent call last):
File "c:\Users\matth\OneDrive\Documents\Python\OPENCV-18.py", line 18, in <module>
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: <ImageFormat.SRGB: 1>, <repr raised Error>, True
This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.