Home

Awesome

Dual-stage Hyperspectral Image Classification Model with Spectral Supertoken [ECCV 2024]

by Peifu Liu, Tingfa Xu, Jie Wang, Huan Chen, Huiyan Bai, and Jianan Li.

arXiv Google Drive

Requirements

In this repository, we provide a requirements.txt file that lists all the dependencies. Additionally, the installation .whl file for GDAL can be found at Google Drive and can be installed directly using pip:

pip install -r requirements.txt
pip install GDAL-3.4.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl

Getting Started

Preparation

Please download WHU-OHS dataset in data, which should be organized as follows:

|--data
    |--tr
        |--image
            |--O1_0001.tif
            |--O1_0002.tif
            |--...
        |--label
            |--O1_0001.tif
            |--O1_0002.tif
            |--...
    |--ts
        |--image
            |--O1_0003.tif
            |--O1_0004.tif
            |--...
        |--label
            |--O1_0003.tif
            |--O1_0004.tif
            |--...
    |--val
        |--image
            |--O1_0015.tif
            |--O1_0042.tif
            |--...
        |--label
            |--O1_0015.tif
            |--O1_0042.tif
            |--...

Our DSTC utilizes pre-trained weights. The pre-trained weights for ResNet and Swin will be downloaded automatically, while those for PVT can be downloaded from Google Drive. Please place them in the /models/pre-trained folder.

Testing

If you wish to validate our method, our pre-trained weights are available on Google Drive. Please download them to the /models/checkpoints folder. Then run:

sh test.sh

Training

To train our model, execute the train_and_test.sh script. Model checkpoints will be stored in the DataStorage/ directory. After training, the script will proceed to test the model and save the visualization results.

sh train_and_test.sh

Acknowledgement

We refer to the following repositories:

Thanks for their great work!

License

This project is licensed under the LICENSE.md.