Skip to content

Commit

Permalink
update parser format to match a global pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
mio7690 committed Apr 26, 2023
1 parent ac4935b commit 57bc2ab
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 57bc2ab

Please sign in to comment.