From 9fc8832eaf8d56bcd9ed56a14783ad78509f5930 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9D=92=E9=BE=8D=E8=81=96=E8=80=85=40bdsqlsz?= <865105819@qq.com> Date: Wed, 22 Mar 2023 14:05:41 +0800 Subject: [PATCH 1/6] fix list out of range --- tag_images_by_wd14_tagger.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tag_images_by_wd14_tagger.py b/tag_images_by_wd14_tagger.py index ca86080..bbcf047 100644 --- a/tag_images_by_wd14_tagger.py +++ b/tag_images_by_wd14_tagger.py @@ -72,7 +72,7 @@ def run_batch(path_imgs): # Everything else is tags: pick any where prediction confidence > threshold tag_text = "" for i, p in enumerate(prob[4:]): # numpyとか使うのが良いけど、まあそれほど数も多くないのでループで - if p >= args.thresh: + if p >= args.thresh and i < len(tags): tag_text += ", " + tags[i] if len(tag_text) > 0: From 464e2da8d8fd38f8f9019a7ba4e99cfbd2dd9c24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9D=92=E9=BE=8D=E8=81=96=E8=80=85=40bdsqlsz?= <865105819@qq.com> Date: Wed, 22 Mar 2023 14:10:59 +0800 Subject: [PATCH 2/6] Update tag_images_by_wd14_tagger.py --- tag_images_by_wd14_tagger.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tag_images_by_wd14_tagger.py b/tag_images_by_wd14_tagger.py index bbcf047..22d0fa7 100644 --- a/tag_images_by_wd14_tagger.py +++ b/tag_images_by_wd14_tagger.py @@ -16,7 +16,7 @@ # from wd14 tagger IMAGE_SIZE = 448 -WD14_TAGGER_REPO = 'SmilingWolf/wd-v1-4-vit-tagger' +WD14_TAGGER_REPO = 'SmilingWolf/wd-v1-4-swinv2-tagger-v2' FILES = ["keras_metadata.pb", "saved_model.pb", "selected_tags.csv"] SUB_DIR = "variables" SUB_DIR_FILES = ["variables.data-00000-of-00001", "variables.index"] From 98a162d1380cc28610340d2be4c2ed270e39ec08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9D=92=E9=BE=8D=E8=81=96=E8=80=85=40bdsqlsz?= <865105819@qq.com> Date: Wed, 22 Mar 2023 14:11:53 +0800 Subject: [PATCH 3/6] Add files via upload --- tagger.ps1 | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 tagger.ps1 diff --git a/tagger.ps1 b/tagger.ps1 new file mode 100644 index 0000000..280c4e0 --- /dev/null +++ b/tagger.ps1 @@ -0,0 +1,18 @@ +# tagger script by @bdsqlsz + +# Train data path +$input_img = "./input" # input images path +$batch_size = 4 +$thresh = 0.35 + + +Write-Output "配置完成" +conda activate wd14tagger +python tag_images_by_wd14_tagger.py ` + $input_img ` + --batch_size=$batch_size ` + --thresh=$thresh ` + --caption_extension .txt + +Write-Output "Tagger finished" +Read-Host | Out-Null ; \ No newline at end of file From 767cd4493fa011050eb6dea25f79b81c1d03dfb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9D=92=E9=BE=8D=E8=81=96=E8=80=85=40bdsqlsz?= Date: Thu, 23 Mar 2023 17:10:16 +0800 Subject: [PATCH 4/6] update lastest repo --- tag_images_by_wd14_tagger.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tag_images_by_wd14_tagger.py b/tag_images_by_wd14_tagger.py index 22d0fa7..c50ed99 100644 --- a/tag_images_by_wd14_tagger.py +++ b/tag_images_by_wd14_tagger.py @@ -16,7 +16,7 @@ # from wd14 tagger IMAGE_SIZE = 448 -WD14_TAGGER_REPO = 'SmilingWolf/wd-v1-4-swinv2-tagger-v2' +WD14_TAGGER_REPO = 'SmilingWolf/wd-v1-4-convnextv2-tagger-v2' FILES = ["keras_metadata.pb", "saved_model.pb", "selected_tags.csv"] SUB_DIR = "variables" SUB_DIR_FILES = ["variables.data-00000-of-00001", "variables.index"] From 2460d79f3b7fc436b3fea3b963f18fa46f3a3fe7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9D=92=E9=BE=8D=E8=81=96=E8=80=85=40bdsqlsz?= Date: Thu, 23 Mar 2023 17:11:16 +0800 Subject: [PATCH 5/6] Update tagger.ps1 --- tagger.ps1 | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tagger.ps1 b/tagger.ps1 index 280c4e0..a13c6c3 100644 --- a/tagger.ps1 +++ b/tagger.ps1 @@ -5,8 +5,6 @@ $input_img = "./input" # input images path $batch_size = 4 $thresh = 0.35 - -Write-Output "配置完成" conda activate wd14tagger python tag_images_by_wd14_tagger.py ` $input_img ` @@ -15,4 +13,4 @@ python tag_images_by_wd14_tagger.py ` --caption_extension .txt Write-Output "Tagger finished" -Read-Host | Out-Null ; \ No newline at end of file +Read-Host | Out-Null ; From f5b87bd7daaad6b983b6159b65c118747a663367 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9D=92=E9=BE=8D=E8=81=96=E8=80=85=40bdsqlsz?= Date: Thu, 23 Mar 2023 17:11:50 +0800 Subject: [PATCH 6/6] Update tagger.ps1 --- tagger.ps1 | 1 - 1 file changed, 1 deletion(-) diff --git a/tagger.ps1 b/tagger.ps1 index a13c6c3..8c43371 100644 --- a/tagger.ps1 +++ b/tagger.ps1 @@ -5,7 +5,6 @@ $input_img = "./input" # input images path $batch_size = 4 $thresh = 0.35 -conda activate wd14tagger python tag_images_by_wd14_tagger.py ` $input_img ` --batch_size=$batch_size `