CaiYuanhao commited on
Commit
409b9d4
Β·
verified Β·
1 Parent(s): 73d287f

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +202 -0
README.md CHANGED
@@ -1,3 +1,205 @@
1
  ---
2
  license: apache-2.0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  license: apache-2.0
3
+ language:
4
+ - en
5
+ library_name: pytorch
6
+ tags:
7
+ - hyperspectral-image-reconstruction
8
+ - spectral-compressive-imaging
9
+ - snapshot-compressive-imaging
10
+ - spectral-reconstruction
11
+ - transformer
12
+ - model-zoo
13
+ - arxiv:2111.07910
14
+ - arxiv:2203.04845
15
+ - arxiv:2205.10102
16
+ - arxiv:2305.10299
17
+ - arxiv:2203.02149
18
  ---
19
+
20
+ # MST: A Toolbox for Spectral Compressive Imaging
21
+
22
+ [![arXiv](https://img.shields.io/badge/arXiv-MST-B31B1B)](https://arxiv.org/abs/2111.07910)
23
+ [![NTIRE](https://img.shields.io/badge/NTIRE_2022-Winner-FF5797)](https://github.com/caiyuanhao1998/MST-plus-plus/)
24
+ [![zhihu](https://img.shields.io/badge/ηŸ₯乎解读-MST-0084FF)](https://zhuanlan.zhihu.com/p/501101943)
25
+ [![zhihu](https://img.shields.io/badge/ηŸ₯乎解读-CST-0084FF)](https://zhuanlan.zhihu.com/p/544979161)
26
+ [![zhihu](https://img.shields.io/badge/ηŸ₯乎解读-DAUHST-0084FF)](https://zhuanlan.zhihu.com/p/576280023)
27
+ [![Hugging Face](https://img.shields.io/badge/πŸ€—_Hugging_Face-models-FFD21E)](https://huggingface.co/CaiYuanhao/MST)
28
+
29
+ [Code and project documentation](https://github.com/caiyuanhao1998/MST)
30
+
31
+ ## Overview
32
+
33
+ This repository provides pretrained PyTorch checkpoints for **spectral compressive imaging reconstruction**, including MST, CST, DAUHST, BiSRNet, MST++, HDNet, and other learning-based baselines supported by the MST toolbox.
34
+
35
+ The toolbox reconstructs hyperspectral image cubes from coded snapshot measurements using the corresponding sensing mask and measurement model. The simulation implementation reconstructs 28 spectral bands. This task differs from reconstructing spectra directly from ordinary RGB photographs.
36
+
37
+ **MST β€” Mask-guided Spectral-wise Transformer for Efficient Hyperspectral Image Reconstruction (CVPR 2022)** models dependencies across spectral channels and incorporates sensing-mask information to guide reconstruction.
38
+
39
+ **MST authors:** Yuanhao Cai, Jing Lin, Xiaowan Hu, Haoqian Wang, Xin Yuan, Yulun Zhang, Radu Timofte, and Luc Van Gool.
40
+
41
+ ## Related papers
42
+
43
+ - [MST: Mask-guided Spectral-wise Transformer for Efficient Hyperspectral Image Reconstruction](https://arxiv.org/abs/2111.07910) β€” CVPR 2022.
44
+ - [CST: Coarse-to-Fine Sparse Transformer for Hyperspectral Image Reconstruction](https://arxiv.org/abs/2203.04845) β€” ECCV 2022.
45
+ - [DAUHST: Degradation-Aware Unfolding Half-Shuffle Transformer for Spectral Compressive Imaging](https://arxiv.org/abs/2205.10102) β€” NeurIPS 2022.
46
+ - [BiSRNet: Binarized Spectral Compressive Imaging](https://arxiv.org/abs/2305.10299) β€” NeurIPS 2023.
47
+ - [MST++: Multi-stage Spectral-wise Transformer for Efficient Spectral Reconstruction](https://github.com/caiyuanhao1998/MST-plus-plus) β€” CVPR Workshops 2022.
48
+ - [HDNet: High-resolution Dual-domain Learning for Spectral Compressive Imaging](https://arxiv.org/abs/2203.02149) β€” CVPR 2022.
49
+
50
+ ## NTIRE awards
51
+
52
+ - πŸ† **NTIRE 2022 β€” Winner:** MST++ won the Spectral Recovery from RGB Images Challenge. See the [MST++ project](https://github.com/caiyuanhao1998/MST-plus-plus).
53
+ - πŸ† **NTIRE 2024 β€” First Runner-Up:** Retinexformer and MST++ achieved second place in the [Low-Light Image Enhancement Challenge](https://codalab.lisn.upsaclay.fr/competitions/17640#results).
54
+
55
+ <p align="center">
56
+ <img src="https://raw.githubusercontent.com/caiyuanhao1998/MST/main/figure/ntire.png" height="240" alt="NTIRE 2022 award certificate">
57
+ <img src="https://raw.githubusercontent.com/caiyuanhao1998/MST/main/figure/NTIRE_2024.png" height="240" alt="NTIRE 2024 award certificate">
58
+ </p>
59
+
60
+ The awards concern the associated challenge solutions. This repository hosts the spectral compressive imaging model zoo; the NTIRE 2024 low-light enhancement weights are available in [CaiYuanhao/Retinexformer](https://huggingface.co/CaiYuanhao/Retinexformer).
61
+
62
+ ## Visual examples
63
+
64
+ | Scene 2 | Scene 3 | Scene 4 | Scene 7 |
65
+ | --- | --- | --- | --- |
66
+ | ![Scene 2](https://raw.githubusercontent.com/caiyuanhao1998/MST/main/figure/frame2channel12.gif) | ![Scene 3](https://raw.githubusercontent.com/caiyuanhao1998/MST/main/figure/frame3channel21.gif) | ![Scene 4](https://raw.githubusercontent.com/caiyuanhao1998/MST/main/figure/frame4channel28.gif) | ![Scene 7](https://raw.githubusercontent.com/caiyuanhao1998/MST/main/figure/frame7channel4.gif) |
67
+
68
+ See the [GitHub repository](https://github.com/caiyuanhao1998/MST) for reconstruction comparisons and visualization tools.
69
+
70
+ ## Available checkpoints
71
+
72
+ The Hugging Face repository contains **20 checkpoints across 12 model families**:
73
+
74
+ | Model family | Checkpoint paths |
75
+ | --- | --- |
76
+ | ADMM-Net | `admm_net/admm_net.pth` |
77
+ | BIRNAT | `birnat/birnat.pth` |
78
+ | BiSRNet | `bisrnet/bisrnet.pth` |
79
+ | CST | `cst/cst_l.pth`<br>`cst/cst_l_plus.pth`<br>`cst/cst_m.pth`<br>`cst/cst_s.pth` |
80
+ | DAUHST | `dauhst/dauhst_2stg.pth`<br>`dauhst/dauhst_3stg.pth`<br>`dauhst/dauhst_5stg.pth`<br>`dauhst/dauhst_9stg.pth` |
81
+ | DGSMP | `dgsmp/dgsmp.pth` |
82
+ | GAP-Net | `gap_net/gap_net.pth` |
83
+ | HDNet | `hdnet/hdnet.pth` |
84
+ | Ξ»-Net | `lambda_net/lambda_net.pth` |
85
+ | MST | `mst/mst_l.pth`<br>`mst/mst_m.pth`<br>`mst/mst_s.pth` |
86
+ | MST++ | `mst_plus_plus/mst_plus_plus.pth` |
87
+ | TSA-Net | `tsa_net/tsa_net.pth` |
88
+
89
+ Each checkpoint requires its matching architecture and method setting in the toolbox.
90
+
91
+ ## Getting started
92
+
93
+ ### 1. Install the toolbox
94
+
95
+ ```bash
96
+ git clone https://github.com/caiyuanhao1998/MST.git
97
+ cd MST
98
+ pip install -r requirements.txt
99
+ ```
100
+
101
+ The official testing implementation requires an NVIDIA GPU with CUDA and a compatible PyTorch installation. See the [environment instructions](https://github.com/caiyuanhao1998/MST#2-create-environment).
102
+
103
+ ### 2. Download model weights
104
+
105
+ Run from the MST repository root to download the weights into the simulation model zoo while preserving the expected directory structure:
106
+
107
+ ```bash
108
+ pip install -U huggingface_hub
109
+ hf download CaiYuanhao/MST --include "*.pth" --local-dir simulation/test_code/model_zoo
110
+ ```
111
+
112
+ To download only MST-S:
113
+
114
+ ```bash
115
+ hf download CaiYuanhao/MST mst/mst_s.pth --local-dir simulation/test_code/model_zoo
116
+ ```
117
+
118
+ For example, the MST-S checkpoint will be saved as `simulation/test_code/model_zoo/mst/mst_s.pth`.
119
+
120
+ ### 3. Prepare the data
121
+
122
+ Follow the project's [dataset preparation instructions](https://github.com/caiyuanhao1998/MST#3-prepare-dataset) to place the hyperspectral test scenes and sensing mask under `datasets/TSA_simu_data/`:
123
+
124
+ ```text
125
+ datasets/
126
+ └── TSA_simu_data/
127
+ β”œβ”€β”€ mask.mat
128
+ └── Truth/
129
+ β”œβ”€β”€ scene01.mat
130
+ β”œβ”€β”€ scene02.mat
131
+ └── ...
132
+ ```
133
+
134
+ ### 4. Run simulation reconstruction
135
+
136
+ From the MST repository root:
137
+
138
+ ```bash
139
+ cd simulation/test_code
140
+
141
+ # MST-S
142
+ python test.py --template mst_s --method mst_s \
143
+ --pretrained_model_path ./model_zoo/mst/mst_s.pth \
144
+ --outf ./exp/mst_s/
145
+
146
+ # MST++
147
+ python test.py --template mst_plus_plus --method mst_plus_plus \
148
+ --pretrained_model_path ./model_zoo/mst_plus_plus/mst_plus_plus.pth \
149
+ --outf ./exp/mst_plus_plus/
150
+
151
+ # DAUHST-9stg
152
+ python test.py --template dauhst_9stg --method dauhst_9stg \
153
+ --pretrained_model_path ./model_zoo/dauhst/dauhst_9stg.pth \
154
+ --outf ./exp/dauhst_9stg/
155
+ ```
156
+
157
+ Reconstructed hyperspectral images are saved as `Test_result.mat` under the corresponding output directory. See the [official documentation](https://github.com/caiyuanhao1998/MST) for other methods, real-measurement experiments, MATLAB quality metrics, and visualization scripts.
158
+
159
+ ## Citation
160
+
161
+ Please cite the paper corresponding to the method you use:
162
+
163
+ ```bibtex
164
+ @inproceedings{mst,
165
+ title={Mask-guided Spectral-wise Transformer for Efficient Hyperspectral Image Reconstruction},
166
+ author={Yuanhao Cai and Jing Lin and Xiaowan Hu and Haoqian Wang and Xin Yuan and Yulun Zhang and Radu Timofte and Luc Van Gool},
167
+ booktitle={CVPR},
168
+ year={2022}
169
+ }
170
+
171
+ @inproceedings{cst,
172
+ title={Coarse-to-Fine Sparse Transformer for Hyperspectral Image Reconstruction},
173
+ author={Yuanhao Cai and Jing Lin and Xiaowan Hu and Haoqian Wang and Xin Yuan and Yulun Zhang and Radu Timofte and Luc Van Gool},
174
+ booktitle={ECCV},
175
+ year={2022}
176
+ }
177
+
178
+ @inproceedings{dauhst,
179
+ title={Degradation-Aware Unfolding Half-Shuffle Transformer for Spectral Compressive Imaging},
180
+ author={Yuanhao Cai and Jing Lin and Haoqian Wang and Xin Yuan and Henghui Ding and Yulun Zhang and Radu Timofte and Luc Van Gool},
181
+ booktitle={NeurIPS},
182
+ year={2022}
183
+ }
184
+
185
+ @inproceedings{bisci,
186
+ title={Binarized Spectral Compressive Imaging},
187
+ author={Yuanhao Cai and Yuxin Zheng and Jing Lin and Xin Yuan and Yulun Zhang and Haoqian Wang},
188
+ booktitle={NeurIPS},
189
+ year={2023}
190
+ }
191
+
192
+ @inproceedings{mst_pp,
193
+ title={MST++: Multi-stage Spectral-wise Transformer for Efficient Spectral Reconstruction},
194
+ author={Yuanhao Cai and Jing Lin and Zudi Lin and Haoqian Wang and Yulun Zhang and Hanspeter Pfister and Radu Timofte and Luc Van Gool},
195
+ booktitle={CVPRW},
196
+ year={2022}
197
+ }
198
+
199
+ @inproceedings{hdnet,
200
+ title={HDNet: High-resolution Dual-domain Learning for Spectral Compressive Imaging},
201
+ author={Xiaowan Hu and Yuanhao Cai and Jing Lin and Haoqian Wang and Xin Yuan and Yulun Zhang and Radu Timofte and Luc Van Gool},
202
+ booktitle={CVPR},
203
+ year={2022}
204
+ }
205
+ ```