diff --git a/.gitignore b/.gitignore index bf5e4ce8..426def2b 100644 --- a/.gitignore +++ b/.gitignore @@ -12,4 +12,5 @@ *.geojson *checkpoint.ipynb *.csv -*.xml \ No newline at end of file +*.xml +/deprecated \ No newline at end of file diff --git a/classification/train_new_classifier.ipynb b/classification/train_new_classifier.ipynb index e5c0eba0..7d5c6383 100644 --- a/classification/train_new_classifier.ipynb +++ b/classification/train_new_classifier.ipynb @@ -100,6 +100,7 @@ "sat_list = ['L8']\n", "for site in train_sites:\n", " polygon = SDS_tools.polygon_from_kml(os.path.join(filepath_sites,site))\n", + " polygon = SDS_tools.smallest_rectangle(polygon)\n", " sitename = site[:site.find('.')] \n", " inputs = {'polygon':polygon, 'dates':dates, 'sat_list':sat_list,\n", " 'sitename':sitename, 'filepath':filepath_images}\n", @@ -193,7 +194,7 @@ "# or merge all the classes\n", "# for key in features.keys():\n", "# features[key] = np.append(features[key], features_original[key], axis=0)\n", - "# features = features_original \n", + "#features = features_original \n", "for key in features.keys():\n", " print('%s : %d pixels'%(key,len(features[key])))" ] @@ -386,7 +387,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.7.4" + "version": "3.7.10" }, "toc": { "base_numbering": 1, diff --git a/coastsat/SDS_classify.py b/coastsat/SDS_classify.py index d507a553..1133d41b 100644 --- a/coastsat/SDS_classify.py +++ b/coastsat/SDS_classify.py @@ -579,10 +579,10 @@ def evaluate_classifier(classifier, metadata, settings): # compute MNDWI image (SWIR-G) im_mndwi = SDS_tools.nd_index(im_ms[:,:,4], im_ms[:,:,1], cloud_mask) # find water contours on MNDWI grayscale image - contours_mwi = SDS_shoreline.find_wl_contours1(im_mndwi, cloud_mask, im_ref_buffer) + contours_mwi, t_mndwi = SDS_shoreline.find_wl_contours1(im_mndwi, cloud_mask, im_ref_buffer) else: # use classification to refine threshold and extract the sand/water interface - contours_wi, contours_mwi = SDS_shoreline.find_wl_contours2(im_ms, im_labels, + contours_mwi, t_mndwi = SDS_shoreline.find_wl_contours2(im_ms, im_labels, cloud_mask, buffer_size_pixels, im_ref_buffer) except: print('Could not map shoreline for this image: ' + filenames[i])