Commit 460c11f9 authored by Gaetano Raffaele's avatar Gaetano Raffaele

ENH: prioritize validation samples construction

parent 03f3c2c8
......@@ -549,27 +549,6 @@ def main(argv):
shpd.DeleteDataSource(otl)
os.remove(otl.replace('.shp','.tif'))
if ch_mode > 0:
# generating map samples (TBD)
gttl = sorted(glob.glob(seg_fld + '/segmentation_*.shp'))
ogttl = []
# BEGIN ** SAMPLES **
cmd_list = []
for tl in gttl:
tocp = glob.glob(os.path.splitext(tl)[0] + '.*')
for fn in tocp:
shutil.copyfile(fn, test_fld + '/' + os.path.basename(fn))
otl = test_fld + '/' + os.path.basename(tl)
ogttl.append(otl)
cmd_list.append(
['python', 'mrzonalstats.py', '--series-prefix', 'T', '--raster-prefix', 'F', '--band-prefix', 'D',
'--fix-nodata', '--overwrite', feat_groups_str, otl, "Segment_ID", 'mean'])
queuedProcess(cmd_list, N_processes=N_proc, shell=sh)
# END ** SAMPLES **
if ch_mode == 0 or ch_mode == 2:
# generating VAL samples and merging tiles
gttl = sorted(glob.glob(seg_fld + '/VAL_segmentation_*.shp'))
......@@ -604,6 +583,27 @@ def main(argv):
shpd.DeleteDataSource(otl)
os.remove(otl.replace('.shp', '.tif'))
if ch_mode > 0:
# generating map samples (TBD)
gttl = sorted(glob.glob(seg_fld + '/segmentation_*.shp'))
ogttl = []
# BEGIN ** SAMPLES **
cmd_list = []
for tl in gttl:
tocp = glob.glob(os.path.splitext(tl)[0] + '.*')
for fn in tocp:
shutil.copyfile(fn, test_fld + '/' + os.path.basename(fn))
otl = test_fld + '/' + os.path.basename(tl)
ogttl.append(otl)
cmd_list.append(
['python', 'mrzonalstats.py', '--series-prefix', 'T', '--raster-prefix', 'F', '--band-prefix', 'D',
'--fix-nodata', '--overwrite', feat_groups_str, otl, "Segment_ID", 'mean'])
queuedProcess(cmd_list, N_processes=N_proc, shell=sh)
# END ** SAMPLES **
if single_step:
sys.exit("Single step mode. Exiting.")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment