SegFormer icon indicating copy to clipboard operation
SegFormer copied to clipboard

custom dataset training for segmentation

Open soheilmajidi opened this issue 3 years ago • 3 comments

hi is there any way to train segformer for custom dataset with pretrain weights? thanks

soheilmajidi avatar Apr 29 '22 17:04 soheilmajidi

Hi, how to create data in the format required by the segformer model? @soheilmajidi

FatemaD1 avatar Nov 28 '22 10:11 FatemaD1

same questions too... Did anyone solved ?😵‍💫

NowLoadY avatar Feb 19 '23 16:02 NowLoadY

参考 docs/tutorials/customize_datasets.md

1.在 local_configs/datasets 仿照cityscapes.py写一个自定义数据集文件。 里面的dataset_type改成CustomDataset。data_root写你自己的数据集路径。

dataset_type = 'CustomDataset'

  1. 仿照local_configs/segformer/B1/segformer.b1.512x512.ade.160k.py,写一个自定义配置文件。

before: ` base = [ '../../base/models/segformer.py', '../../base/datasets/ade20k_repeat.py', '../../base/default_runtime.py', '../../base/schedules/schedule_160k_adamw.py' ]

num_classes=150,

` after:

` base = [ '../../base/models/segformer.py', '../../base/datasets/custom.py', '../../base/default_runtime.py', '../../base/schedules/schedule_160k_adamw.py' ]

num_classes=`

QuietWoods avatar Aug 04 '23 02:08 QuietWoods