forked from B87/cv-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcv_cli.py
31 lines (21 loc) · 1.18 KB
/
cv_cli.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import argparse
import utils
import os
import cv2
from core.execution import CommandExecution
"""
"""
implemented_commands = ['gender-detection']
implemented_commands_str = "Implemented commands are : "+",".join(implemented_commands)
ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
MODELS_DIR = os.path.join(ROOT_DIR, 'data/models')
if __name__ == "__main__":
parser = argparse.ArgumentParser(description = 'Shell util to manipulate and extract information from images')
parser.add_argument("-in", "--input", help='Path of the folder containing the input images in jpg format', required = False, default = None)
parser.add_argument("-o", "--output", help='Destination path for the output of the process, if not provided the results will be pinted on the console',
required = False, default = None )
parser.add_argument("-c", "--command", help='Name of the command to run.' + implemented_commands_str, required = True)
parser.add_argument("-p", "--print", help='Print results and images during processing', required = False, action = 'store_true', default = False)
args = parser.parse_args()
execution = CommandExecution(args.input, args.command, args.output)
execution.execute()