Open nicholasmetherall opened 2 years ago
Can you share the corresponding paper? Thanks.
Thank you @AlanMorningLight. The academic paper for the steps I am seeking to replicate is based on this one: https://www.nature.com/articles/s41586-020-2824-5
Hello all. I have tried to rerun this code in pycharm using some advice from the authors. Thank you for all the support with this.
import os desktop = os.path.join(os.path.join(os.environ[r'USERPROFILE']), 'Desktop')
class Configuration: ''' Configuration for the first notebook. Copy the configTemplate folder and define the paths to input and output data. Variables such as raw_ndvi_image_prefix may also need to be corrected if you are use a different source. ''' def init(self):
self.training_base_dir = r'C:\Users\Nicholas Metherall\Desktop\ML_Brandt\Github\ankitkariryaa-An-unexpectedly-large-count-of-trees-in-the-western-Sahara-and-Sahel-eeeb76f\SampleAnnotations'
self.training_area_fn = r'C:\Users\Nicholas Metherall\Desktop\ML_Brandt\Github\ankitkariryaa-An-unexpectedly-large-count-of-trees-in-the-western-Sahara-and-Sahel-eeeb76f\SampleAnnotations\training_areas_example.shp'
self.training_polygon_fn = r'C:\Users\Nicholas Metherall\Desktop\ML_Brandt\Github\ankitkariryaa-An-unexpectedly-large-count-of-trees-in-the-western-Sahara-and-Sahel-eeeb76f\SampleAnnotations\training_polygons_example.shp'
# For reading the VHR images
self.bands = [0]
self.raw_image_base_dir = r'C:\Users\Nicholas Metherall\Desktop\ML_Brandt\Github\ankitkariryaa-An-unexpectedly-large-count-of-trees-in-the-western-Sahara-and-Sahel-eeeb76f\SampleAnnotations\Satellite_image'
self.raw_image_file_type = '.tif'
self.raw_ndvi_image_prefix = 'ndvi'
self.raw_pan_image_prefix = 'pan'
# For writing the extracted images and their corresponding annotations and boundary file
self.path_to_write = r'C:\Users\Nicholas Metherall\Desktop\ML_Brandt\Github\ankitkariryaa-An-unexpectedly-large-count-of-trees-in-the-western-Sahara-and-Sahel-eeeb76f\Output'
self.show_boundaries_during_processing = False
self.extracted_file_type = '.png'
self.extracted_ndvi_filename = 'ndvi'
self.extracted_pan_filename = 'pan'
self.extracted_annotation_filename = 'annotation'
self.extracted_boundary_filename = 'boundary'
# Path to write should be a valid directory
assert os.path.exists(self.path_to_write)
if not len(os.listdir(self.path_to_write)) == 0:
print('Warning: path_to_write is not empty! The old files in the directory may not be overwritten!!')
I have managed to stop getting any syntax errors but there is not yet any output in the output folder and I am not sure of how to check whether this first preprocessing step is complete and the next step to follow.
Thanks for putting together this github repository.
I am following all of the steps but when I try to setup the config files I am having some issues.
I have tried to setup my config as follows but am having some issues with the path names.