NISL-MSU / HSI-BandSelection

Developing Low-Cost Multispectral Imagers using Inter-Band Redundancy Analysis and Greedy Spectral Selection in Hyperspectral Imaging.
50 stars 13 forks source link

How to use my own spectral dataset? #4

Closed Turingic closed 5 months ago

Turingic commented 5 months ago

Hello! When I try to do the band selection on my own dataset, it keeps reporting the error in the image. I tried to change the code but none of it worked. The size of my own spectral dataset is 1920x1080x29.

image image
Turingic commented 5 months ago

When I change the runtime from GPU to CPU, the error is like this:

image image
GiorgioMorales commented 5 months ago

Hi! The first error is because you don't have a correct Pytorch+CUDA installation. The second error seems to be related to the dimensions of your dataset. Use our demo as a guide. In that case, Indian Pines is originally an image of 145x145 pixels and 200 bands that is transformed into 10249 patches of 5x5 pixels using the function createImageCubes; that is, a single image is converted into a dataset of 10249 samples. Similarly, you only have one image of 1920x1080 pixels and 29 bands, not a dataset per se. The way that an image is transformed into a dataset could be as simple as in the case of Indian Pines, but it most likely depends on your own classification problem. For example, in the case of our Kochia dataset, we had to convert images of similar dimensions as yours into a dataset of 6316 samples, each of which represented patches of 25x25 pixels (the extraction of the patches can be manual or automatic): image