def preprocess_output(self, outputs, image):
    '\n        Method to process outputs before feeding them into the next model for\n        inference or for the last step of the app.\n        '
    w = image.shape[1]
    h = image.shape[0]
    outputs = outputs[0]
    (xl, yl) = (int((outputs[0][0][0] * w)), int((outputs[1][0][0] * h)))
    (xr, yr) = (int((outputs[2][0][0] * w)), int((outputs[3][0][0] * h)))
    eyes_coords = [xl, yl, xr, yr]
    square_size = int((w / 10))
    left_eye_box = [(xl - square_size), (yl - square_size), (xl + square_size), (yl + square_size)]
    right_eye_box = [(xr - square_size), (yr - square_size), (xr + square_size), (yr + square_size)]
    crop_left = image[left_eye_box[1]:left_eye_box[3], left_eye_box[0]:left_eye_box[2]]
    crop_right = image[right_eye_box[1]:right_eye_box[3], right_eye_box[0]:right_eye_box[2]]
    return (eyes_coords, crop_left, crop_right)
Method to process outputs before feeding them into the next model for
inference or for the last step of the app.
def preprocess_output(self, outputs, image):
    '\n        Method to process outputs before feeding them into the next model for\n        inference or for the last step of the app.\n        '
    w = image.shape[1]
    h = image.shape[0]
    outputs = outputs[0]
    (xl, yl) = (int((outputs[0][0][0] * w)), int((outputs[1][0][0] * h)))
    (xr, yr) = (int((outputs[2][0][0] * w)), int((outputs[3][0][0] * h)))
    eyes_coords = [xl, yl, xr, yr]
    square_size = int((w / 10))
    left_eye_box = [(xl - square_size), (yl - square_size), (xl + square_size), (yl + square_size)]
    right_eye_box = [(xr - square_size), (yr - square_size), (xr + square_size), (yr + square_size)]
    crop_left = image[left_eye_box[1]:left_eye_box[3], left_eye_box[0]:left_eye_box[2]]
    crop_right = image[right_eye_box[1]:right_eye_box[3], right_eye_box[0]:right_eye_box[2]]
    return (eyes_coords, crop_left, crop_right)