Discussions>Exception: 'dlib.mmod_rectangle' object has no attribute 'right'>

Exception: 'dlib.mmod_rectangle' object has no attribute 'right'

I'm using dlib for face detection and getting this error

Exception:  'dlib.mmod_rectangle' object has no attribute 'right'

What is the problem? I'm using cnn version of dlib which should run on gpu and here is the code

detector = dlib.cnn_face_detection_model_v1('mmod_human_face_detector.dat')
img = dlib.load_rgb_image(img_path)
dets = detector(img, 1)
3 votesLP215.00
1 Answers

If you use cnn version of dlib, it does not return you simple rectangle. It returns you an instance of a class, which have the rectangle inside of it.

class dlib.mmod_rectangle:
  # Wrapper around a rectangle object and a detection confidence score.

This is the definitation of the class. it has a field rect, where you can find your points. http://dlib.net/python/index.html#dlib.mmod_rectangle

Couldn't find what you were looking for?and we will find an expert to answer.
How helpful was this page?