2

I am currently dealing with object recognition and decided to use Dlib, however python package cannot find the image_window() function on MS Windows machine.

The example code:

import dlib
from skimage import io

detector = dlib.get_frontal_face_detector()
img = io.imread('obama.jpg')
faces = detector(img)

for d in faces:
    print "left,top,right,bottom:", d.left(), d.top(), d.right(), d.bottom()

win = dlib.image_window()
win.set_image(img)
win.add_overlay(faces)

I get the following error:

'module' object has no attribute 'image_window'

An answer is proposed on https://github.com/davisking/dlib/issues/7 , however since I downloaded the package via conda, I cannot recompile it.

sxanus
  • 73
  • 1
  • 6

2 Answers2

2

This might be due to a bug in one of dlib's cmake scripts that caused certain things to not be built unless cmake was run twice. However, this has been fixed. So if you pull the latest code from dlib's github repository it should work without issue now.

Davis King
  • 4,731
  • 1
  • 25
  • 26
0

i use "conda install -c conda-forge dlib=19.0" in windows10 64 py3.5. the code can work,but pycharm can not autocomplete the dlib.image_window()

renyi
  • 1