Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Development #192

Merged
merged 2 commits into from
Mar 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@
*.geojson
*checkpoint.ipynb
*.csv
*.xml
*.xml
/deprecated
5 changes: 3 additions & 2 deletions classification/train_new_classifier.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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])))"
]
Expand Down Expand Up @@ -386,7 +387,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.4"
"version": "3.7.10"
},
"toc": {
"base_numbering": 1,
Expand Down
4 changes: 2 additions & 2 deletions coastsat/SDS_classify.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down