فهرست منبع

display parser modification

Dimitri Korsch 6 سال پیش
والد
کامیت
abff3aa0fa
1فایلهای تغییر یافته به همراه8 افزوده شده و 14 حذف شده
  1. 8 14
      scripts/utils/parser.py

+ 8 - 14
scripts/utils/parser.py

@@ -2,28 +2,22 @@ from cvargparse import BaseParser, Arg
 
 from nabirds.annotations import AnnotationType
 
-def parse_args():
-
-	parser = BaseParser([
+from nabirds.utils import read_info_file
 
-		Arg("data",
-			help="Folder containing the dataset with images and annotation files or dataset info file",
-			type=str),
+DEFAULT_INFO_FILE="/home/korsch/Data/info.yml"
 
-		AnnotationType.as_arg("dataset",
-			help_text="Type of the annotation"),
+info_file = read_info_file(DEFAULT_INFO_FILE)
 
-		Arg("--parts", "-p",
-			choices=[
-				"GT", "GT2", "NAC", "UNI", "L1_pred", "L1_full",
-				"CARS_UNI"
-			]),
+def parse_args():
 
+	parser = BaseParser([
+		Arg("data", default=DEFAULT_INFO_FILE),
+		Arg("dataset", choices=info_file.DATASETS.keys()),
+		Arg("parts", default="GLOBAL", choices=info_file.PARTS.keys()),
 
 		Arg("--feature_model", "-fm",
 			choices=["inception", "inception_tf", "resnet"]),
 
-
 		Arg("--subset", "-sub",
 			help="Possible subsets: train, test",
 			choices=["train", "test"],