im trying to implementate mediapipe on touchdesigner, but when i execute the nodes, i saw the next error:
python >>>
Traceback (most recent call last):
File "/project1/script1_callbacks", line 24, in onCook
File "C:/Users/jvida/Desktop/ModelosVisionArtificial/ExtPy/Dep/python\mediapipe\python\solutions\hands.py", line 164, in process
return super().process(input_data={'image': image})
File "C:/Users/jvida/Desktop/ModelosVisionArtificial/ExtPy/Dep/python\mediapipe\python\solution_base.py", line 310, in process
data).at(self._simulated_timestamp))
File "C:/Users/jvida/Desktop/ModelosVisionArtificial/ExtPy/Dep/python\mediapipe\python\solution_base.py", line 487, in _make_packet
data, image_format=image_frame.ImageFormat.SRGB)
File "C:/Users/jvida/Desktop/ModelosVisionArtificial/ExtPy/Dep/python\mediapipe\python\packet_creator.py", line 147, in create_image_frame
image_format, data, copy)
TypeError: Cannot cast array data from dtype('float32') to dtype('uint8') according to the rule 'safe'
It's curious because i have untertood that the packetcreator work with float
i do a cast that solve it
img_RGB = cv2.cvtColor(img,cv2.COLOR_BGR2RGB)
img_RGB=img_RGB/img_RGB.max()
img_RGB=255*img_RGB
img2 = img_RGB.astype(np.uint8)
im trying to implementate mediapipe on touchdesigner, but when i execute the nodes, i saw the next error: python >>> Traceback (most recent call last): File "/project1/script1_callbacks", line 24, in onCook File "C:/Users/jvida/Desktop/ModelosVisionArtificial/ExtPy/Dep/python\mediapipe\python\solutions\hands.py", line 164, in process return super().process(input_data={'image': image}) File "C:/Users/jvida/Desktop/ModelosVisionArtificial/ExtPy/Dep/python\mediapipe\python\solution_base.py", line 310, in process data).at(self._simulated_timestamp)) File "C:/Users/jvida/Desktop/ModelosVisionArtificial/ExtPy/Dep/python\mediapipe\python\solution_base.py", line 487, in _make_packet data, image_format=image_frame.ImageFormat.SRGB) File "C:/Users/jvida/Desktop/ModelosVisionArtificial/ExtPy/Dep/python\mediapipe\python\packet_creator.py", line 147, in create_image_frame image_format, data, copy) TypeError: Cannot cast array data from dtype('float32') to dtype('uint8') according to the rule 'safe' It's curious because i have untertood that the packetcreator work with float