arunponnusamy / cvlib

A simple, high level, easy to use, open source Computer Vision library for Python.
http://arunponnusamy.com/cvlib/
MIT License
647 stars 127 forks source link

module 'cvlib' has no attribute 'detect_face' #25

Open yensan0512 opened 5 years ago

yensan0512 commented 5 years ago

C:\xampp\htdocs\faceD>python cvlib.py Using TensorFlow backend. WARNING:tensorflow:From C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\framework\op_def_library.py:263: colocate_with (from tensorflow.python.framework.ops) is deprecated and will be removed in a future version. Instructions for updating: Colocations handled automatically by placer. 2019-07-15 20:47:44.195976: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 WARNING:tensorflow:From C:\ProgramData\Anaconda3\lib\site-packages\keras\backend\tensorflow_backend.py:3445: calling dropout (from tensorflow.python.ops.nn_ops) with keep_prob is deprecated and will be removed in a future version. Instructions for updating: Please use rate instead of keep_prob. Rate should be set to rate = 1 - keep_prob. WARNING:tensorflow:From C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\ops\math_ops.py:3066: to_int32 (from tensorflow.python.ops.math_ops) is deprecated and will be removed in a future version. Instructions for updating: Use tf.cast instead. Traceback (most recent call last): File "cvlib.py", line 12, in import cvlib as cv File "C:\xampp\htdocs\faceD\cvlib.py", line 42, in face, confidence = cv.detect_face(frame) AttributeError: module 'cvlib' has no attribute 'detect_face' [ WARN:0] terminating async callback

arunponnusamy commented 5 years ago

Hi @yensan0512 , can you try changing the name of the script you are running from cvlib.py to something else like cvlib_script.py ?

yensan0512 commented 5 years ago

I have change to cvlib_script.py but it still the same,sir

C:\xampp\htdocs\faceD>python cvlib_script.py Using TensorFlow backend. WARNING:tensorflow:From C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\framework\op_def_library.py:263: colocate_with (from tensorflow.python.framework.ops) is deprecated and will be removed in a future version. Instructions for updating: Colocations handled automatically by placer. 2019-07-16 14:37:08.106793: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 WARNING:tensorflow:From C:\ProgramData\Anaconda3\lib\site-packages\keras\backend\tensorflow_backend.py:3445: calling dropout (from tensorflow.python.ops.nn_ops) with keep_prob is deprecated and will be removed in a future version. Instructions for updating: Please use rate instead of keep_prob. Rate should be set to rate = 1 - keep_prob. WARNING:tensorflow:From C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\ops\math_ops.py:3066: to_int32 (from tensorflow.python.ops.math_ops) is deprecated and will be removed in a future version. Instructions for updating: Use tf.cast instead. Traceback (most recent call last): File "cvlib_script.py", line 12, in import cvlib_script as cv File "C:\xampp\htdocs\faceD\cvlib_script.py", line 42, in face, confidence = cv.detect_face(frame) AttributeError: module 'cvlib_script' has no attribute 'detect_face'

arunponnusamy commented 5 years ago

You can keep the import statement as

import cvlib as cv

No need to change any code inside the script. The reason for changing the file name is it might confuse python while trying to import the package cvlib since the filename is also named cvlib.

yensan0512 commented 5 years ago

It is okay, i get the output just the output will come out in two sqaure label

On Tue, Jul 16, 2019 at 2:46 PM Arun Ponnusamy notifications@github.com wrote:

You can keep the import statement as

import cvlib as cv

No need to change any code inside the script. The reason for changing the file name is it might confuse python while trying to import the package cvlib since the filename is also named cvlib.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/arunponnusamy/cvlib/issues/25?email_source=notifications&email_token=AIEOVPYXGTLOOJLR7GL6WKLP7VVD3A5CNFSM4IDWOLOKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZ7353Y#issuecomment-511688431, or mute the thread https://github.com/notifications/unsubscribe-auth/AIEOVP7UPZWJDKTJILCBJLTP7VVD3ANCNFSM4IDWOLOA .