def METHOD_NAME(path_imgs):
    imgs = [im for _, im in path_imgs]
    curr_batch_size[0] = len(path_imgs)
    inputs = git_processor(images=imgs, return_tensors="pt").to(DEVICE)  # 画像はpil形式
    generated_ids = git_model.generate(pixel_values=inputs.pixel_values, max_length=args.max_length)
    captions = git_processor.batch_decode(generated_ids, skip_special_tokens=True)
    if args.remove_words:
        captions = remove_words(captions, args.debug)
    for (image_path, _), caption in zip(path_imgs, captions):
        with open(os.path.splitext(image_path)[0] + args.caption_extension, "wt", encoding="utf-8") as f:
            f.write(caption + "\n")
            if args.debug:
                print(image_path, caption)