Skip to content
This repository has been archived by the owner on May 3, 2021. It is now read-only.

Commit

Permalink
train: associate ground-truth paths w/ input paths
Browse files Browse the repository at this point in the history
  • Loading branch information
jinnovation committed Aug 19, 2017
1 parent 5f75799 commit aebbbfe
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ numpy==1.12.1
olefile==0.44
opencv-contrib-python==3.2.0.7
packaging==16.8
pathlib==1.0.1
Pillow==4.1.1
py==1.4.33
pyparsing==2.2.0
Expand Down
38 changes: 38 additions & 0 deletions train
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/usr/bin/env python

from argparse import ArgumentParser
from pathlib import Path

p = ArgumentParser(description="Train the neural network.")
p.add_argument(
"dir",
type=str,
help="directory containing the training files",
)
p.add_argument(
"--truth-subdir",
default="ground truth",
type=str,
help="subdirectory of training directory containing ground truth files",
)
p.add_argument(
"--input-subdir",
default="rainy image",
type=str,
help="subdirectory of training directory containing training input files",
)
p.add_argument(
"--ext",
default=".jpg",
type=str,
help="truth and input file extensions",
)

if __name__ == "__main__":
a = p.parse_args()

paths_truth_to_inputs = {
t: Path(a.dir, a.input_subdir).glob(t.stem + "_[0-9]*" + a.ext)
for t in Path(a.dir, a.truth_subdir).iterdir()
if t.suffix == a.ext
}

0 comments on commit aebbbfe

Please sign in to comment.