I follow the steps according to http://npatta01.github.io/2015/08/10/dlib/ but when I try to run (I use sudo),
python python_examples/face_detector.py exampl
As I see in your code:
detector = dlib.get_frontal_face_detector()
win = dlib.image_window()
First line works and the second does not. This means that dlib is installed, but it is compiled with no GUI support
In dlib's source code we see that if macro DLIB_NO_GUI_SUPPORT is defined - there will be no "image_window" function in dlib module. This macro is defined automatically if CMake scripts can't find X11 libraries
You need to ensure that dlib is compiled with GUI support. To make it, first - install libx11-dev into your system if you are working on Linux, or XQuartz for Mac
When building dlib with running python setup.py install --yes DLIB_JPEG_SUPPORT
- check its messages. If there are errors or warnings - fix them