Note: nvidia-docker2 is required. (maybe already installed)
docker pull ironluffy/rice:initial
git clone https://github.com/ironluffy/RiceSeg.git
cd RiceSeg/mmsegmentation
pip install -v -e .
.
├── Dataset
│ ├── 1.원천데이터
│ │ ├── R20220726A25B1036.tif
│ │ ├── R20220726A25B1037.tif
│ │ └── ...
│ ├── 2.라벨링데이터
│ │ ├── R20220726A25B1036.json
│ │ ├── R20220726A25B1037.json
│ │ └── ...
├── RiceSeg
│ ├── README.md
│ ├── src
│ ├── mmsegmentation
│ ├── pretrained_ckpt
│ └── .gitignore
└── index.html
python3 src/data_preprocess.py
```python
dataset_type = 'RiceDataset'
data_root= '../data'
...
```
python3 ./mmsegmentation/tools/train.py ./mmsegmentation/configs/rice/segformer_mit-b4_lovasz_gne_chw.py
python3 mmsegmentation/tools/train.py mmsegmentation/configs/rice/knet_s3_upernet_swin-l_lovasz_gne_chw.py
python3 ./mmsegmentation/tools/train.py ./mmsegmentation/configs/rice/segmenter_vit-b_mask.py
사용자는 mmsegmentation/configs/rice
폴더에 파일을 참조하고 구성파일을 추가할 수 있습니다. mmsegmentation/configs/_base_/models
폴더에 미리 정의된 여러개의 모델을 사용할 수 있으며 새로운 모델을 추가할 수 있습니다.mmsegmentation/configs/_base_/datasets
에서 데이터 세트의 구성을 변경할 수 있으며 기본데이터 세트는mmsegmentation/configs/_base_/datasets
의 rice_gne_chw.py
입니다.
* Please refer to the files in mmsegmentation/configs/rice
and add a new configuration file you want to use. You can use several pre-defined models in mmsegmentation/configs/_base_/models
and you can add a new model in there. Also, you can change the configuration of dataset as well, in mmsegmentation/configs/_base_/datasets
. The default dataset is rice_gne_chw.py
in mmsegmentation/configs/_base_/datasets
.
사용자가 모델의 모델 학습 반복횟수(iterations)를 늘리거나 줄이려는 경우 훈련을 위한 기본 런타임 구성인 mmsegmentation/configs/_base_/rice_runtime.py
를 참조하십시요.
* If you want to increase/decrease the nubmer of iterations. Please refer to the fiels in mmsegmentation/configs/_base_/rice_runtime.py
which is the the basic run-time configuration for tranining.
Tips. 생각보다 성능이 나오지 않는다면 여러개의 GPU를 사용하여 ./mmsegmentation/tools/train.py
대신 ./mmsegmentation/tools/dist_train.sh
를 사용하시길 권장드립니다.
* If you want to your multiple GPUs, your ./mmsegmentation/tools/dist_train.sh
instead of ./mmsegmentation/tools/train.py
. (Try it if the performance is lower than you think)
python3 ./mmsegmentation/tools/test.py .{config file path} {checkpoint_path} --eval mIoU
* Optionally, if you want to save inference results, please add --show-dir {output path}
to the command.
python3 mmsegmentation/tools/test.py mmsegmentation/configs/rice/knet_s3_upernet_swin-l_lovasz_gne_chw.py ./work_dirs/knet_s3_upernet_swin-l_lovasz_gne_chw/latest.pth --eval mIoU
python3 mmsegmentation/tools/test.py mmsegmentation/configs/rice/knet_s3_upernet_swin-l_lovasz_gne_chw.py ./best_ckpt/knet.pth --eval mIoU
python3 mmsegmentation/tools/test.py mmsegmentation/configs/rice/segmenter_vit-b_lovasz_gne_chw.py ./work_dirs/segmenter_vit-b_mask/latest.pth --eval mIoU
python3 mmsegmentation/tools/test.py mmsegmentation/configs/rice/segmenter_vit-b_lovasz_gne_chw.py ./best_ckpt/segmenter.pth --eval mIoU
python3 mmsegmentation/tools/test.py mmsegmentation/configs/rice/segformer_mit-b4_lovasz_gne_chw.py ./work_dirs/segformer_mit-b4_lovasz_gne_chw/latest.pth --eval mIoU
python3 mmsegmentation/tools/test.py mmsegmentation/configs/rice/segformer_mit-b4_lovasz_gne_chw.py ./best_ckpt/segformer.pth --eval mIoU
mmsegmentation/configs/{class_name}
를 참조하시길 바랍니다.
예를 들어 정상 vs. 결주
로 모델을 테스트하고 싶다면 다음 명령어를 사용하세요(특정모델의 체크포인트 선택가능)
모델의 성능에 대한 평균정확도를 확인하세요.
* Please refer to the directory mmsegmentation/configs/{class_name}
. For example, if you want to test the model with the configuration of normal vs. gyeolju
, please use the following command. (you can choose specific model checkpoint) And you should report mean accuracy (mAcc.) for the model performance
python3 mmsegmentation/tools/test.py mmsegmentation/configs/gyeolju/segformer_mit-b4.py ./work_dirs/segformer_mit-b4_lovasz_gne_chw/latest.pth --eval mIoU