def process_files(input_dir, output_dir, det_models, face_id_model, reference, crop_size, id_npy, max_size, font):
    if (not os.path.exists(output_dir)):
        os.makedirs(output_dir)
    image_names = list(os.listdir(input_dir))
    for img_idx in tqdm(range(len(image_names))):
        image_name = image_names[img_idx]
        pil_img = Image.open(os.path.join(input_dir, image_name))
        pil_img.thumbnail((max_size, max_size))
        (viz_img, _) = process_and_viz_img(pil_img=pil_img, det_models=det_models, face_id_model=face_id_model, reference=reference, crop_size=crop_size, id_npy=id_npy, font=font)
        viz_img.save(os.path.join(output_dir, '{}-stream.jpg'.format(img_idx)))
def process_files(input_dir, output_dir, det_models, face_id_model, reference, crop_size, id_npy, max_size, font):
    if (not os.path.exists(output_dir)):
        os.makedirs(output_dir)
    image_names = list(os.listdir(input_dir))
    for img_idx in tqdm(range(len(image_names))):
        image_name = image_names[img_idx]
        pil_img = Image.open(os.path.join(input_dir, image_name))
        pil_img.thumbnail((max_size, max_size))
        (viz_img, _) = process_and_viz_img(pil_img=pil_img, det_models=det_models, face_id_model=face_id_model, reference=reference, crop_size=crop_size, id_npy=id_npy, font=font)
        viz_img.save(os.path.join(output_dir, '{}-stream.jpg'.format(img_idx)))