Skip to content

Commit

Permalink
Merge pull request #453 from mio2333/main
Browse files Browse the repository at this point in the history
update parser format to match a global pattern
  • Loading branch information
kohya-ss authored Apr 26, 2023
2 parents ac4935b + 57bc2ab commit 8810f8a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion finetune/tag_images_by_wd14_tagger.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ def run_batch(path_imgs):
print("done!")


if __name__ == "__main__":
def setup_parser() -> argparse.ArgumentParser:
parser = argparse.ArgumentParser()
parser.add_argument("train_data_dir", type=str, help="directory for train images / 学習画像データのディレクトリ")
parser.add_argument(
Expand Down Expand Up @@ -284,6 +284,11 @@ def run_batch(path_imgs):
)
parser.add_argument("--frequency_tags", action="store_true", help="Show frequency of tags for images / 画像ごとのタグの出現頻度を表示する")

return parser

if __name__ == "__main__":
parser = setup_parser()

args = parser.parse_args()

# スペルミスしていたオプションを復元する
Expand Down

0 comments on commit 8810f8a

Please sign in to comment.