#white_background
Explore tagged Tumblr posts
ofrqrkobn3 · 4 months ago
Text
Tumblr media
0 notes
ebycow · 2 years ago
Text
LoRA学習方法簡易解説
LoRA学習方法簡易解説
1.ファイルとフォルダ構成について
ファイルツリーを以下に示す
images ├── regular │ └── 120_girl │ ├── transparent_10.png │ ├── transparent_11.png │ ├── transparent_12.png │ ├── transparent_13.png │ ├── transparent_14.png ... (正則化画像数>=教師画像数であれば多めに作成してよい)
├── tanaka │ └── train │ └── 120_tanaka girl │ ├── 001.caption │ ├── 001.jpg │ ├── 002.caption │ ├── 002.jpg │ ├── 003.caption │ ├── 003.jpg │ ├── 004.caption │ ├── 004.jpg │ ├── 005.caption
├── shimarin │ └── train │ └── 120_shimarin girl │ ├── 0.caption │ ├── 0.png │ ├── 10.caption │ ├── 10.png │ ├── 11.caption │ ├── 11.png │ ├── 12.caption │ ├── 12.png
1.1. まず,正則化画像フォルダと教師画像フォルダの二つが必要である. "教師用画像フォルダ"は "{繰り返し回数}{トリガーワード} {クラスワード}" と設定し,このフォルダ名が「処理時に手続きの一部で使用される」 "正則化画像フォルダ"は "{繰り返し回数}{クラスワード}"と設定し,このフォルダ名が「処理時に手続きの一部で使用される」 各{繰り返し回数}は「学習用画像の繰り返し回数×学習用画像の枚数≧正則化画像の繰り返し回数×正則化画像の枚数」となるように設定すること.
補記: ここでは便宜上フォルダ構成を/images/tanaka/train/ あるいは /images/shimarin/train としているが,trainフォルダ内に一つのトリガーワードを表すフォルダがあればよい(eg. /images/train/120_sks girl でもよい)
もしトリガーワード(一般的にはidentifierと呼ぶ)��クラスワードの関係を理解していない場合,関連する文献を調査し理解すること.
2.画像の用意
2.1.正則化画像を用意する 一部のコミュニティでは,透明なpng画像を正則化に用いるのが最適であるといわれている. 以下のリポジトリのプログラムは,Stable-diffusion-webUI上で透明画像を生成する拡張機能である,"正則化画像フォルダ"に透明画像を配置する. https://github.com/hunyaramoke/Generate-TransparentIMG
上述の通り,正則化画像数>=教師画像数であれば透明画像は多めに作成してよく, 余剰分は処理時に無視される
2.2. 教師画像を用意する 教師画像を用意し"教師用画像フォルダ"に配置する.ファイル名は連番であるとよい.
3.キャプションの作成 上記ファイルツリーの例では/images/tanaka/train/120_tanaka girl/001.caption のように各画像にキャプションを作成する.このcaptionファイルは学習時の調整に用いられる.captionファイルを用意しなかった場合,フォルダ名で指定した{トリガーワード} {クラスワード}がcaptionファイルの代替に指定される.(これは著しくモデルの精度を損なうことになる)
NAI形式のcaptionファイルの内容を以下に示す
1girl, breasts, looking_at_viewer, short_hair, bangs, multiple_girls, skirt, simple_background, shirt, hair_ornament, long_sleeves, white_background, ribbon, holding, 2girls, closed_mouth, school_uniform, blue_hair, jacket, yellow_eyes, white_shirt, pantyhose, pleated_skirt, collared_shirt, mole, blue_skirt, black_pantyhose, mole_under_eye, black_ribbon, neck_ribbon, letterboxed, instrument, music, guitar, shirt_tucked_in, playing_instrument, holding_instrument, electric_guitar, bass_guitar, gibson_les_paul
つまり,画像の要素をDanbooruタグ形式で列挙する,これを https://github.com/kohya-ss/sd-scripts で行う場合以下のようなコマンドとなる
python tag_images_by_wd14_tagger.py --batch_size <バッチサイズ> <教師データフォルダ>
python tag_images_by_wd14_tagger.py --batch_size 4 /images/tanaka/train/120_tanaka girl
手動で列挙出来る場合は,手動でもよい
4.学習 学習は kohya-ss/sd-scripts https://github.com/kohya-ss/sd-scripts で行う. 環境導入はこのプロジェクトがGradioでGUI化された kohya sd-scripts webui https://github.com/ddPn08/kohya-sd-scripts-webui で行い, インストールされたvenv環境を用いると手間がかからない.
学習時のコマンド例を示す.
../kohya-sd-scripts-webui/venv/bin/accelerate launch --num_cpu_threads_per_process 1 train_network.py --pretrained_model_name_or_path="JosephusCheung/ACertainty" --train_data_dir="/images/shimarin/train" --output_dir="/output/lora_shimarin" --reg_data_dir="/images/regular" --prior_loss_weight=1.0 --enable_bucket --min_bucket_reso=384 --max_bucket_reso=1280 --train_batch_size=12 --learning_rate=1e-4 --text_encoder_lr 5e-5 --use_8bit_adam --xformers --mixed_precision=fp16 --save_every_n_epochs=1 --save_model_as=safetensors --clip_skip=2 --seed=42 --color_aug --flip_aug --network_module=networks.lora --resolution=768,512 --network_dim 256 --max_train_epochs 10 --shuffle_caption
上記コマンドの補足: train_data_dir, output_dir, reg_data_dirに注意する.
pretrained_model_name_or_pathは"JosephusCheung/ACertainty"を用いるのが最適であるが,どれでもよい
network_dimは,コミュニティでは256が用いられるが,それ以下のほうが高速に学習できる.
--color_aug はモデルのVAEを用いて色相によりデータ拡張する
--flip_aug は画像を反転してデータ拡張する
--enable_bucket --min_bucket_reso=384 --max_bucket_reso=1280 はNovelAIのaspect-ratio-bucketing https://github.com/NovelAI/novelai-aspect-ratio-bucketing の実装であり,学習時のアスペクト比を可変にする事が可能となるものである.つまり,学習時に画像の解像度をリサイズする加工は必要ない.
以下にヒントを引用する https://github.com/kohya-ss/sd-scripts/blob/main/fine_tune_README_ja.md
機械学習では入力サイズをすべて統一するのが一般的ですが、特に制約があるわけではなく、実際は同一のバッチ内で統一されていれば大丈夫です。NovelAIの言うbucketingは、あらかじめ教師データを、アスペクト比に応じた学習解像度ごとに分類しておくことを指しているようです。そしてバッチを各bucket内の画像で作成することで、バッチの画像サイズを統一します。
オプションをメモとして示す.
usage: train_network.py [-h] [--v2] [--v_parameterization] [--pretrained_model_name_or_path PRETRAINED_MODEL_NAME_OR_PATH] [--train_data_dir TRAIN_DATA_DIR] [--shuffle_caption] [--caption_extension CAPTION_EXTENSION] [--caption_extention CAPTION_EXTENTION] [--keep_tokens KEEP_TOKENS] [--color_aug] [--flip_aug] [--face_crop_aug_range FACE_CROP_AUG_RANGE] [--random_crop] [--debug_dataset] [--resolution RESOLUTION] [--cache_latents] [--enable_bucket] [--min_bucket_reso MIN_BUCKET_RESO] [--max_bucket_reso MAX_BUCKET_RESO] [--bucket_reso_steps BUCKET_RESO_STEPS] [--bucket_no_upscale] [--reg_data_dir REG_DATA_DIR] [--in_json IN_JSON] [--dataset_repeats DATASET_REPEATS] [--output_dir OUTPUT_DIR] [--output_name OUTPUT_NAME] [--save_precision {None,float,fp16,bf16}] [--save_every_n_epochs SAVE_EVERY_N_EPOCHS] [--save_n_epoch_ratio SAVE_N_EPOCH_RATIO] [--save_last_n_epochs SAVE_LAST_N_EPOCHS] [--save_last_n_epochs_state SAVE_LAST_N_EPOCHS_STATE] [--save_state] [--resume RESUME] [--train_batch_size TRAIN_BATCH_SIZE] [--max_token_length {None,150,225}] [--use_8bit_adam] [--mem_eff_attn] [--xformers] [--vae VAE] [--learning_rate LEARNING_RATE] [--max_train_steps MAX_TRAIN_STEPS] [--max_train_epochs MAX_TRAIN_EPOCHS] [--max_data_loader_n_workers MAX_DATA_LOADER_N_WORKERS] [--persistent_data_loader_workers] [--seed SEED] [--gradient_checkpointing] [--gradient_accumulation_steps GRADIENT_ACCUMULATION_STEPS] [--mixed_precision {no,fp16,bf16}] [--full_fp16] [--clip_skip CLIP_SKIP] [--logging_dir LOGGING_DIR] [--log_prefix LOG_PREFIX] [--lr_scheduler LR_SCHEDULER] [--lr_warmup_steps LR_WARMUP_STEPS] [--prior_loss_weight PRIOR_LOSS_WEIGHT] [--no_metadata] [--save_model_as {None,ckpt,pt,safetensors}] [--unet_lr UNET_LR] [--text_encoder_lr TEXT_ENCODER_LR] [--lr_scheduler_num_cycles LR_SCHEDULER_NUM_CYCLES] [--lr_scheduler_power LR_SCHEDULER_POWER] [--network_weights NETWORK_WEIGHTS] [--network_module NETWORK_MODULE] [--network_dim NETWORK_DIM] [--network_alpha NETWORK_ALPHA] [--network_args [NETWORK_ARGS [NETWORK_ARGS ...]]] [--network_train_unet_only] [--network_train_text_encoder_only] [--training_comment TRAINING_COMMENT]
詳細は,https://github.com/kohya-ss/sd-scripts/blob/main/README-ja.mdを熟読すること.
5.トラブルシューティング python3.8で学習時,train_network.pyにて TypeError: 'type' object is not subscriptable というエラーが表示される https://github.com/kohya-ss/sd-scripts/issues/38 に記載がある.
The error seems to be related to type hints feature of Python. ->list[LoRAModule]: This notation seems to be supported from Python 3.9. This repo is tested on Python 3.10, but you seem to use Python 3.8. Please update Python to 3.10.x. If it is difficult, please remove ->list[LoRAModule]. However, another error might occur, so I recommend to use Python 3.10.
1 note · View note
aravindkocherla · 4 years ago
Text
Tumblr media
Hi, this is @aravindkocherla. I have started my new account with my fav god #ganesh
3 notes · View notes
saidulislam523 · 5 years ago
Photo
Tumblr media
Honorable Sir, Are you looking for Graphics Designer Like Photo/Product Background remove, Retouching & Enhancement worker? Yes, if you need any purpose please knock me like skype: Saidul Islam.bd,d Upwork: https://bit.ly/2L1olmu
1 note · View note
asgunsas · 4 years ago
Photo
Tumblr media
#selfie #morning #morningpicture #colorspatterns #colorgrams #white_background #background #colorgram #colorphoto #colors #like4likes #like4likers #likeforlikes #like4likesback #like4like (at Alexandria, Egypt) https://www.instagram.com/p/CL0uLs1BRJ0/?igshid=1dqtqt19mdvem
0 notes
zolwar · 5 years ago
Photo
Tumblr media
#orbea #No_People #Bicycle #Sport #Mountain_Bike #Bike #Wheel #Transportation #Cut_out #Mode_of_Transport #Tire_Vehicle #Single_Object #Brake #White_Background #Equipment #Land_Vehicle #Brake #Pedal #Day #Bord #City_life #Street #Road #Lifestyles #Outdoors #Cycling #zolwa2r #Like4follow #iphone11promax https://www.instagram.com/p/CAnqsNdgqhs/?igshid=u1gzuvbs0w36
0 notes
maraharme · 7 years ago
Photo
Tumblr media
Notepad - Lord of the rings 👑💍
4 notes · View notes
mambodan · 5 years ago
Video
Thank you to _______ by Daniel J Chan II Via Flickr: Thank you to all the medical professionals Thank you to all first responders Thank you to all the law enforcement officers Thank you to all the transit workers Thank you to everyone who place themselves on the front line, risk their health and life. Thank You, Thank You!
0 notes
clippingpath5-blog · 7 years ago
Photo
Tumblr media
Clipping path service provider. #background_removal #clipping_path #white_background #change_background #add_shadow #remove_shadow Please contact: [email protected]
0 notes
clippingdesignhome · 2 years ago
Text
NECK JOINT PHOTO & MANIPULATION SERVICE ------
We provide all kinds of services that come with Neck Joint Service, Photo Manipulation. You can expect anything and everything that is related to the invisible mannequin service. We’re here to make your images stunning with the offers we have –
Clipping Path Service Provider | Image & Photo Editing Service
#neckjointservice #manipulation ‪#neck #imagemanipulation #neckjoint #Ghost #Mannequin #eCommerce #jacket #garments #fashion #clothing #ghostmannequin #ghostmannequineffect #backgroundremoval #removalbackground #backgroundremovalservice #photobackgroundremoval #imagebackgroundremoval #backgroundremovalservices #modelbackgroundremoval #productbackgroundremoval #productphotography #amazon #transparent #ecommercephotography #fiverr #fiverrgigs #clientwork #ecommerceshoot #photoshoppro #photoshoptutorials #photoshopwork #backgroundremove #photoeditingskills #manuplation #imageediting #clippingpath #removebackground #image_editing #clippingpathservice #white_background #remove_background #cutoutimage
Tumblr media
0 notes
silopath · 4 years ago
Text
Tumblr media
In this part, we will remove unwanted objects from model photos using the clone stamp tool. The clone stamp tool photoshop’s working process is that we have to select an area that we want to replace with the unwanted object.Now that we have selected the area that we want to use as a sample after removing the unwanted object. Now paint over the object, and because of the clone stamp and our selection, the sample area we had selected earlier will replace the unwanted object. The clone stamp tool copies the pixel of that area we choose. A small plus sign will show that the brush is copying over the object you want to remove from the sample area. You can simply remove white background photoshop.
Here is more about: https://www.silopath.com/how-to-remove-an-object-in-photoshop
#Silo_path #Model_Photography #Remove_Bg #White_Background #Clone_Stamp_Tool
0 notes
riscasogato · 4 years ago
Photo
Tumblr media
Acrylic on canvas-black and white_background
0 notes
designercountry · 5 years ago
Photo
Tumblr media
#Photoshop Specialist Service Global Provider #White_Background #Clipping_Path Visit Here: www.designercountry.com
0 notes
asgunsas · 4 years ago
Photo
Tumblr media
#mustache #withoutmustache #with_out_mustache #without #withmustache #nightselfie #black #white #blackwhite #white_background #black_white_photography #photography #withoutglasses #hair #homeselfies #smile #instasmile #face #like4likers #likeforlikes #likes4like #like4likesback #like4likealways #likeme #likemyrecent #like4likes (at Alexandria, Egypt) https://www.instagram.com/p/CIMl40DhDrX/?igshid=1qn7tfl1t9cvi
0 notes
zolwar · 5 years ago
Photo
Tumblr media
#orbea #No_People #Bicycle #Sport #Mountain_Bike #Bike #Wheel #Transportation #Cut_out #Mode_of_Transport #Tire_Vehicle #Single_Object #Brake #White_Background #Equipment #Land_Vehicle #Brake #Pedal #Day #Bord #City_life #Street #Road #Lifestyles #Outdoors #Cycling #zolwa2r #Like4follow #iphone11promax https://www.instagram.com/p/CAnqon4AjUF/?igshid=2u9i1z88zszt
0 notes
imageeditingus · 6 years ago
Photo
Tumblr media
Hello friends! You will need pure #white_background product #picture for #amazon. Do you need picture #background #removal_service?
Clipping Path Express providing :
#pure_white_background
#transparent_background
#jpg_png_PSD
 or any other format. For details:  https://t.co/yxxKG1JdoK
0 notes