ydoherty / CoastSat.PlanetScope

Batch shoreline extraction toolkit for PlanetScope Dove satellite imagery
GNU General Public License v3.0
48 stars 13 forks source link

Issue with classifier pkl file #20

Closed Jand607 closed 1 week ago

Jand607 commented 2 weeks ago

Kia ora from Auckland NZ. I hope you are having a lovely day over the ditch.

I'm proficient with the original CoastSat and currently trying to implement the PlanetScope extension. I have a subscription and have downloaded all of the necessary images.

When I run the python CoastSat_ps workflow, I get the following error:

ModuleNotFoundError: No module named 'sklearn.neural_network.multilayer_perceptron'

From issue #17 this might have to do with the classifier NN_4classes_PS_NARRA.pkl being pickled with an earlier version of Scikit. So, I created a new environment and downgraded to Scikit version 0.19. However, when I try to load the pickle file in the old version of Scikit, I get this error message:

image

To make sure the contents of the pickle file makes sense, here it is: image

Thanks so much.

ydoherty commented 2 weeks ago

Hi @Jand607, it's on my long term to do list to update the classifiers to work with the updated scikit versions, however I'm maintaining this repo in my spare time these days and free time is at a premium! To be honest, the fastest fix is probably for you to train your own classifier for your site. It only needs 10-20 images and if all goes smoothly should only take 1h or so which in my experience is much faster than trying to arm-wrestle package versions and conflicts. Let me know how you go.

Jand607 commented 2 weeks ago

Hey @ydoherty I realised that very quickly and am currently training a new classifier :) Unfortunately, when I get to the image download section, I get stuck. image

It's been stuck on this for some ten minutes. 'Number of images available between 2019-01-01 and 2019-07-01:

By the way, I'm a final-year civil engineering student at the University of Auckland. My research project explores how CoastSat could be used to increase the resolution of municipal coastal monitoring programmes around New Zealand. The potential for increased time and space resolution is mind boggling.

A major achievement I made was improving the accuracy of tidal correction by using beach profiles instead of a constant beach gradient. I'm wrapping up the analysis by investigating how much better PlanetScope is than Sentinel-2, i.e. is it worth it for councils to invest in PlanetScope?

I'm exploring options for postgraduate research next year, and I would absolutely love to contribute to the CoastSat mission. My supervisor is Colin Whittaker of whom you may have heard. I'm continuing my CoastSat research in January on a summer research grant - so perhaps we can align interests. https://scholar.google.co.nz/citations?user=1zMBeiAAAAAJ&hl=en

Hopefully, I get to meet you and Kilian before long!

Jack :)

Jand607 commented 2 weeks ago

Aha, I have found what is almost certainly the issue - a poorly defined polygon. I will check this and let you know if it's not

ydoherty commented 1 week ago

Hi Jack, I´ve done the first solid whack of development in the last 2 years these last two weeks. I've played around with the installation process and the new environment.yml file seems to work well. I'd also strongly recommend using mamba instead of anaconda. I still recommend training your own classifier, but with the new .yml file at least you should be able to check how the old classifier performs.

I've added a more user friendly input process and instructions to make sure your input files are correct. Download a clean new version of all the files and give it a go!

ydoherty commented 1 week ago

Also RE collaborating, we're always open for keen people to help test and progress the toolkit. I'm overseas at the momnent, but I'll have a chat with the other WRL folk next week when I fly back to Australia.