shadowwalk commited on
Commit
d103f73
·
verified ·
1 Parent(s): 7951b69

Upload README_zh-CN.md

Browse files
Files changed (1) hide show
  1. README_zh-CN.md +311 -0
README_zh-CN.md ADDED
@@ -0,0 +1,311 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # SFR-Net
2
+
3
+ <p align="center">
4
+ <a href="https://arxiv.org/abs/2605.25737"><img src="https://img.shields.io/badge/arXiv-2605.25737-b31b1b.svg" alt="arXiv"></a>
5
+ <a href="https://huggingface.co/shadowwalk/SFR-Net"><img src="https://img.shields.io/badge/Hugging%20Face-Weights-FFD21E.svg" alt="Hugging Face weights"></a>
6
+ </p>
7
+
8
+ <p align="center">
9
+ <a href="README.md">English</a> | 简体中文
10
+ </p>
11
+
12
+ <p align="center">
13
+ <img src="pics/SFR-Net-cover.png" alt="SFR-Net cover" width="100%">
14
+ </p>
15
+
16
+ <p align="center">
17
+ <strong>Learning Scale-Frustum Representations for Ultra-Wide Area Remote Sensing Image Segmentation</strong>
18
+ </p>
19
+
20
+ <p align="center">
21
+ <a href="https://arxiv.org/abs/2605.25737">Paper</a> |
22
+ <a href="https://huggingface.co/shadowwalk/SFR-Net">Weights</a>
23
+ </p>
24
+
25
+ ## 概述 🧭
26
+
27
+ SFR-Net 面向 ultra-wide area (UWA) remote sensing images 的 semantic segmentation,此类图像同时具有极大的像素数量和地理覆盖范围。SFR-Net 围绕同一个 Projection Reference Point (PRP) 构建相互对齐的 local、short-range 和 long-range observations,将其缩放至统一输入尺寸,并通过可学习的 scale embeddings 区分不同尺度。随后,Cascaded Cross-Scale Fusion (CCSF) module 逐步向 local representation 注入上下文信息,在保留精细细节的同时增强 long-range semantic continuity。
28
+
29
+ <p align="center">
30
+ <img src="pics/sfrnet-framework.png" alt="SFR-Net 整体框架" width="100%">
31
+ </p>
32
+
33
+ ## 新闻 📰
34
+
35
+ - **2026-08-26:** 我们更新了代码版本,修复了一些已知 bug,更新了推理、测试和可视化脚本,并公开了在 GID、FBPS 和 Inria Aerial 上训练好的权重。
36
+ - **2026-07-11:** 我们收到了来自 IEEE Transactions on Geoscience and Remote Sensing (IEEE TGRS) 的第一轮审稿意见,稿件进入大修阶段。
37
+ - **2026-05-25:** 我们的论文 [“SFR-Net: Learning Scale-Frustum Representations for Ultra-Wide Area Remote Sensing Image Segmentation”](https://arxiv.org/abs/2605.25737) 已在 arXiv 上公开。
38
+ - **2026-05-20:** 我们的论文 “SFR-Net: Learning Scale-Frustum Representations for Ultra-Wide Area Remote Sensing Image Segmentation” 已投稿至 IEEE TGRS。
39
+ - **2026-05-11:** 我们发布了初步代码版本,提供了训练和测试代码以及预训练权重。
40
+
41
+ ## 亮点 ✨
42
+
43
+ - 我们提出 ultra-wide area remote sensing image segmentation 任务,同时考虑大像素数量、极广地理覆盖、显著的目标尺度变化以及 long-range semantic continuity。
44
+ - Scale-Frustum Representations 围绕同一个 PRP 统一表示 local、short-range 和 long-range observations。发布的 GID/FBPS configs 使用距离 `[1, 3, 14]`,Inria Aerial config 使用 `[1, 3, 10]`。
45
+ - 可学习的 scale embeddings 能够明确区分经过缩放的不同空间范围 observations。
46
+ - CCSF module 将邻近区域和更大范围的上下文信息逐步注入精细的 local features。
47
+ - SFR-Net 在 UWA GID 和 FBPS benchmarks 上取得了 state-of-the-art 结果。SFR representation 还可用于提升通用 segmentation networks 的精度和收敛速度。
48
+
49
+ ## 性能 📊
50
+
51
+ 下表截取自论文。在论文实验设置下,SFR-Net 在 GID 上达到 `74.67%` mIoU,在 FBPS 上达到 `77.24%` mIoU。
52
+
53
+ <p align="center">
54
+ <img src="pics/sfrnet-performance.png" alt="GID 和 FBPS 定量对比" width="100%">
55
+ </p>
56
+
57
+ ## 仓库结构 🗂️
58
+
59
+ ```text
60
+ SFR-Net/
61
+ ├── configs/
62
+ │ ├── _base_/
63
+ │ │ ├── datasets/
64
+ │ │ ├── schedules/
65
+ │ │ └── default_runtime.py
66
+ │ ├── gid/sfrnet_swinl_320k_gid.py
67
+ │ ├── fbps/sfrnet_swinl_320k_fbps.py
68
+ │ └── inria_aerial/sfrnet_swinl_320k_inria_aerial.py
69
+ ├── mmseg/
70
+ │ ├── datasets/transforms/sfr_loading.py
71
+ │ ├── datasets/uwa_dataset.py
72
+ │ ├── models/backbones/sfr_net.py
73
+ │ └── models/necks/ccsf_neck.py
74
+ ├── tools/
75
+ │ ├── train.py
76
+ │ ├── test.py
77
+ │ ├── sfr_inference.py
78
+ │ ├── get_res_iou.py
79
+ │ └── visualizer.py
80
+ ├── pics/
81
+ ├── pretrain/
82
+ ├── weights/
83
+ ├── README.md
84
+ └── README_zh-CN.md
85
+ ```
86
+
87
+ 当前发布版本保留默认 SFR-Net 核心通路以及 GID、FBPS 和 Inria Aerial configs。多距离消融实验和其他仅用于实验的 modules 未包含在该版本中。
88
+
89
+ ## 权重 🔑
90
+
91
+ 所有预训练 backbones 和已发布的 SFR-Net checkpoints 均托管于 [SFR-Net Hugging Face 仓库](https://huggingface.co/shadowwalk/SFR-Net)。
92
+
93
+ ### 可用文件
94
+
95
+ | 类型 | 文件 | 预期位置 |
96
+ | --- | --- | --- |
97
+ | ResNet-18 ImageNet 预训练权重 | [`resnet18_v1c-b5776b93.pth`](https://huggingface.co/shadowwalk/SFR-Net/blob/main/pretrain/resnet18_v1c-b5776b93.pth) | `pretrain/resnet18_v1c-b5776b93.pth` |
98
+ | Swin-Large ImageNet-22K 预训练权重 | [`swin_large_patch4_window12_384_22k_20220412-6580f57d.pth`](https://huggingface.co/shadowwalk/SFR-Net/blob/main/pretrain/swin_large_patch4_window12_384_22k_20220412-6580f57d.pth) | `pretrain/swin_large_patch4_window12_384_22k_20220412-6580f57d.pth` |
99
+ | GID checkpoint | [`iter_320000_gid.pth`](https://huggingface.co/shadowwalk/SFR-Net/blob/main/weights/iter_320000_gid.pth) | `weights/iter_320000_gid.pth` |
100
+ | FBPS checkpoint | [`iter_320000_fbps.pth`](https://huggingface.co/shadowwalk/SFR-Net/blob/main/weights/iter_320000_fbps.pth) | `weights/iter_320000_fbps.pth` |
101
+ | Inria Aerial checkpoint | [`iter_320000_inria.pth`](https://huggingface.co/shadowwalk/SFR-Net/blob/main/weights/iter_320000_inria.pth) | `weights/iter_320000_inria.pth` |
102
+
103
+ 可以使用 Hugging Face CLI 下载这些文件:
104
+
105
+ ```bash
106
+ pip install -U huggingface_hub
107
+ hf download shadowwalk/SFR-Net --local-dir downloads/SFR-Net
108
+ cp -r downloads/SFR-Net/pretrain/. pretrain/
109
+ cp -r downloads/SFR-Net/weights/. weights/
110
+ ```
111
+
112
+ ### 已发布 checkpoint 结果
113
+
114
+ | Dataset | OA (%) | mIoU (%) | mF1 (%) | Checkpoint |
115
+ | --- | ---: | ---: | ---: | --- |
116
+ | GID | 86.82 | 74.46 | 85.73 | `weights/iter_320000_gid.pth` |
117
+ | FBPS | 93.50 | 77.86 | 66.72 | `weights/iter_320000_fbps.pth` |
118
+ | Inria Aerial | 96.91 | 83.96* | 91.28* | `weights/iter_320000_inria.pth` |
119
+
120
+ `*` 对于 Inria Aerial,IoU 和 F1 仅统计 building 类别。发布的 checkpoints 使用随机种子 `42` 训练,因此结果与论文中报告的数值略有差异。
121
+
122
+ backbone 路径目前定义在 `mmseg/models/backbones/sfr_net.py` 中。如果两个预训练文件保存在 `pretrain/` 下,并从仓库根目录执行命令,则不需要修改代码。
123
+
124
+ ## 安装 🛠️
125
+
126
+ 请先根据 GPU 创建匹配的 PyTorch/CUDA 环境,然后在 SFR-Net 仓库根目录安装:
127
+
128
+ ```bash
129
+ conda create -n sfrnet python=3.10 -y
130
+ conda activate sfrnet
131
+
132
+ # 请先参考 https://pytorch.org/get-started/locally/ 安装 PyTorch
133
+ pip install -U openmim
134
+ mim install mmengine "mmcv>=2.0.0"
135
+ pip install -r requirements.txt
136
+ pip install -v -e .
137
+ pip install mxnet
138
+ ```
139
+
140
+ `tools/sfr_inference.py` 使用 `mxnet` 读取原始 ultra-wide images。
141
+
142
+ ## 数据准备 🗃️
143
+
144
+ 数据集官方网站:
145
+
146
+ | Dataset | Website |
147
+ | --- | --- |
148
+ | GID | [Gaofen Image Dataset](https://x-ytong.github.io/project/GID) |
149
+ | FBPS | [Five-Billion-Pixels](https://x-ytong.github.io/project/Five-Billion-Pixels.html) |
150
+ | Inria Aerial | [Inria Aerial Image Labeling Dataset](https://project.inria.fr/aerialimagelabeling/) |
151
+
152
+ 请按照以下方式组织数据集:
153
+
154
+ ```text
155
+ SFR-Net/
156
+ └── data/
157
+ ├── GID/
158
+ │ ├── Image_train/
159
+ │ ├── Image_test/
160
+ │ ├── annos_train_5l/
161
+ │ ├── annos_test_5l/
162
+ │ ├── annos_train_24l/
163
+ │ └── annos_test_24l/
164
+ └── inria_aerial/
165
+ ├── images/
166
+ │ ├── train/
167
+ │ ├── val/
168
+ │ └── test/
169
+ └── Label/
170
+ ├── train/
171
+ ├── val/
172
+ └── test/
173
+ ```
174
+
175
+ GID 和 FBPS 使用相同的 GF-2 images,但使用不同的 label folders。GID 使用 5-category annotations,输出包含 background 在内的 6 个 class indices;FBPS 使用 24-category annotations,输出包含 background 在内的 25 个 class indices。Inria Aerial 使用两个 class indices:background 和 building。
176
+
177
+ 发布的 configs 中仍保留原始本地绝对路径。训练或验证之前,请修改以下三个文件:
178
+
179
+ ```python
180
+ # configs/_base_/datasets/gid.py
181
+ data_root = 'data/GID'
182
+
183
+ # configs/_base_/datasets/fbps.py
184
+ data_root = 'data/GID'
185
+
186
+ # configs/_base_/datasets/inria_aerial.py
187
+ data_root = 'data/inria_aerial'
188
+ ```
189
+
190
+ 也可以将数据集保存在其他位置,并把各 `data_root` 设置为相应的绝对路径。`data_root` 下的文件夹名称仍须与上述结构一致。
191
+
192
+ ## 训练 🏋️
193
+
194
+ 训练之前:
195
+
196
+ 1. 按照“数据准备”部分的说明,在对应的 `configs/_base_/datasets/` 文件中设置 `data_root`。
197
+ 2. 检查所选 experiment config 中的 `batch_size` 和 `num_workers`。发布的 configs 使用 batch size `4`,并将 `num_workers` 覆盖为 `64`;如果 GPU memory 或 CPU resources 不足,请适当减小。
198
+ 3. 将两个 backbone checkpoints 保存在 `pretrain/` 下;如果使用其他位置,请修改 `mmseg/models/backbones/sfr_net.py` 中的 `depth2ckpt`。
199
+
200
+ 使用随机种子 `42` 进行训练(`configs/_base_/default_runtime.py` 和 `tools/train.py` 中的默认值):
201
+
202
+ ```bash
203
+ python tools/train.py configs/gid/sfrnet_swinl_320k_gid.py \
204
+ --work-dir work_dirs/gid
205
+
206
+ python tools/train.py configs/fbps/sfrnet_swinl_320k_fbps.py \
207
+ --work-dir work_dirs/fbps
208
+
209
+ python tools/train.py configs/inria_aerial/sfrnet_swinl_320k_inria_aerial.py \
210
+ --work-dir work_dirs/inria_aerial
211
+ ```
212
+
213
+ 添加 `--amp` 可启用 automatic mixed precision。使用相同的 `--work-dir` 并添加 `--resume` 可从最新 checkpoint 继续训练。
214
+
215
+ ## 推理 🛰️
216
+
217
+ `tools/sfr_inference.py` 的 `DATASETS` dictionary 中包含原始机器上的默认路径,例如 `/mnt/dataset/zhongchuyu/...`。可以将其中�� `src` 修改为 `data/GID/Image_test` 和 `data/inria_aerial/images/test`,也可以像下面这样显式传入 `--src`。命令行参数会覆盖默认值。
218
+
219
+ ```bash
220
+ python tools/sfr_inference.py \
221
+ --dataset gid \
222
+ --src data/GID/Image_test \
223
+ --dst work_dirs/gid_predictions \
224
+ --config configs/gid/sfrnet_swinl_320k_gid.py \
225
+ --ckpt weights/iter_320000_gid.pth \
226
+ --stride 128
227
+
228
+ python tools/sfr_inference.py \
229
+ --dataset fbps \
230
+ --src data/GID/Image_test \
231
+ --dst work_dirs/fbps_predictions \
232
+ --config configs/fbps/sfrnet_swinl_320k_fbps.py \
233
+ --ckpt weights/iter_320000_fbps.pth \
234
+ --stride 128
235
+
236
+ python tools/sfr_inference.py \
237
+ --dataset inria_aerial \
238
+ --src data/inria_aerial/images/test \
239
+ --dst work_dirs/inria_aerial_predictions \
240
+ --config configs/inria_aerial/sfrnet_swinl_320k_inria_aerial.py \
241
+ --ckpt weights/iter_320000_inria.pth \
242
+ --stride 128
243
+ ```
244
+
245
+ 默认的 `--load-type random` 会构建完整 scale-frustum representation。预测结果将保存为单通道 class-index PNG masks。
246
+
247
+ ## 指标与可视化 🎨
248
+
249
+ ### 指标
250
+
251
+ `tools/get_res_iou.py` 当前在 `DATASETS` dictionary 中保存了原始 ground-truth paths,并且没有提供 `--gt` 参数。评测前请修改该 dictionary:
252
+
253
+ ```python
254
+ DATASETS = {
255
+ 'gid': ('data/GID/annos_test_5l', 6),
256
+ 'fbps': ('data/GID/annos_test_24l', 25),
257
+ 'inria_aerial': ('data/inria_aerial/Label/test', 2),
258
+ }
259
+ ```
260
+
261
+ 然后计算指标:
262
+
263
+ ```bash
264
+ python tools/get_res_iou.py --dataset gid \
265
+ --pred work_dirs/gid_predictions
266
+
267
+ python tools/get_res_iou.py --dataset fbps \
268
+ --pred work_dirs/fbps_predictions
269
+
270
+ python tools/get_res_iou.py --dataset inria_aerial \
271
+ --pred work_dirs/inria_aerial_predictions
272
+ ```
273
+
274
+ ### 可视化
275
+
276
+ `tools/visualizer.py` 不包含固定数据路径,请通过命令行传入输入和输出目录。其 `PALETTES` dictionary 包含 GID、FBPS 和 Inria Aerial colormaps;仅当 class-index convention 发生变化时才需要修改。
277
+
278
+ ```bash
279
+ python tools/visualizer.py --dataset gid \
280
+ --src work_dirs/gid_predictions \
281
+ --dst work_dirs/gid_visualizations
282
+
283
+ python tools/visualizer.py --dataset fbps \
284
+ --src work_dirs/fbps_predictions \
285
+ --dst work_dirs/fbps_visualizations
286
+
287
+ python tools/visualizer.py --dataset inria_aerial \
288
+ --src work_dirs/inria_aerial_predictions \
289
+ --dst work_dirs/inria_aerial_visualizations
290
+ ```
291
+
292
+ ## 联系方式 ✉️
293
+
294
+ 如果本工作对您有所帮助,请引用我们的[论文](https://arxiv.org/abs/2605.25737):
295
+
296
+ ```bibtex
297
+ @article{zhong2026sfr,
298
+ title={SFR-Net: Learning Scale-Frustum Representations for Ultra-Wide Area Remote Sensing Image Segmentation},
299
+ author={Zhong, Chuyu and Chen, Keyan and Yang, Qinzhe and Chen, Bowen and Zou, Zhengxia and Shi, Zhenwei},
300
+ journal={arXiv preprint arXiv:2605.25737},
301
+ year={2026}
302
+ }
303
+ ```
304
+
305
+ 如有问题或 bug report,欢迎联系 **buaazcy@buaa.edu.cn**。
306
+
307
+ 如果本仓库对您有所帮助,欢迎给我们一个 star。最后是 Phoebe,请不要欺负她。
308
+
309
+ <p align="left">
310
+ <img src="pics/phoebe.png" width="300" alt="Phoebe">
311
+ </p>