diff options
Diffstat (limited to 'backend/tolData/genImgs.py')
| -rwxr-xr-x | backend/tolData/genImgs.py | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/backend/tolData/genImgs.py b/backend/tolData/genImgs.py index ecca8e0..930990b 100755 --- a/backend/tolData/genImgs.py +++ b/backend/tolData/genImgs.py @@ -4,9 +4,8 @@ import sys, os, subprocess import sqlite3, urllib.parse import signal -usageInfo = f""" -Usage: {sys.argv[0]} - +import argparse +parser = argparse.ArgumentParser(description=""" Reads node IDs and image paths from a file, and possibly from a directory, and generates cropped/resized versions of those images into a directory, with names of the form 'nodeId1.jpg'. Also adds image metadata to the @@ -15,10 +14,8 @@ database. SIGINT can be used to stop, and the program can be re-run to continue processing. It uses already-existing database entries to decide what to skip. -""" -if len(sys.argv) > 1: - print(usageInfo, file=sys.stderr) - sys.exit(1) +""", formatter_class=argparse.RawDescriptionHelpFormatter) +parser.parse_args() imgListFile = "imgList.txt" outDir = "img/" |
