title: How to convert mmod_rectangles to rectangles via Dlib?
body: <p>In this code used detectors of dlib. </p>
  
  <blockquote>
    <pre class="lang-py prettyprint-override"><code>dlib.get_frontal_face_detector()
  dlib.cnn_face_detection_model_v1('mmod_human_face_detector.dat')
  </code></pre>
  </blockquote>
  
  <pre><code>detector = dlib.get_frontal_face_detector()
  predictor = dlib.shape_predictor('res/model.dat')
  # detector = dlib.cnn_face_detection_model_v1('mmod_human_face_detector.dat')
  
  cap = cv.VideoCapture(0)
  
  while True:
      _, frame = cap.read(0)
      gray = cv.cvtColor(frame, cv.COLOR_BGR2GRAY)
      dets = detector(gray, 0)
      print(dets)
      for det in dets:
          landmarks = shape_to_np(predictor(gray, det))
  
      cv.imshow('test', frame)
  
      if cv.waitKey(1) == ord('q'):
          break
  </code></pre>
  
  <p>When used the cnn detector, dets look as:</p>
  
  <pre class="lang-py prettyprint-override"><code>mmod_rectangles[[(258, 254) (422, 417)]]
  </code></pre>
  
  <p>And an exception is thrown in the predictor line:</p>
  
  <pre><code>TypeError: __call__(): incompatible function arguments. The following
  argument types are supported:
      1. (self: dlib.shape_predictor, image: array, box: dlib.rectangle) -&gt; dlib.full_object_detection
  
  Invoked with: &lt;dlib.shape_predictor object at 0x7f37a12ba9d0&gt;,
  array([[71, 69, 70, ..., 71, 70, 73],
         [71, 72, 71, ..., 72, 72, 75],
         [71, 70, 71, ..., 72, 72, 73],
         ...,
         [27, 27, 27, ..., 75, 71, 68],
         [27, 27, 27, ..., 74, 71, 71],
         [24, 25, 27, ..., 73, 71, 70]], dtype=uint8), &lt;dlib.mmod_rectangle object at 0x7f37819beea0&gt;
  
  </code></pre>
  
  <p>But when used get_frontal_face_detector, the dets look as:</p>
  
  <pre><code>rectangles[[(273, 234) (453, 413)]]
  </code></pre>
  
  <p>And the code works correctly.</p>