下記のWebサイトの通り、インストールなどを行って
【dlib サンプルプログラムのいくつかを実行してみる】の項目の
顔検知 (face detector) のサンプルプログラムを実行してみましたが
エラーが発生しました。
dlib を使い,顔検知などを行ってみる
■■エラー内容■■
Traceback (most recent call last):
File "face_detector.py", line 49, in <module>
img = dlib.load_rgb_image(f)
AttributeError: 'module' object has no attribute 'load_rgb_image'
【AttributeError: 'module'オブジェクトには属性 'load_rgb_image'がありません】
dlibモジュールの
49行目は【img = dlib.load_rgb_image(f)】なのですが
このエラーの意味がよくわかりません。
何が原因でエラーが発生しているのでしょうか。
python
1dlib 2 3import sys 4import dlib 5 6detector = dlib.get_frontal_face_detector() 7win = dlib.image_window() 8 9for f in sys.argv[1:]: 10 print("Processing file: {}".format(f)) 11 img = dlib.load_rgb_image(f) 12 # The 1 in the second argument indicates that we should upsample the image 13 # 1 time. This will make everything bigger and allow us to detect more 14 # faces. 15 dets = detector(img, 1) 16 print("Number of faces detected: {}".format(len(dets))) 17 for i, d in enumerate(dets): 18 print("Detection {}: Left: {} Top: {} Right: {} Bottom: {}".format( 19 i, d.left(), d.top(), d.right(), d.bottom())) 20 21 win.clear_overlay() 22 win.set_image(img) 23 win.add_overlay(dets) 24 dlib.hit_enter_to_continue() 25
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。