def process_image(self, video_name, frame_number, image_path, min_score_threshold, output_path, save_images):
    image = cv2.imread(image_path)
    image_name = Path(image_path).stem
    result_frame = None
    log_name = os.path.join(output_path, f'{video_name}_log.txt')
    with open(log_name, 'a') as log_file:
        print('At Frame:', frame_number)
        frame = np.array(image)
        (frame, boxes) = self.draw_boxes_for_image(frame, min_score_threshold)
        (height, width, layers) = frame.shape
        detector.log_boxes(frame_number, boxes, log_file, width, height)
        result_frame = frame
        if save_images:
            frame_path = os.path.join(output_path, f'{video_name}_frame_{image_name}.png')
            print('Saving image at', frame_path)
            vis_util.save_image_array_as_png(frame, frame_path)
    return result_frame
def process_image(self, video_name, frame_number, image_path, min_score_threshold, output_path, save_images):
    image = cv2.imread(image_path)
    image_name = Path(image_path).stem
    result_frame = None
    log_name = os.path.join(output_path, f'{video_name}_log.txt')
    with open(log_name, 'a') as log_file:
        print('At Frame:', frame_number)
        frame = np.array(image)
        (frame, boxes) = self.draw_boxes_for_image(frame, min_score_threshold)
        (height, width, layers) = frame.shape
        detector.log_boxes(frame_number, boxes, log_file, width, height)
        result_frame = frame
        if save_images:
            frame_path = os.path.join(output_path, f'{video_name}_frame_{image_name}.png')
            print('Saving image at', frame_path)
            vis_util.save_image_array_as_png(frame, frame_path)
    return result_frame