From e99cb397b720294aa1a1ecd20030f4193f4db6b0 Mon Sep 17 00:00:00 2001
From: "raffaele.gaetano" <raffaele.gaetano@cirad.fr>
Date: Fri, 22 Jul 2022 17:12:06 +0200
Subject: [PATCH] ENH: started coding new interface.

---
 moringa.py | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/moringa.py b/moringa.py
index 8dabe8c..6cb6015 100644
--- a/moringa.py
+++ b/moringa.py
@@ -21,6 +21,7 @@ def main(args):
                               formatter_class=argparse.ArgumentDefaultsHelpFormatter)
     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("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("--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.")
@@ -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("--force_parallel", help="Force the parallelization of the process even if the full graph fits in memory.", action='store_true')
 
-
-
-
     if len(args) == 1:
         parser.print_help()
         sys.exit(0)
@@ -43,8 +41,8 @@ def main(args):
         print('Not yet implemented.')
 
     if arg.cmd == "segment":
-        print(arg.force_parallel)
-        print('Here.')
+        run_segmentation(arg.img, arg.threshold, arg.cw, arg.sw, arg.outimg, arg.n_first_iter, arg.tile_margin,
+                         arg.n_proc, arg.mem_limit, not arg.keep_graph, arg.force_parallel)
 
     return 0
 
-- 
GitLab