diff options
author | Peng Wu <alexepico@gmail.com> | 2011-07-23 21:28:52 +0800 |
---|---|---|
committer | Peng Wu <alexepico@gmail.com> | 2011-07-23 21:28:52 +0800 |
commit | 4f8c98854c8f507ae1b1b7e1b0875d1efbad0c2a (patch) | |
tree | ef3aa9a083ec59ec17928f90aade1f79e7e16ba3 | |
parent | f06159167fc105e9433e52a0d1eec410ccbaf71d (diff) | |
download | trainer-4f8c98854c8f507ae1b1b7e1b0875d1efbad0c2a.tar.gz trainer-4f8c98854c8f507ae1b1b7e1b0875d1efbad0c2a.tar.xz trainer-4f8c98854c8f507ae1b1b7e1b0875d1efbad0c2a.zip |
add main to estimate.py
-rwxr-xr-x[-rw-r--r--] | estimate.py | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/estimate.py b/estimate.py index 6ba0471..3ca48db 100644..100755 --- a/estimate.py +++ b/estimate.py @@ -59,7 +59,10 @@ def walkThroughModels(path): for onefile in files: filepath = os.path.join(root, onefile) if onefile.endswith(config.getModelPostfix()): + subpath = os.path.relpath(filepath, path) + print("Processing " + subpath) handleOneModel(filepath) + print("Processed " + subpath) elif onefile.endswith(config.getStatusPostfix()): pass elif onefile.endswith(config.getIndexPostfix()): @@ -134,4 +137,20 @@ def sortModels(indexname, sortedindexname): utils.store_status(sortedindexfilestatuspath, sortedindexfilestatus) if __name__ == '__main__': - pass + parser = ArgumentParser(description='Estimate model candidates.') + parser.add_argument('--modeldir', action='store', \ + help='model directory', \ + default=config.getModelDir()) + + args = parser.parse_args() + print(args) + print("estimating") + walkThroughModels(args.modeldir) + print("gathering") + indexname = os.path.join(args.modeldir, config.getEstimateIndex()) + gatherModels(args.modeldir, indexname) + print("sorting") + sortedindexname = os.path.join(args.modeldir, \ + config.getSortedEstimateIndex()) + sortModels(indexname, sortedindexname) + print("done") |