VSainteuf / pytorch-psetae

PyTorch implementation of the model presented in "Satellite Image Time Series Classification with Pixel-Set Encoders and Temporal Self-Attention"
MIT License
184 stars 40 forks source link

Question about THEIA tiles pre-processing #10

Closed jbkopecky closed 3 years ago

jbkopecky commented 3 years ago

Hello @VSainteuf,

Thanks a lot for this great repo !

Reading the preprocessing code you pushed here, I realised you read all 10 bands from one single geotiff.

Downloading the data from THEIA myself, I see that the 10 bands are given in separate geotiffs, with different resolutions (10m & 20m).

My questions are:

Thanks a lot !

Best,

JB

VSainteuf commented 3 years ago

Hi @jbkopecky , Thank you for your interest!

Sentinel-2 bands You're not missing anything, bands come indeed in separate files and there is an assembling step which is not covered by the script I provided. In this step, all bands are up-sampled (when necessary) to the 10m resolution with bilinear interpolation, using rasterio.

Clouds At the time we released this research, we still used the THEIA cloud masks and OrfeoToolBox to interpolate cloudy pixels. But, as you've seen in this issue since other studies showed that deep learning temporal encoders (RNN or self-attention) can handle clouds just fine, we do not do that anymore. Typically in our new dataset we don't use THEIA cloud masks, and assemble time series with cloudy observations. So if you are preparing a new dataset of yours with enough annotations I would recommend not bothering about THEAI cloud masks.

jbkopecky commented 3 years ago

Thank you !

all bands are up-sampled (when necessary) to the 10m resolution with bilinear interpolation, using rasterio.

That's exactly what I implemented this morning, thanks for the confirmation !

can handle clouds just fine, we do not do that anymore.

Is the pre-trained model for https://github.com/VSainteuf/lightweight-temporal-attention-pytorch trained with or without clouds ? I hoped I could do some testing without having to re-train a model ☺️ .

VSainteuf commented 3 years ago

Understood, it was trained without clouds so I guess you'll have to go for cloud interpolation indeed!

If I find some time I'll try to upload pre-trained weights for data with clouds, but don't expect that too soon ;)

jbkopecky commented 3 years ago

Thank you !