danfenghong / IEEE_TPAMI_SpectralGPT

Hong, D., Zhang, B., Li, X., Li, Y., Li, C., Yao, J., Yokoya, N., Li, H., Ghamisi, P., Jia, X., Plaza, A. and Gamba, P., Benediktsson, J., Chanussot, J. (2024). SpectralGPT: Spectral remote sensing foundation model. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2024. DOI:10.1109/TPAMI.2024.3362475.
192 stars 21 forks source link

Model Inference #5

Open oguzhannysr opened 7 months ago

oguzhannysr commented 7 months ago

Hello, thank you for your work. How can I inference your pretrained model? For example, I want to make inferences in this model with my Sentinel-2 images.

moonboy12138 commented 7 months ago

Thank you for your interest in our work. For the inference procedure, please refer to lines 281-303 in main_finetune.py, and remember to includewith torch.no_grad()

oguzhannysr commented 7 months ago

@moonboy12138 I want to do the segmentation task for sentinel-2 with the pre-trained model. What should my input images look like? Also, will I do this with the main_finetune.py file?

moonboy12138 commented 7 months ago

We recommend setting the input images to [12, 128, 128], but you can modify the patch embedding as needed. Just ensure that the encoder makes full use of the input.