-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathClassifier.py
50 lines (39 loc) · 1.84 KB
/
Classifier.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
from classes.ImageClassifier import ImageClassifier
import argparse
parser = argparse.ArgumentParser(prog="Simple Image Classifier",
description="Program to train ML algorithms to classify images. "
"It uses data from the pictures folder. "
"The folder name counts as the label/target.")
parser.add_argument("-m",
"--model",
help="ML model that will be used for training.",
choices=["SVC", "RandomForest"])
parser.add_argument("-v",
"--verbose",
help="Shows more info messages.",
action='store_true')
parser.add_argument("-r",
"--resolution",
help="Resolution the image will get resized to. Default=(150, 150)",
nargs="?",
default=(150, 150))
parser.add_argument("-f",
"--filter",
help="Apply certain filters/preprocessing to the image.",
choices=["gray", "lbp"])
parser.add_argument("-s",
"--save",
help="The name you want to give to the saved model. This will be saved in the models folder.",
nargs="?")
parser.add_argument("-l",
"--load",
help="The name of the model you want to load. This will be loaded from the models folder.",
nargs="?")
parser.add_argument("-p",
"--predict",
help="The name of the picture you want the model to predict. This will be loaded from the predict folder.",
nargs="+")
args = parser.parse_args()
classifier = ImageClassifier()
classifier.argumentParser(args)
classifier.run()