语义分割模型
Segment-Anything(SAM)
SAM2
Grounding-DINO
Grounded-SAM
Geospatial-SAM
Samba
pip install causal-conv1d==1.1.1
pip install mamba-ssm
pip install apex-amp, pyyaml, timm, tlt (apex-amp没找到,没装)
下载的Train.zip,VAL.zip用于训练生成权重文件,自行下载解压后,放置在 samba-path/data/loveDA/
下,并按照以下结构调整:
ann_dir
下存放Train和VAL的mask_pngs
文件内图片,即瓦片的掩码
img_dir 下存放Train和VAL的瓦片文件
- ann_dir
- train
- .png
- val
- .png
- train
- img_dir
- train
- .png
- val
- .png
- train
3. 配置文件
- The model file Samba.py can be found in samba-path/mmseg/models/backbones/
- The config file samba_upernet.py for the combination of backbone and decoder head samba_upernet can be found in /samba-path/configs/base/models
- The config file samba_upernet-15k_loveda-512x512_6e4.py for training can be found in /samba-path/configs/samba/
4. 训练 Samba
双卡4090训练速度大概在2个小时,针对Train的城镇数据
bash tools/dist_train.sh /samba-path/configs/samba/samba_upernet-15k_loveda-512x512_6e4.py 2 --work-dir /samba-path/output/sambaupernet
bash tools/dist_train.sh /samba-path/configs/samba/samba_upernet-15k_potsdam-512x512_6e4.py 2 --work-dir /samba-path/output/sambaupernet
bash tools/dist_train.sh /samba-path/configs/samba/samba_upernet-15k_vaihingen-512x512_6e4.py 2 --work-dir /samba-path/output/sambaupernet
测试 Samba
有点没搞明白,测试数据也需要提供masks_png,不然就报错了······
bash tools/dist_test.sh /samba-path/configs/samba/samba_upernet-15k_loveda-512x512_6e4.py \ /samba-path/output/sambaupernet/iter_15000.pth 2 --out /mmsegmentation/visout/sambaupernet
bash tools/dist_test.sh /samba-path/configs/samba/samba_upernet-15k_potsdam-512x512_6e4.py \ /samba-path/output/sambaupernet/iter_15000.pth 2 --out /mmsegmentation/visout/sambaupernet
bash tools/dist_test.sh /samba-path/configs/samba/samba_upernet-15k_vaihingen-512x512_6e4.py \ /samba-path/output/sambaupernet/iter_15000.pth 2 --out /mmsegmentation/visout/sambaupernet
github搜索关键词
https://github.com/liliu-avril/Awesome-Segment-Anything
https://github.com/Hedlen/awesome-segment-anything