|
|
|
|
|
|
|
$train_data_dir = "./input" |
|
$repo_id = "SmilingWolf/wd-v1-4-swinv2-tagger-v2" |
|
$model_dir = "" |
|
$batch_size = 4 |
|
$max_data_loader_n_workers = 0 |
|
$thresh = 0.35 |
|
$general_threshold = 0.35 |
|
$character_threshold = 0.1 |
|
$remove_underscore = 0 |
|
$undesired_tags = "" |
|
$recursive = 0 |
|
$frequency_tags = 0 |
|
|
|
|
|
|
|
.\venv\Scripts\activate |
|
|
|
$Env:HF_HOME = "huggingface" |
|
$Env:XFORMERS_FORCE_DISABLE_TRITON = "1" |
|
$ext_args = [System.Collections.ArrayList]::new() |
|
|
|
if ($repo_id) { |
|
[void]$ext_args.Add("--repo_id=" + $repo_id) |
|
} |
|
|
|
if ($model_dir) { |
|
[void]$ext_args.Add("--model_dir=" + $model_dir) |
|
} |
|
|
|
if ($batch_size) { |
|
[void]$ext_args.Add("--batch_size=" + $batch_size) |
|
} |
|
|
|
if ($max_data_loader_n_workers) { |
|
[void]$ext_args.Add("--max_data_loader_n_workers=" + $max_data_loader_n_workers) |
|
} |
|
|
|
if ($general_threshold) { |
|
[void]$ext_args.Add("--general_threshold=" + $general_threshold) |
|
} |
|
|
|
if ($character_threshold) { |
|
[void]$ext_args.Add("--character_threshold=" + $character_threshold) |
|
} |
|
|
|
if ($remove_underscore) { |
|
[void]$ext_args.Add("--remove_underscore") |
|
} |
|
|
|
if ($undesired_tags) { |
|
[void]$ext_args.Add("--undesired_tags=" + $undesired_tags) |
|
} |
|
|
|
if ($recursive) { |
|
[void]$ext_args.Add("--recursive") |
|
} |
|
|
|
if ($frequency_tags) { |
|
[void]$ext_args.Add("--frequency_tags") |
|
} |
|
|
|
|
|
accelerate launch --num_cpu_threads_per_process=8 "./scripts/finetune/tag_images_by_wd14_tagger.py" ` |
|
$train_data_dir ` |
|
--thresh=$thresh ` |
|
--caption_extension .txt ` |
|
$ext_args |
|
|
|
Write-Output "Tagger finished" |
|
Read-Host | Out-Null ; |
|
|