Commit e99cb397 authored by Gaetano Raffaele's avatar Gaetano Raffaele
Browse files

ENH: started coding new interface.

parent 6656bc89
No related merge requests found
Showing with 3 additions and 5 deletions
+3 -5
...@@ -21,6 +21,7 @@ def main(args): ...@@ -21,6 +21,7 @@ def main(args):
formatter_class=argparse.ArgumentDefaultsHelpFormatter) formatter_class=argparse.ArgumentDefaultsHelpFormatter)
segmt.add_argument("img", type=str, help="Path to the image to segment.") segmt.add_argument("img", type=str, help="Path to the image to segment.")
segmt.add_argument("threshold", type=float, help="Threshold for the heterogeneity criterion in Baatz-Shape.") segmt.add_argument("threshold", type=float, help="Threshold for the heterogeneity criterion in Baatz-Shape.")
segmt.add_argument("outimg", type=float, help="Path to the output segmentation file (.tif, .shp, .gpkg, .gml).")
segmt.add_argument("--cw", type=float, nargs="?", default=0.5, help="Color weight in Baatz-Shape criterion.") segmt.add_argument("--cw", type=float, nargs="?", default=0.5, help="Color weight in Baatz-Shape criterion.")
segmt.add_argument("--sw", type=float, nargs="?", default=0.5, help="Spatial weight in Baatz-Shape criterion.") segmt.add_argument("--sw", type=float, nargs="?", default=0.5, help="Spatial weight in Baatz-Shape criterion.")
segmt.add_argument("--n_first_iter", type=int, nargs="?", default=12, help="Number of iterations for parallel tile processing.") segmt.add_argument("--n_first_iter", type=int, nargs="?", default=12, help="Number of iterations for parallel tile processing.")
...@@ -30,9 +31,6 @@ def main(args): ...@@ -30,9 +31,6 @@ def main(args):
segmt.add_argument("--keep_graph", help="Keep the graph files (.bin) after segmentation.", action='store_true') segmt.add_argument("--keep_graph", help="Keep the graph files (.bin) after segmentation.", action='store_true')
segmt.add_argument("--force_parallel", help="Force the parallelization of the process even if the full graph fits in memory.", action='store_true') segmt.add_argument("--force_parallel", help="Force the parallelization of the process even if the full graph fits in memory.", action='store_true')
if len(args) == 1: if len(args) == 1:
parser.print_help() parser.print_help()
sys.exit(0) sys.exit(0)
...@@ -43,8 +41,8 @@ def main(args): ...@@ -43,8 +41,8 @@ def main(args):
print('Not yet implemented.') print('Not yet implemented.')
if arg.cmd == "segment": if arg.cmd == "segment":
print(arg.force_parallel) run_segmentation(arg.img, arg.threshold, arg.cw, arg.sw, arg.outimg, arg.n_first_iter, arg.tile_margin,
print('Here.') arg.n_proc, arg.mem_limit, not arg.keep_graph, arg.force_parallel)
return 0 return 0
......
Supports Markdown
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