kvos / CoastSat

Global shoreline mapping tool from satellite imagery
http://coastsat.space
GNU General Public License v3.0
696 stars 252 forks source link

Classifier issues #66

Closed Lukas-va closed 4 years ago

Lukas-va commented 4 years ago

I have ran into problems of accurate shoreline detection and I thought I will try to retrain the classifier. I did (to my knowledge) everything according to the guidelines...I have added the SDS_classify.py file, installed the astropy, etc.

After completing all of the prior steps (initial settings, download, etc. (from the example)) I have tried to run the command: SDS_classify.label_images(metadata,settings), however I run into an error:

KeyError Traceback (most recent call last)

in ----> 1 metadata = SDS_classify.label_images(metadata,settings) ~/CoastSat-master/coastsat/SDS_classify.py in label_images(metadata, settings) 93 94 """ ---> 95 filepath_train = settings['filepath_train'] 96 # initialize figure 97 fig,ax = plt.subplots(1,1,figsize=[17,10], tight_layout=True,sharex=True, KeyError: 'filepath_train' ---------------------------------------------------------------------------- Currently working on Linux Mint OS. I am a complete beginner, so any help would be marvelous. Thanks and have a great day!
kvos commented 4 years ago

hey @Lukas-va , this error means that your settings dictionnary, which you create in the cell Initial settings, does not have a key called 'filepath_train', can you check the content of your settings variable. Feel free to print it and copy it here.

Lukas-va commented 4 years ago

Hello again. thanks for the reply! I am using the one provided in example_jupyter: import os import numpy as np import pickle import warnings warnings.filterwarnings("ignore") import matplotlib.pyplot as plt from coastsat import SDS_download, SDS_preprocess, SDS_shoreline, SDS_tools, SDS_transects, SDS_classify

I have also found this: CoastSat/classification/train_new_classifier.ipynb, as I understand I suppose to use this one? However I run into other issues with this one...

Lukas-va commented 4 years ago

Hi. I have figured it out. I just downloaded the whole CoastSat/classification folder and worked on it. If I run into other issues I will let you know!

Have a great day.

kvos commented 4 years ago

ok great! just clone/download the latest version rather than copy/pasting files around as it may run into conflicts... another option is to fork the repository and then work on that version, whenever I make updates you will then be notified and can decide to accept/reject the updates. Let me know how you go re-training the classifier!

kvos commented 4 years ago

just closed the issue, feel free to reopen if new problems arise