-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
46 lines (38 loc) · 1.11 KB
/
main.cpp
File metadata and controls
46 lines (38 loc) · 1.11 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
#include "data_retriever.h"
#include "image_reader.h"
#include "evaluator.h"
#include "classifier.h"
#include <vector>
#include <sstream>
#include <iostream>
#include <string>
#include <fstream>
#include <set>
using namespace std;
int main() {
Classifier obj;
Evaluator eval;
bool exit = false;
while(!exit) {
cout <<"What would you like to do:train data, save a model, load a model, classify, or exit? Use keywords: train, save, load, classify, exit!";
string answer;
cin >> answer;
transform(answer.begin(), answer.end(), answer.begin(), ::tolower);
if (answer == "train") {
obj = Classifier("trainingimages2", "traininglabels2");
} else if (answer == "save") {
obj.SaveModelToFile("probabilitymodel");
obj.SavePriorsModelToFile("priorsmodel");
} else if (answer == "load") {
obj.LoadModelFromFile("probabilitymodel");
obj.LoadPriorsModelFromFile("priorsmodel");
} else if(answer == "classify") {
eval = Evaluator(obj);
cout << eval;
} else if (answer == "exit") {
cout << "exit";
exit = true;
}
}
return 0;
}