Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
141 commits
Select commit Hold shift + click to select a range
d5f4786
test
VIncentmuyi Dec 3, 2025
e79042b
test
VIncentmuyi Dec 3, 2025
bd114d2
test
VIncentmuyi Dec 3, 2025
01529d7
test
VIncentmuyi Dec 3, 2025
b2405e8
test
VIncentmuyi Dec 3, 2025
440d160
test
VIncentmuyi Dec 3, 2025
eb52e5f
test
VIncentmuyi Dec 3, 2025
4c3e6d1
test
VIncentmuyi Dec 3, 2025
ef9b54f
test
VIncentmuyi Dec 3, 2025
7116772
test
VIncentmuyi Dec 4, 2025
e25fdef
test
VIncentmuyi Dec 4, 2025
de92dc2
test
VIncentmuyi Dec 4, 2025
aff08be
test
VIncentmuyi Dec 4, 2025
be57583
test
VIncentmuyi Dec 5, 2025
9e6575d
test
VIncentmuyi Dec 9, 2025
4604e4f
test
VIncentmuyi Dec 11, 2025
5fba1b2
test
VIncentmuyi Dec 18, 2025
8f10b23
test
VIncentmuyi Dec 18, 2025
7a67de8
test
VIncentmuyi Jan 21, 2026
c42adf3
test
VIncentmuyi Jan 21, 2026
d06b683
test
VIncentmuyi Jan 22, 2026
b569993
test
VIncentmuyi Jan 23, 2026
f4acfa4
将6个模型配置文件从iter训练改为epoch训练
claude Feb 2, 2026
f67f3f4
test
VIncentmuyi Feb 2, 2026
2b3d67b
test
VIncentmuyi Feb 2, 2026
8251600
test
VIncentmuyi Feb 2, 2026
d0fc49e
移除schedule_20k.py继承并添加缺失的optim_wrapper
claude Feb 2, 2026
6f7e6fa
Merge remote-tracking branch 'origin/claude/iter-to-epoch-training-uF…
VIncentmuyi Feb 2, 2026
626001d
Fix infinite training loop by replacing InfiniteSampler with DefaultS…
claude Feb 2, 2026
d361d48
Merge remote-tracking branch 'origin/claude/fix-checkpoint-save-path-…
VIncentmuyi Feb 2, 2026
ddb133b
Add drop_last=True to train_dataloader to fix BatchNorm error
claude Feb 2, 2026
7a52b87
Change logger to display by epoch instead of iteration
claude Feb 2, 2026
cd89cd0
Merge remote-tracking branch 'origin/claude/fix-checkpoint-save-path-…
VIncentmuyi Feb 2, 2026
213b3f3
Fix logger configuration to display training progress by epoch
claude Feb 2, 2026
ad2a3ff
Merge remote-tracking branch 'origin/claude/fix-checkpoint-save-path-…
VIncentmuyi Feb 2, 2026
c1d4ab1
Fix checkpoint save_best metric key to match evaluator prefix
claude Feb 2, 2026
a342da8
Remove prefix from evaluators to match standard mmseg convention
claude Feb 2, 2026
2214faf
Merge remote-tracking branch 'origin/claude/fix-checkpoint-save-path-…
VIncentmuyi Feb 2, 2026
9e11b84
Apply training fixes to all 5 model configs and 2 dataset configs
claude Feb 2, 2026
1c07242
test
VIncentmuyi Feb 3, 2026
01fc80e
Add register_all_modules call to train.py to register custom transforms
claude Feb 3, 2026
58c7c25
Merge remote-tracking branch 'origin/claude/fix-checkpoint-save-path-…
VIncentmuyi Feb 3, 2026
2ce2c2a
Fix 8-band TIFF image loading by adding LoadMultiBandTiffFromFile tra…
claude Feb 3, 2026
dea576f
Remove PhotoMetricDistortion from UAVflood pipeline for multi-band co…
claude Feb 3, 2026
29a4198
test
VIncentmuyi Feb 3, 2026
be14eff
Update all dataset configs and segformer model for multi-band TIFF su…
claude Feb 3, 2026
9d2c372
Merge remote-tracking branch 'refs/remotes/origin/claude/fix-reduce-z…
VIncentmuyi Feb 3, 2026
880ae87
Add LoadMultiBandTiffFromFile to transforms module exports
claude Feb 3, 2026
c90683c
Merge remote-tracking branch 'origin/claude/fix-reduce-zero-label-war…
VIncentmuyi Feb 3, 2026
28c454d
Remove _delete_=True from all model optim_wrapper configs
claude Feb 3, 2026
c499d38
Merge remote-tracking branch 'refs/remotes/origin/claude/fix-reduce-z…
VIncentmuyi Feb 3, 2026
a9179bc
test
VIncentmuyi Feb 3, 2026
d6c709c
test
VIncentmuyi Mar 2, 2026
131e288
Migrate multi-modal FloodNet config from mmseg 0.x to 1.x
claude Mar 17, 2026
a33903e
Merge pull request #1 from VIncentmuyi/claude/floodnet-config-depende…
VIncentmuyi Mar 17, 2026
445eda4
Fix multi-modal data preprocessing and sampler bugs
claude Mar 18, 2026
69b0adf
Bump MMCV_MAX from 2.2.0 to 2.3.0 for compatibility
claude Mar 18, 2026
fb45538
Merge pull request #2 from VIncentmuyi/claude/floodnet-config-depende…
VIncentmuyi Mar 18, 2026
fb4d796
Fix Pad transform: use pad_val dict instead of seg_pad_val
claude Mar 18, 2026
ceb9725
Merge pull request #3 from VIncentmuyi/claude/floodnet-config-depende…
VIncentmuyi Mar 18, 2026
7474ddd
Add MultiModalPad: numpy-based padding for >4 channel images
claude Mar 18, 2026
5a05a11
Merge pull request #4 from VIncentmuyi/claude/floodnet-config-depende…
VIncentmuyi Mar 18, 2026
4142a81
Revert sampler __len__ to match 0.x behavior (return batch count)
claude Mar 19, 2026
4120a16
Add Swin-Base + MoE multi-modal FloodNet config
claude Mar 19, 2026
aaafc32
Restore batch_size=16 for Swin-Base+MoE config (48GB GPU)
claude Mar 19, 2026
3a0c876
Merge pull request #5 from VIncentmuyi/claude/floodnet-config-depende…
VIncentmuyi Mar 19, 2026
78a904d
test
VIncentmuyi Mar 20, 2026
29603e3
Add filter_modality parameter to MultiModalDeepflood dataset
claude Mar 21, 2026
bd9dd81
Merge pull request #6 from VIncentmuyi/claude/test-modality-accuracy-…
VIncentmuyi Mar 21, 2026
0dddfd0
Add SAR-only training config with 100 epochs
claude Mar 21, 2026
9d740ab
Merge pull request #7 from VIncentmuyi/claude/test-modality-accuracy-…
VIncentmuyi Mar 21, 2026
1e56698
Update multimodal config: slide test, 1024 resize, multi-scale augmen…
claude Mar 21, 2026
78a4bb7
Merge pull request #8 from VIncentmuyi/claude/test-modality-accuracy-…
VIncentmuyi Mar 21, 2026
be3489a
Update SAR-only config: slide test, 1024 resize, multi-scale augmenta…
claude Mar 21, 2026
fa6a4c4
Merge pull request #9 from VIncentmuyi/claude/test-modality-accuracy-…
VIncentmuyi Mar 21, 2026
f1ac37d
Fix slide_inference for multimodal inputs
claude Mar 21, 2026
2fa71f5
Merge pull request #10 from VIncentmuyi/claude/test-modality-accuracy…
VIncentmuyi Mar 21, 2026
ef4fb45
Align MoE RandomResize scale with Baseline config
claude Mar 22, 2026
447eb8f
Merge pull request #11 from VIncentmuyi/claude/charming-shannon-a47rI
VIncentmuyi Mar 22, 2026
9145c4f
test
VIncentmuyi Mar 22, 2026
7d3b23b
Align sar_boost config with sar_only: RandomResize scale and epochs
claude Mar 22, 2026
0355748
Merge pull request #12 from VIncentmuyi/claude/charming-shannon-a47rI
VIncentmuyi Mar 22, 2026
16a7798
test
VIncentmuyi Mar 22, 2026
d6c0a63
Fix slide_inference crash with mixed-channel multimodal inputs
claude Mar 23, 2026
c108cbc
Merge pull request #13 from VIncentmuyi/claude/debug-training-metrics…
VIncentmuyi Mar 23, 2026
a6aeed4
Add paper experiment plan with ablation configs and run script
claude Mar 25, 2026
163f794
Revise experiment plan: update Table 2/3/4 with per-modality testing
claude Mar 25, 2026
0f85674
Skip Full Model training/testing in run script (already completed)
claude Mar 25, 2026
82cbbee
Merge pull request #14 from VIncentmuyi/claude/floodnet-paper-experim…
VIncentmuyi Mar 25, 2026
6dc5834
Fix seed argument: use --cfg-options randomness.seed instead of --seed
claude Mar 25, 2026
580ce96
Merge pull request #15 from VIncentmuyi/claude/floodnet-paper-experim…
VIncentmuyi Mar 25, 2026
967eb09
Add multi-modal FPS/FLOPs benchmark script
claude Mar 26, 2026
800b521
Add expert routing visualization script (Fig 4)
claude Mar 26, 2026
bfc65a0
Merge pull request #16 from VIncentmuyi/claude/floodnet-paper-experim…
VIncentmuyi Mar 26, 2026
916aa18
Add detailed Method section technical reference for paper writing
claude Mar 28, 2026
7930d95
Add expanded metrics test script for Table 2/3/4 experiments
claude Mar 31, 2026
58460c2
Merge pull request #18 from VIncentmuyi/claude/floodnet-paper-experim…
VIncentmuyi Mar 31, 2026
87064a4
Add test script supporting Precision, Recall, OA, F1 Score, mIoU metrics
claude Apr 1, 2026
d86d8ca
Merge pull request #19 from VIncentmuyi/claude/add-testing-visualizat…
VIncentmuyi Apr 1, 2026
e1a3451
Add frozen_stages support for backbone fine-tuning
claude Apr 1, 2026
64bc8f5
Merge pull request #20 from VIncentmuyi/claude/floodnet-paper-experim…
VIncentmuyi Apr 1, 2026
54a4e78
test
VIncentmuyi Apr 1, 2026
37432f6
Fix test.py registry and Table 4 SAR-only config issues
claude Apr 1, 2026
103bbf4
Merge pull request #21 from VIncentmuyi/claude/floodnet-paper-experim…
VIncentmuyi Apr 1, 2026
5c6f046
Add script to collect experiment results into Excel tables
claude Apr 2, 2026
218c688
Merge pull request #22 from VIncentmuyi/claude/floodnet-paper-experim…
VIncentmuyi Apr 2, 2026
6c06e83
Add config for continuing training to 150 epochs
claude Apr 2, 2026
e7d7758
Merge pull request #23 from VIncentmuyi/claude/floodnet-paper-experim…
VIncentmuyi Apr 2, 2026
46eb43a
Fix benchmark_multimodal.py: dummy input should be 3D (C,H,W) not 4D
claude Apr 2, 2026
d672100
Merge pull request #24 from VIncentmuyi/claude/floodnet-paper-experim…
VIncentmuyi Apr 2, 2026
ff9f5f8
Rewrite benchmark FLOPs to use backbone+decoder wrapper
claude Apr 2, 2026
bddabb8
Merge pull request #25 from VIncentmuyi/claude/floodnet-paper-experim…
VIncentmuyi Apr 2, 2026
8f6a901
Fix visualize_expert_routing.py: dummy input should be 3D (C,H,W)
claude Apr 2, 2026
c1f20cd
Merge pull request #26 from VIncentmuyi/claude/floodnet-paper-experim…
VIncentmuyi Apr 2, 2026
8229c59
test
VIncentmuyi Apr 2, 2026
a4d6667
Fix overlapping y-axis labels in expert routing figures
claude Apr 2, 2026
0e66e7f
Merge branch 'main' into claude/floodnet-paper-experiments-NHeaL
VIncentmuyi Apr 2, 2026
f62df8a
Merge pull request #27 from VIncentmuyi/claude/floodnet-paper-experim…
VIncentmuyi Apr 2, 2026
3cf9abd
Add single-modal fine-tuning config for generalization experiments
claude Apr 2, 2026
fe66cf1
Merge pull request #28 from VIncentmuyi/claude/floodnet-paper-experim…
VIncentmuyi Apr 2, 2026
b1e3dc7
Fix sampler override with _delete_=True to prevent merge leak
claude Apr 2, 2026
0f37ab7
Merge pull request #29 from VIncentmuyi/claude/floodnet-paper-experim…
VIncentmuyi Apr 2, 2026
4808c39
test
VIncentmuyi Apr 2, 2026
d279856
Add large TIF tile-based inference script with stitching
claude Apr 2, 2026
9fa96bb
Merge pull request #30 from VIncentmuyi/claude/floodnet-paper-experim…
VIncentmuyi Apr 2, 2026
0b9e72e
Fix critical normalization bug in large TIF inference
claude Apr 4, 2026
ea12db7
Merge pull request #31 from VIncentmuyi/claude/floodnet-paper-experim…
VIncentmuyi Apr 4, 2026
2e74b9d
Use real test images instead of random noise for routing analysis
claude Apr 7, 2026
3c25fd3
Merge pull request #32 from VIncentmuyi/claude/floodnet-paper-experim…
VIncentmuyi Apr 8, 2026
f0850aa
Fix routing visualization to properly load real test images
claude Apr 9, 2026
fbb508a
Merge pull request #33 from VIncentmuyi/claude/floodnet-paper-experim…
VIncentmuyi Apr 9, 2026
4282235
Add Sen1Floods11 S1/S2 fine-tune configs and dataset
claude Apr 14, 2026
db6b33a
Merge pull request #34 from VIncentmuyi/claude/configure-flood-detect…
VIncentmuyi Apr 14, 2026
35c4398
test
VIncentmuyi Apr 15, 2026
1470e3f
test
VIncentmuyi Apr 15, 2026
d3bbaf9
Fix MoE dispatcher NaN-gate crash during fine-tune
claude Apr 15, 2026
ff6793f
Sanitize non-finite pixels in MultiModalNormalize
claude Apr 15, 2026
f6810a1
Sen1Floods11 S1 & S2 fine-tune: splits + clean 512x512 pipelines
claude Apr 15, 2026
6496122
Add tools/remap_pred_colors.py: remap prediction image colors
claude Apr 16, 2026
efa2414
Fix nodata pixels in prediction visualization
claude Apr 17, 2026
7d6b271
Simplify remap_pred_colors.py: treat nodata same as background
claude Apr 17, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
170 changes: 170 additions & 0 deletions 8to2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
import os
import numpy as np
import rasterio
from shutil import copy2
from tqdm import tqdm


def keep_last_two_bands(folder_path, backup=True, backup_suffix='_8band_backup'):
"""
将所有TIF文件只保留最后两个波段,覆盖原文件

参数:
folder_path: 要处理的根目录路径
backup: 是否备份原文件
backup_suffix: 备份文件后缀
"""
total_files = 0
files_processed = 0
files_skipped = 0
tif_extensions = ['.tif', '.tiff', '.TIF', '.TIFF']

# 收集所有tif文件
print(f"扫描路径: {folder_path}")
tif_files = []
for root, dirs, files in os.walk(folder_path):
for file in files:
if any(file.endswith(ext) for ext in tif_extensions):
tif_files.append(os.path.join(root, file))

total_files = len(tif_files)
print(f"找到 {total_files} 个TIF文件\n")

# 第一步:检查文件波段数
print("步骤1: 检查文件波段数...")
print("=" * 80)

band_info = {}
files_to_process = []

try:
iterator = tqdm(tif_files, desc="扫描文件")
except:
iterator = tif_files

for file_path in iterator:
try:
with rasterio.open(file_path) as src:
num_bands = src.count
rel_path = os.path.relpath(file_path, folder_path)

if num_bands not in band_info:
band_info[num_bands] = []
band_info[num_bands].append(rel_path)

if num_bands >= 2: # 只处理波段数>=2的文件
files_to_process.append((file_path, num_bands))
else:
files_skipped += 1

except Exception as e:
print(f"\n读取错误: {os.path.basename(file_path)}")
print(f" 错误: {e}")

# 显示波段数统计
print("\n波段数统计:")
for num_bands in sorted(band_info.keys()):
print(f" {num_bands}波段: {len(band_info[num_bands])} 个文件")

print(f"\n将处理 {len(files_to_process)} 个文件(波段数>=2)")
print(f"跳过 {files_skipped} 个文件(波段数<2)")

if len(files_to_process) == 0:
print("没有需要处理的文件!")
return

# 第二步:确认并处理
print("\n" + "=" * 80)
print("步骤2: 处理文件")
print("操作: 只保留最后两个波段,覆盖原文件")

if backup:
print(f"将创建备份文件(后缀: {backup_suffix})")
else:
print("警告: 不会创建备份!")

user_input = input("\n是否继续?(y/n): ")
if user_input.lower() != 'y':
print("操作已取消")
return

print("\n开始处理...")

try:
iterator = tqdm(files_to_process, desc="处理文件")
except:
iterator = files_to_process

for file_path, original_bands in iterator:
try:
# 备份原文件
if backup:
backup_path = file_path + backup_suffix
copy2(file_path, backup_path)

# 读取文件
with rasterio.open(file_path) as src:
# 保存元数据并修改波段数
meta = src.meta.copy()
meta['count'] = 2 # 修改为2波段

# 读取最后两个波段
band_n_1 = src.read(original_bands - 1) # 倒数第二个波段
band_n = src.read(original_bands) # 最后一个波段

# 创建临时文件
temp_path = file_path + '.tmp'

# 写入新文件(只有2个波段)
with rasterio.open(temp_path, 'w', **meta) as dst:
dst.write(band_n_1, 1) # 写入第1个波段
dst.write(band_n, 2) # 写入第2个波段

# 替换原文件
os.replace(temp_path, file_path)
files_processed += 1

except Exception as e:
print(f"\n处理错误: {os.path.basename(file_path)}")
print(f" 原波段数: {original_bands}")
print(f" 错误: {e}")
# 清理临时文件
temp_path = file_path + '.tmp'
if os.path.exists(temp_path):
os.remove(temp_path)

# 输出结果
print("\n" + "=" * 80)
print("处理完成!")
print(f"总文件数: {total_files}")
print(f"成功处理的文件: {files_processed}")
print(f"跳过的文件: {files_skipped}")

if backup:
print(f"\n原始文件已备份(后缀: {backup_suffix})")
print("如果确认无误,可以使用以下命令删除备份文件:")
print(f" find {folder_path} -name '*{backup_suffix}' -delete")

# 验证处理结果
print("\n步骤3: 验证处理结果...")
print("检查前3个文件的波段数...")

for i, (file_path, _) in enumerate(files_to_process[:3]):
try:
with rasterio.open(file_path) as src:
rel_path = os.path.relpath(file_path, folder_path)
print(f" ✓ {rel_path}: {src.count} 波段")
except Exception as e:
print(f" ✗ 验证失败: {e}")

if i >= 2: # 只检查前3个
break


if __name__ == "__main__":
folder_path = "/mnt/d/Project/Code/Floodnet/data/mixed_dataset/SAR/"

# 执行处理
# backup=True 会备份原文件(推荐)
# backup=False 直接覆盖(不推荐)
keep_last_two_bands(folder_path, backup=False, backup_suffix='_8band_backup')
148 changes: 148 additions & 0 deletions command
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
git clone https://VIncentmuyi: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@github.com/VIncentmuyi/Floodnet.git

/解决python不搜索本文件夹包的问题
ModuleNotFoundError: No module named 'mmseg'
export PYTHONPATH=.:$PYTHONPATH

ps -ef | grep python
pkill -9 python
git fetch origin
git reset --hard origin/main
git clean -fd # 删除未跟踪的文件

python tools/train.py ./configs/deeplabv3plus/Deeplabv3+UAVflood.py --work-dir work_dirs/SAR/Deeplabv3+
python tools/test_full_metrics.py ./configs/deeplabv3plus/Deeplabv3+UAVflood.py work_dirs/SAR/Deeplabv3+/best_mIoU_epoch_100.pth --work-dir ./Result/SAR/Deeplabv3+ --show-dir ./Result/SAR/Deeplabv3+/vis --cfg-options visualizer.alpha=1.0
python tools/analysis_tools/benchmark.py \
./configs/deeplabv3plus/Deeplabv3+UAVflood.py \
work_dirs/UAVflood/Deeplabv3+/best_val_mIoU_iter_20000.pth \
--repeat-times 3
python tools/analysis_tools/get_flops.py \
./configs/deeplabv3plus/Deeplabv3+UAVflood.py \
--shape 8 256 256

python tools/train.py ./configs/segformer/segformer_mit-b0_8xb1-160k_UAVflood-256x256.py --work-dir work_dirs/SAR/segformer
python tools/test_full_metrics.py ./configs/segformer/segformer_mit-b0_8xb1-160k_UAVflood-256x256.py work_dirs/SAR/segformer/best_mIoU_epoch_100.pth --work-dir ./Result/SAR/segformer/ --show-dir ./Result/SAR/segformer/vis --cfg-options visualizer.alpha=1.0
python tools/analysis_tools/benchmark.py \
./configs/segformer/segformer_mit-b0_8xb1-160k_UAVflood-256x256.py\
work_dirs/UAVflood/segformer/best_val_mIoU_iter_40000.pth \
--repeat-times 3
python tools/analysis_tools/get_flops.py \
./configs/segformer/segformer_mit-b0_8xb1-160k_UAVflood-256x256.py \
--shape 5 256 256

python tools/train.py ./configs/unet/Unet-Uavflood.py --work-dir work_dirs/SARflood/unet
python tools/test_full_metrics.py ./configs/unet/Unet-Uavflood.py work_dirs/SAR/unet/best_mIoU_epoch_90.pth --work-dir ./Result/SAR/unet/ --show-dir ./Result/SAR/unet/vis --cfg-options visualizer.alpha=1.0
python tools/analysis_tools/benchmark.py \
./configs/unet/Unet-Uavflood.py \
work_dirs/UAVflood/unet/best_val_mIoU_iter_40000.pth \
--repeat-times 3
python tools/analysis_tools/get_flops.py \
./configs/unet/Unet-Uavflood.py\
--shape 8 256 256

python tools/train.py ./configs/mae/mae-base-Uavflood.py --work-dir work_dirs/UAVflood/mae
python tools/test_full_metrics.py ./configs/mae/mae-base-Uavflood.py work_dirs/UAVflood/mae/best_val_mIoU_iter_20000.pth --work-dir ./Result/UAV/mae/ --show-dir ./Result/UAV/mae/vis --cfg-options visualizer.alpha=1.0
python tools/analysis_tools/benchmark.py \
./configs/mae/mae-base-Uavflood.py\
work_dirs/UAVflood/mae/best_val_mIoU_iter_28000.pth \
--repeat-times 3
python tools/analysis_tools/get_flops.py \
./configs/mae/mae-base-Uavflood.py\
--shape 5 256 256

python tools/train.py ./configs/vit/vit-Uavflood.py --work-dir work_dirs/SAR/vit
python tools/test_full_metrics.py ./configs/vit/vit-Uavflood.py work_dirs/SAR/vit/best_mIoU_epoch_100.pth --work-dir ./Result/SAR/vit/ --show-dir ./Result/SAR/vit/vis --cfg-options visualizer.alpha=1.0
python tools/analysis_tools/benchmark.py \
./configs/vit/vit-Uavflood.py\
work_dirs/UAVflood/vit/best_val_mIoU_iter_36000.pth \
--repeat-times 3
python tools/analysis_tools/get_flops.py \
./configs/vit/vit-Uavflood.py\
--shape 3 256 256

python tools/train.py ./configs/beit/beit-Uavflood.py --work-dir work_dirs/SARflood/beit
python tools/test_full_metrics.py ./configs/beit/beit-Uavflood.py work_dirs/UAVflood/beit/best_val_mIoU_iter_16000.pth --work-dir ./Result/UAV/beit/ --show-dir ./Result/UAV/beit/vis --cfg-options visualizer.alpha=1.0
python tools/analysis_tools/benchmark.py \
./configs/beit/beit-Uavflood.py\
work_dirs/UAVflood/beit/best_val_mIoU_iter_40000.pth\
--repeat-times 3
python tools/analysis_tools/get_flops.py \
./configs/beit/beit-Uavflood.py\
--shape 3 256 256

python tools/train.py ./configs/convnext/convnext-base-uavflood.py --work-dir work_dirs/SAR/convnext
python tools/test_full_metrics.py ./configs/convnext/convnext-base-uavflood.py work_dirs/SAR/convnext/best_mIoU_epoch_100.pth --work-dir ./Result/SAR/convnext/ --show-dir ./Result/SAR/convnext/vis --cfg-options visualizer.alpha=1.0
python tools/analysis_tools/benchmark.py \
./configs/convnext/convnext-base-uavflood.py\
work_dirs/GFflood/convnext/best_val_mIoU_iter_20000.pth \
--repeat-times 3
python tools/analysis_tools/get_flops.py \
./configs/convnext/convnext-base-uavflood.py\
--shape 5 256 256

python tools/train.py ./configs/swin/Swin-uavflood-256x256.py --work-dir work_dirs/SAR/Swin --cfg-options seed=42
python tools/test_full_metrics.py ./configs/swin/Swin-uavflood-256x256.py work_dirs/GFflood/Swin/best_val_mIoU_iter_16000.pth --work-dir ./Result/GF/swin/ --show-dir ./Result/GF/swin/vis --cfg-options visualizer.alpha=1.0
python tools/analysis_tools/benchmark.py \
./configs/swin/Swin-uavflood-256x256.py\
work_dirs/GFflood/Swin/best_val_mIoU_iter_16000.pth\
--repeat-times 3
python tools/analysis_tools/get_flops.py \
./configs/swin/Swin-uavflood-256x256.py\
--shape 5 256 256

python tools/train.py ./configs/floodnet/multimodal_floodnet_sar_boost_swinbase_moe_config.py --work-dir work_dirs/floodnet/SwinmoeB/655 --cfg-options seed=42
python tools/test_full_metrics.py ./configs/floodnet/multimodal_floodnet_sar_boost_swin_moe_config.py work_dirs/floodnet/SwinmoeB/best_mIoU_epoch_100.pth --work-dir ./Result/Floodnet/SAR/ --show-dir ./Result/Floodnet/SAR/vis --cfg-options visualizer.alpha=1.0

python tools/test_full_metrics.py \
configs/floodnet/multimodal_floodnet_sar_boost_swinbase_moe_config.py \
work_dirs/floodnet/SwinmoeB/655/best_mIoU_epoch_100.pth \
--cfg-options test_dataloader.dataset.filter_modality=sar \
--work-dir ./Result/Floodnet/SAR/ \
--show-dir ./Result/Floodnet/SAR/vis --cfg-options visualizer.alpha=1.0


python tools/train.py \
configs/floodnet/multimodal_floodnet_sar_only_swinbase_moe_config.py \
--work-dir work_dirs/floodnet/SwinmoeB_sar_only \
--cfg-options seed=42

python tools/test_full_metrics.py \
configs/floodnet/multimodal_floodnet_sar_only_swinbase_moe_config.py \
work_dirs/floodnet/SwinmoeB_sar_only/best_mIoU_epoch_100.pth \


python tools/train.py configs/floodnet/continue_train_150ep.py --work-dir work_dirs/floodnet/SwinmoeB/655 --resume --cfg-options load_from="work_dirs/floodnet/SwinmoeB/655/best_mIoU_epoch_100.pth"

python tools/analysis_tools/visualize_expert_routing.py \
configs/floodnet/multimodal_floodnet_sar_boost_swinbase_moe_config.py \
work_dirs/floodnet/SwinmoeB/655/best_mIoU_epoch_100.pth \
--output-dir work_dirs/figures/expert_routing \
--num-samples 50

python tools/train.py configs/floodnet/finetune_single_modal.py \
--work-dir work_dirs/generalization/LY-train-station/ \
--cfg-options \
train_dataloader.dataset.data_root="data/LY-train-station/" \
val_dataloader.dataset.data_root="data/LY-train-station/" \
test_dataloader.dataset.data_root="data/LY-train-station/"

python tools/test.py \
configs/floodnet/finetune_single_modal.py \
work_dirs/generalization/LY-train-station/best_mIoU_epoch_50.pth \
--work-dir work_dirs/generalization/LY-train-station/test_results \
--cfg-options \
test_dataloader.dataset.data_root="data/LY-train-station/" \
"test_evaluator.iou_metrics=['mIoU','mDice','mFscore']" \
--show-dir work_dirs/generalization/LY-train-station/test_results/vis \
--out work_dirs/generalization/LY-train-station/test_results/predictions

python tools/predict_large_tif.py \
configs/floodnet/finetune_single_modal.py \
work_dirs/generalization/LY-train-station/best_mIoU_epoch_50.pth \
--input data/luoyuan/result.tif \
--output data/luoyuan/prediction.tif \
--tile-size 512 \
--overlap 64 \
--modal rgb \
--bands 0 1 2 \
--batch-size 16
Loading