You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fori, s2inenumerate(s2_imagery):
print(i, s2)
# if i==1:# break# get the imagery location name (eg. pokhara, kathmandu, janakpur etc.)imagery_location=os.path.basename(s2).split('_')[0]
# get yearyear=os.path.basename(s2).split('_')[-2]
# read imagerys2_gt=GeoTile(s2)
s2_gt.generate_tiles(save_tiles=False)
s2_gt.convert_nan_to_zero()
s2_gt.normalize_tiles()
# # save tiless2_gt.save_tiles(f"{OUTPUT_TILES}_{year}/{imagery_location}", prefix=f'{imagery_location}_s2_')
print(imagery_location)
# # # get the mask file based on each locations (eg. rapti, tinau, ratu)forj, maskinenumerate(s2_masks):
ifi==j:
print('Imagery location: ', imagery_location)
print('Mask location: ', os.path.basename(mask).split('_')[0])
s2_gt.rasterization(mask, f"{OUTPUT_MASK}/{imagery_location}_{year}_s2_mask.tif")
Second version:
fori, maskinenumerate(mask_files):
gt=GeoTile(mask)
mask_location=os.path.basename(mask).split('_')[0]
year=os.path.basename(mask).split('_')[1]
# generate the mask file based on each binary outputgt.generate_tiles(f"../../../data/tiles/mask_rivers_{year}/{mask_location}", prefix=f'{mask_location}_s2_')
The first version tool only 2 min 27 second to run the code however, the second version took 6 min 39 second. My guess is there is something going wrong with parameter save_tiles=True.
The text was updated successfully, but these errors were encountered:
I tested two different code,
The first version tool only
2 min 27 second
to run the code however, the second version took6 min 39 second
. My guess is there is something going wrong with parametersave_tiles=True
.The text was updated successfully, but these errors were encountered: