-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathALLOpenVINO.py
More file actions
78 lines (57 loc) · 1.98 KB
/
Copy pathALLOpenVINO.py
File metadata and controls
78 lines (57 loc) · 1.98 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
############################################################################################
#
# Project: Peter Moss Acute Myeloid & Lymphoblastic Leukemia AI Research Project
# Repository: oneAPI Acute Lymphoblastic Leukemia Classifier
# Project: OneAPI OpenVINO Acute Lymphoblastic Leukemia Classifier CNN
#
# Author: Adam Milton-Barker (AdamMiltonBarker.com)
# Contributors:
# Title: ALLOpenVINO CNN
# Description: Core class for the OneAPI OpenVINO Acute Lymphoblastic Leukemia Classifier CNN.
# License: MIT License
# Last Modified: 2020-09-04
#
############################################################################################
import sys
from Classes.Helpers import Helpers
from Classes.OpenVINO import OpenVINO
from Classes.Server import Server
class ALLOpenVINO():
""" ALLOpenVINO CNN
Core class for the OneAPI OpenVINO Acute Lymphoblastic Leukemia Classifier CNN.
"""
def __init__(self):
""" Initializes the class. """
self.Helpers = Helpers("Core")
self.Core = OpenVINO()
self.Helpers.logger.info("Class initialization complete.")
def do_classify(self):
""" Loads model and classifies test data """
self.Core.test_classifier()
def do_server(self):
""" Loads the API server """
self.Server = Server(self.Core)
self.Server.start()
def do_http_classify(self):
""" Loads model and classifies test data """
self.Core.test_http_classifier()
ALLOpenVINO = ALLOpenVINO()
def main():
if len(sys.argv) < 2:
print("You must provide an argument")
exit()
elif sys.argv[1] not in ALLOpenVINO.Helpers.confs["cnn"]["core"]:
print("Mode not supported! Server, Train or Classify")
exit()
mode = sys.argv[1]
if mode == "Classify":
""" Runs the classifier locally."""
ALLOpenVINO.do_classify()
elif mode == "Server":
""" Runs the classifier in server mode."""
ALLOpenVINO.do_server()
elif mode == "Client":
""" Runs the classifier in client mode. """
ALLOpenVINO.do_http_classify()
if __name__ == "__main__":
main()