-
Notifications
You must be signed in to change notification settings - Fork 3
/
testpredict.cpp
74 lines (61 loc) · 1.64 KB
/
testpredict.cpp
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
#include "testpredict.h"
#include <armadillo>
#include "predictor.h"
#include "actionmodel.h"
#include "utils.h"
using namespace arma;
using namespace std;
TestPredict::TestPredict()
{
}
int TestPredict::test()
{
Predictor p;
p.loadModels();
p.Predict(getPoses(30)).print();
p.Predict(getPoses(20)).print();
//cout << action << endl;
return 0;
}
std::deque<arma::mat> TestPredict::getPoses(int num)
{
deque<mat> result;
string line;
ifstream poses_file ("poses.txt");
mat tmp_mat = zeros<mat>(10, 3);
if (poses_file.is_open())
{
for ( int step = 0; step != num; step ++ )
{
for (int step2 = 0; step2 != 10; step2 ++)
{
getline(poses_file, line);
vector<double> point = Utils::split_vec(line, ',');
tmp_mat.row(step2) = vec(point).t();
}
result.push_back(tmp_mat);
}
// get the meta data
// getline(model_file, line);
}else
{
cout << "Unable to open file";
}
return result;
}
//for (int haha = 0; haha != 3; haha ++)
//{
// //models[haha].c.print();
// //models[haha].transMatrix.print();
// for (int in = 0; in != 10; in ++)
// {
// models[haha].clg[in].mu_y.t().print();
// models[haha].clg[in].sigma_y.t().print();
// models[haha].clg[in].mu_x.t().print();
// models[haha].clg[in].sigma_x.t().print();
// models[haha].clg[in].mu_angle.t().print();
// models[haha].clg[in].sigma_angle.t().print();
// //models[haha].clg[in].theta.print();
// //models[haha].clg[in].mu_y.print();
// }
//}