google-ai-edge / mediapipe

Cross-platform, customizable ML solutions for live and streaming media.
https://mediapipe.dev
Apache License 2.0
26.7k stars 5.07k forks source link

module 'mediapipe' has no attribute 'solution'. Did you mean: 'solutions'? #4555

Closed fishyville closed 1 year ago

fishyville commented 1 year ago

Have I written custom code (as opposed to using a stock example script provided in MediaPipe)

Yes

OS Platform and Distribution

Window

MediaPipe Tasks SDK version

No response

Task name (e.g. Image classification, Gesture recognition etc.)

hand gesture

Programming Language and version (e.g. C++, Python, Java)

python

Describe the actual behavior

module 'mediapipe' has no attribute 'solution'. Did you mean: 'solutions'?

Describe the expected behaviour

It opens camera and will detect my hands

Standalone code/steps you may have used to try to get what you need

mpHands-mp.solution.drawing_utils
devices=AudioUtilities.GetSpeakers ()
interface=devices. Activate (IAudioEndpointVolume. _iid_,CLSCTX_ALL, None)
volume=cast(interface, POINTER(IAudioEndpointVolume))

Other info / Complete Logs

No response

kuaashish commented 1 year ago

@fishyville,

Please import the module 'solutions' not the 'solution', As code structure does not have such class or attribute(Check here) like below:

mpHands-mp.solutions.drawing_utils

However, let us know if still an issue from your end.

fishyville commented 1 year ago

oh it kinda fix things but i got this instead:

unsupported operand type(s) for -: 'module' and 'module'

kuaashish commented 1 year ago

@fishyville,

Please provide the complete standalone code to reproduce the issue from our end? Thank you

fishyville commented 1 year ago

mpHands-mp.solutions.drawing_utils

The system are referring to the "drawing_utils"

kuaashish commented 1 year ago

@fishyville,

We are not able to understand the issue, Please provide the complete steps you are following, Or complete code to reproduce the issue. Thank you

fishyville commented 1 year ago

import cv2 import mediapipe as mp from math import hypot from ctypes import cast, POINTER from comtypes import CLSCTX_ALL from pycaw.pycaw import AudioUtilities, IAudioEndpointVolume import numpy as np cap=cv2.VideoCapture (0)#checks for the availability of camera mpHands=mp.solutions.hands#detects fingers hands=mpHands. Hands () #completes the initialization and configuration of the hands and fingers

mpHands-mp.solutions.drawing_utils devices=AudioUtilities.GetSpeakers () interface=devices. Activate (IAudioEndpointVolume. iid,CLSCTX_ALL, None) volume=cast(interface, POINTER(IAudioEndpointVolume))

It shows this:

File "c:\Users\USER\OneDrive\Documents\trial 1\blabla.py", line 12, in mpHands-mp.solutions.drawing_utils


TypeError: unsupported operand type(s) for -: 'module' and 'module'
INFO: Created TensorFlow Lite XNNPACK delegate for CPU.
google-ml-butler[bot] commented 1 year ago

Are you satisfied with the resolution of your issue? Yes No