              else:
                  length = int(((len_x ** 2) + (len_y ** 2)) ** 0.5)
              sizes.append(length)
          return sizes
  
      def get_aligned_landmarks_for_frame(self, frame, landmarks_xy,
                                          update=False):
          """ Return the transposed landmarks for the selected face """
          if self.current_frame != frame or update:
              self.get_faces(frame)
          aligned_landmarks = list()
          if not self.matrices:
              return aligned_landmarks
          for idx, landmarks in enumerate(landmarks_xy):
              matrix = self.matrices[idx]
              aligned_landmarks.append(
                  self.extractor.transform_points(landmarks,
                                                  matrix,
                                                  self.size,
                                                  self.padding))
          return aligned_landmarks
 
</s> remove     def get_roi_for_frame(self, frame, update=False):
        """ Return the original rois for the selected frame """
        if self.current_frame != frame or update:
            self.get_faces(frame)
        return [self.original_roi(matrix) for matrix in self.matrices]

 </s> add  </s> remove         mat = matrix * (self.size - 2 * self.padding)
        mat[:, 2] += self.padding
        mat = cv2.invertAffineTransform(mat)
        return [cv2.transform(points, mat)]

    def get_faces_for_frame(self, frame, update=False):
 </s> add     def get_faces_in_frame(self, frame, update=False): </s> remove         for matrix in self.matrices:
            original_roi = self.original_roi(matrix)[0].squeeze()
            top_left, top_right = original_roi[0], original_roi[3]
 </s> add         for face in self.faces:
            top_left, top_right = face.original_roi[0], face.original_roi[3] </s> remove         faces = self.extracted_faces.get_faces_for_frame(frame)
 </s> add         faces = self.extracted_faces.get_faces_in_frame(frame) </s> remove         for idx, face in enumerate(output_item["detected_faces"]):
            resized_face = output_item["resized_faces"][idx]
            dims = resized_face.shape[:2]
            size = dims[0]
            t_mat = output_item["t_mats"][idx]

            aligned_landmarks = extractor.transform_points(
                face.landmarksXY,
                t_mat, size, 48)
 </s> add         for face in output_item["detected_faces"]:
            aligned_landmarks = face.aligned_landmarks
            resized_face = face.aligned_face
            size = face.aligned["size"]
              else:
                  length = int(((len_x ** 2) + (len_y ** 2)) ** 0.5)
              sizes.append(length)
          return sizes

















keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace
 Fix convert-adjust (#531)

* Add dimensions to alignments + refactor

* Add frame_dims + funcs to DetectFaces. Add alignments lib

* Convert Adjust working

* Refactor and tidy up 
tools/lib_alignments/media.py