We are currently using a complex setup for deep learning in our lab, which involves Windows11, VcXsrv, WSL2, Ubuntu 20.02, Xfce4, Miniconda, pip, PyTorch, JetBrains Toolbox, and PyCharm. This setup provides a good environment for GPU execution and version management of Python modules. However, we are considering switching to a native Ubuntu setup, as it seems more suitable than using Windows with WSL2. We also plan to incorporate Docker into our workflow.
One concern we have is the occasional need to use Microsoft Word and Excel. We are unsure if these applications can be used on Linux and how to manage this requirement. We would appreciate any advice on this matter.
It's worth noting that setting up WSL2 can be challenging. As an alternative, using Windows with Miniconda, pip, PyTorch, JetBrains Toolbox, and PyCharm might be a more straightforward approach.
どうやらWSL2+PyTorchは安定している.少なくとも,detectron2は,今のところ動いている.(WSLは250GB以上に割り当てできないのか?そんなことはないよう(Windows10はダメで,Windows11ならOKか?)です.こんな方法も.resize2fsコマンドを使用)
Used when specifying areas to be extracted (by drawing polygons, rectangles, or other shapes).
そこから学習データとして画像で扱うならば(デフォルトはjsonファイル),そのフォーマットに関してRGBモード,Palleteモードが関わる(変換が必要な)ときがあり,その際はPythonのPillowモジュールの利用がいいのかも?画像の見た目ではモードの違いは分からない。(CycleGAN(特別な使い方ですが)や物体検出系の深層学習モデルで使用する際に)
ここで大事なのは,後々の深層学習モデルで指定されるのはRGBモードかパレットモードか?
python labelme_json_to_png_L.py /mnt/c/Users/landslide/Desktop/niiyama/test_input -o=/mnt/c/Users/landslide/Desktop/niiyama/test_input_b -class_name="guardrail b" -pixel_value=255
python C:\Users\d18036\Desktop\labelme-main\examples\instance_segmentation\labelme2coco.py "C:\Users\d18036\Desktop\hodoukyou2023\hodoukyou-iroiro\kiritori-rear\test" "C:\Users\d18036\Desktop\hodoukyou2023\hodoukyou-iroiro\kiritori-rear\kiritori-henkan3" --labels "C:\Users\d18036\Desktop\hodoukyou2023\labels.txt"要するに,
__ignore__ _background_ raillabelme2coco.pyの
for shape in label_file.shapes: points = shape["points"] label = shape["label"] group_id = shape.get("group_id") shape_type = shape.get("shape_type", "polygon") if shape_type == "rectangle": (x1, y1), (x2, y2) = points x1, x2 = sorted([x1, x2]) y1, y2 = sorted([y1, y2]) points = [(x1, y1), (x2, y2)] mask = labelme.utils.shape_to_mask(img.shape[:2], points, shape_type) ...としたら(If文のところの挿入,mask=の前まで.)いいようです.
転移学習のプログラムができた.
(いまのところ回帰のプログラム.)
ここのtqdmとかのブランチにある以下のファイル.
画像データセットと属性ファイルをTraining-Validation,Testに分けるプログラムができた.
(なぜ,Training-Validation,Testかというと,K-foldを使用前提)
jupyter nbconvert --to script input_file.ipynb
Roboflow could be versatile and useful.
pix2pixとCycleGANは,PyTorch系のこのプログラムを使います.
★ノーマルモード
python train.py --dataroot ./datasets/yellow2brown/ --name yellow2brown7 --model cycle_gan --gpu_ids 1 --n_epochs 200 --lr 0.0005 python train.py --dataroot ./datasets/yellow2brown/ --name yellow2brown7 --model cycle_gan --gpu_ids 1
★マスク適用
訓練:
python train_mask.py --dataroot ./datasets/yellow2brown_mask_new/ --name yellow2brown_mask_new3 --model cycle_gan_mask --gpu_ids 1 --n_epochs 200 --lr 0.0005 --mask_weight 1 --dataset_mode unalignedmask
python train_mask.py --dataroot ./datasets/yellow2brown_cut_mask/ --name yellow2brown_cut_mask_weight_3_norm --model cycle_gan_mask_norm --gpu_ids 0 --n_epochs 100 --mask_weight 3 --dataset_mode unalignedmask --load_size 256 --preprocess resize
テスト:
python test.py --dataroot ./datasets/yellow2brown_mask --name yellow2brown_mask150 --model cycle_gan --epoch 150 --gpu_ids 1
python test.py --dataroot ./datasets/yellow2brown_cut_mask --name yellow2brown_cut_mask_weight_0t1_norm --model cycle_gan_mask_norm_test --epoch 5 --gpu_ids 0 --phase test
ここで、
Train/Test Tips 日本語
dataset例
マスクデータ例
例えば,インストール方法や使用法は,ここにある.
基本的に,dockerを使うのだが,いろいろと見ていると+WSL2のように読めるが,docker+windowsでいけてる?ようです.
インストール後は,ブラウザにて以下のURLにて扱える.
http://localhost:5000/
以下のように,キーポイントの設定がし易いのがGood!
取り扱うデータは,当該ディレクトリのdatasetsに置くようです.