Skip to content

Commit

Permalink
Only check existance of summary directory if flag is set
Browse files Browse the repository at this point in the history
If the --summary flag is not set, there is no need to ensure that the
FLAGS.summary directory exists.
  • Loading branch information
abagshaw committed Jan 10, 2018
1 parent 89101da commit abdb910
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions darkflow/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,12 @@ def _get_dir(dirs):
for d in dirs:
this = os.path.abspath(os.path.join(os.path.curdir, d))
if not os.path.exists(this): os.makedirs(this)
_get_dir([FLAGS.imgdir, FLAGS.binary, FLAGS.backup,
os.path.join(FLAGS.imgdir,'out'), FLAGS.summary])

requiredDirectories = [FLAGS.imgdir, FLAGS.binary, FLAGS.backup, os.path.join(FLAGS.imgdir,'out')]
if FLAGS.summary:
requiredDirectories.append(FLAGS.summary)

_get_dir(requiredDirectories)

# fix FLAGS.load to appropriate type
try: FLAGS.load = int(FLAGS.load)
Expand Down

0 comments on commit abdb910

Please sign in to comment.