提交 545a91ed 编写于 作者: W wangguanzhong 提交者: GitHub

fix args for output file (#3063)

上级 1292af43
...@@ -19,11 +19,13 @@ from __future__ import print_function ...@@ -19,11 +19,13 @@ from __future__ import print_function
import os import os
import multiprocessing import multiprocessing
def set_paddle_flags(**kwargs): def set_paddle_flags(**kwargs):
for key, value in kwargs.items(): for key, value in kwargs.items():
if os.environ.get(key, None) is None: if os.environ.get(key, None) is None:
os.environ[key] = str(value) os.environ[key] = str(value)
# NOTE(paddle-dev): All of these flags should be set before # NOTE(paddle-dev): All of these flags should be set before
# `import paddle`. Otherwise, it would not take any effect. # `import paddle`. Otherwise, it would not take any effect.
set_paddle_flags( set_paddle_flags(
...@@ -91,8 +93,8 @@ def main(): ...@@ -91,8 +93,8 @@ def main():
# eval already exists json file # eval already exists json file
if FLAGS.json_eval: if FLAGS.json_eval:
json_eval_results(eval_feed, cfg.metric, json_eval_results(
json_directory=FLAGS.output_eval) eval_feed, cfg.metric, json_directory=FLAGS.output_eval)
return return
# compile program for multi-devices # compile program for multi-devices
if devices_num <= 1: if devices_num <= 1:
...@@ -133,6 +135,7 @@ def main(): ...@@ -133,6 +135,7 @@ def main():
eval_results(results, eval_feed, cfg.metric, cfg.num_classes, resolution, eval_results(results, eval_feed, cfg.metric, cfg.num_classes, resolution,
is_bbox_normalized, FLAGS.output_eval) is_bbox_normalized, FLAGS.output_eval)
if __name__ == '__main__': if __name__ == '__main__':
parser = ArgsParser() parser = ArgsParser()
parser.add_argument( parser.add_argument(
...@@ -147,6 +150,7 @@ if __name__ == '__main__': ...@@ -147,6 +150,7 @@ if __name__ == '__main__':
type=str, type=str,
help="Dataset path, same as DataFeed.dataset.dataset_dir") help="Dataset path, same as DataFeed.dataset.dataset_dir")
parser.add_argument( parser.add_argument(
"-f",
"--output_eval", "--output_eval",
default=None, default=None,
type=str, type=str,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册