def to_dlib_rect(self): import dlib return dlib.rectangle(left=self.x1, right=self.x2, top=self.y1, bottom=self.y2)