"git@developer.sourcefind.cn:OpenDAS/vision.git" did not exist on "888a6993e62f34ffd47f1a240725f54275ff0ccf"
other.cpp 593 Bytes
Newer Older
Davis King's avatar
Davis King committed
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
#include <boost/python.hpp>
#include <boost/shared_ptr.hpp>
#include <dlib/matrix.h>

using namespace dlib;
using namespace std;
using namespace boost::python;

tuple get_training_data()
{
    typedef matrix<double,0,1> sample_type;
    std::vector<sample_type> samples;
    std::vector<double> labels;

    sample_type samp(3);
    samp = 1,2,3;
    samples.push_back(samp);
    labels.push_back(+1);
    samp = -1,-2,-3;
    samples.push_back(samp);
    labels.push_back(-1);

    return make_tuple(samples, labels);
}

void bind_other()
{
    def("get_training_data",get_training_data);
}