mirror of
https://github.com/kohya-ss/sd-scripts.git
synced 2026-04-09 06:45:09 +00:00
add ja comment, restore arg for backward compat
This commit is contained in:
@@ -154,7 +154,7 @@ def setup_parser() -> argparse.ArgumentParser:
|
|||||||
parser.add_argument("--min_length", type=int, default=5, help="min length of caption / captionの最小長")
|
parser.add_argument("--min_length", type=int, default=5, help="min length of caption / captionの最小長")
|
||||||
parser.add_argument('--seed', default=42, type=int, help='seed for reproducibility / 再現性を確保するための乱数seed')
|
parser.add_argument('--seed', default=42, type=int, help='seed for reproducibility / 再現性を確保するための乱数seed')
|
||||||
parser.add_argument("--debug", action="store_true", help="debug mode")
|
parser.add_argument("--debug", action="store_true", help="debug mode")
|
||||||
parser.add_argument("--recursive", action="store_true", help="search for images in subfolders recursively")
|
parser.add_argument("--recursive", action="store_true", help="search for images in subfolders recursively / サブフォルダを再帰的に検索する")
|
||||||
|
|
||||||
return parser
|
return parser
|
||||||
|
|
||||||
|
|||||||
@@ -142,7 +142,7 @@ def setup_parser() -> argparse.ArgumentParser:
|
|||||||
parser.add_argument("--remove_words", action="store_true",
|
parser.add_argument("--remove_words", action="store_true",
|
||||||
help="remove like `with the words xxx` from caption / `with the words xxx`のような部分をキャプションから削除する")
|
help="remove like `with the words xxx` from caption / `with the words xxx`のような部分をキャプションから削除する")
|
||||||
parser.add_argument("--debug", action="store_true", help="debug mode")
|
parser.add_argument("--debug", action="store_true", help="debug mode")
|
||||||
parser.add_argument("--recursive", action="store_true", help="search for images in subfolders recursively")
|
parser.add_argument("--recursive", action="store_true", help="search for images in subfolders recursively / サブフォルダを再帰的に検索する")
|
||||||
|
|
||||||
return parser
|
return parser
|
||||||
|
|
||||||
|
|||||||
@@ -143,9 +143,9 @@ def main(args):
|
|||||||
character_tag_text += ", " + tag_name
|
character_tag_text += ", " + tag_name
|
||||||
combined_tags.append(tag_name)
|
combined_tags.append(tag_name)
|
||||||
|
|
||||||
|
# 先頭のカンマを取る
|
||||||
if len(general_tag_text) > 0:
|
if len(general_tag_text) > 0:
|
||||||
general_tag_text = general_tag_text[2:]
|
general_tag_text = general_tag_text[2:]
|
||||||
|
|
||||||
if len(character_tag_text) > 0:
|
if len(character_tag_text) > 0:
|
||||||
character_tag_text = character_tag_text[2:]
|
character_tag_text = character_tag_text[2:]
|
||||||
|
|
||||||
@@ -218,13 +218,14 @@ if __name__ == '__main__':
|
|||||||
parser.add_argument("--caption_extention", type=str, default=None,
|
parser.add_argument("--caption_extention", type=str, default=None,
|
||||||
help="extension of caption file (for backward compatibility) / 出力されるキャプションファイルの拡張子(スペルミスしていたのを残してあります)")
|
help="extension of caption file (for backward compatibility) / 出力されるキャプションファイルの拡張子(スペルミスしていたのを残してあります)")
|
||||||
parser.add_argument("--caption_extension", type=str, default=".txt", help="extension of caption file / 出力されるキャプションファイルの拡張子")
|
parser.add_argument("--caption_extension", type=str, default=".txt", help="extension of caption file / 出力されるキャプションファイルの拡張子")
|
||||||
parser.add_argument("--general_threshold", type=float, default=0.35, help="threshold of confidence to add a tag for general category")
|
parser.add_argument("--thresh", type=float, default=0.35, help="threshold of confidence to add a tag / タグを追加するか判定する閾値")
|
||||||
parser.add_argument("--character_threshold", type=float, default=0.35, help="threshold of confidence to add a tag for character category")
|
parser.add_argument("--general_threshold", type=float, default=None, help="threshold of confidence to add a tag for general category, same as --thresh if omitted / generalカテゴリのタグを追加するための確信度の閾値、省略時は --thresh と同じ")
|
||||||
parser.add_argument("--recursive", action="store_true", help="search for images in subfolders recursively")
|
parser.add_argument("--character_threshold", type=float, default=None, help="threshold of confidence to add a tag for character category, same as --thres if omitted / characterカテゴリのタグを追加するための確信度の閾値、省略時は --thresh と同じ")
|
||||||
parser.add_argument("--remove_underscore", action="store_true", help="replace underscores with spaces in the output tags")
|
parser.add_argument("--recursive", action="store_true", help="search for images in subfolders recursively / サブフォルダを再帰的に検索する")
|
||||||
|
parser.add_argument("--remove_underscore", action="store_true", help="replace underscores with spaces in the output tags / 出力されるタグのアンダースコアをスペースに置き換える")
|
||||||
parser.add_argument("--debug", action="store_true", help="debug mode")
|
parser.add_argument("--debug", action="store_true", help="debug mode")
|
||||||
parser.add_argument("--undesired_tags", type=str, default="", help="comma-separated list of undesired tags to remove from the output")
|
parser.add_argument("--undesired_tags", type=str, default="", help="comma-separated list of undesired tags to remove from the output / 出力から除外したいタグのカンマ区切りのリスト")
|
||||||
parser.add_argument('--frequency_tags', action='store_true', help='Show frequency of tags for images')
|
parser.add_argument('--frequency_tags', action='store_true', help='Show frequency of tags for images / 画像ごとのタグの出現頻度を表示する')
|
||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
@@ -232,4 +233,9 @@ if __name__ == '__main__':
|
|||||||
if args.caption_extention is not None:
|
if args.caption_extention is not None:
|
||||||
args.caption_extension = args.caption_extention
|
args.caption_extension = args.caption_extention
|
||||||
|
|
||||||
|
if args.general_threshold is None:
|
||||||
|
args.general_threshold = args.thresh
|
||||||
|
if args.character_threshold is None:
|
||||||
|
args.character_threshold = args.thresh
|
||||||
|
|
||||||
main(args)
|
main(args)
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ def setup_parser() -> argparse.ArgumentParser:
|
|||||||
parser.add_argument("--float", action='store_true',
|
parser.add_argument("--float", action='store_true',
|
||||||
help='save as float (checkpoint only) / float(float32)形式で保存する(checkpointのみ対応)')
|
help='save as float (checkpoint only) / float(float32)形式で保存する(checkpointのみ対応)')
|
||||||
parser.add_argument("--save_precision_as", type=str, default="no", choices=["fp16", "bf16", "float"],
|
parser.add_argument("--save_precision_as", type=str, default="no", choices=["fp16", "bf16", "float"],
|
||||||
help="save precision")
|
help="save precision, do not specify with --fp16/--bf16/--float / 保存する精度、--fp16/--bf16/--floatと併用しないでください")
|
||||||
parser.add_argument("--epoch", type=int, default=0, help='epoch to write to checkpoint / checkpointに記録するepoch数の値')
|
parser.add_argument("--epoch", type=int, default=0, help='epoch to write to checkpoint / checkpointに記録するepoch数の値')
|
||||||
parser.add_argument("--global_step", type=int, default=0,
|
parser.add_argument("--global_step", type=int, default=0,
|
||||||
help='global_step to write to checkpoint / checkpointに記録するglobal_stepの値')
|
help='global_step to write to checkpoint / checkpointに記録するglobal_stepの値')
|
||||||
|
|||||||
Reference in New Issue
Block a user