Fix nan issue in features
[trackerpp.git] / include / PredictorWrapper.h
1 #ifndef _PREDICTOR_H_
2 #define _PREDICTOR_H_
3
4 #include "SharedPtr.h"
5 #include <boost/python.hpp>
6 #include <vector>
7
8 namespace suanzi {
9
10     TK_DECLARE_PTR(PredictorWrapper);
11
12     typedef boost::python::object PY_FUN;
13
14     class PredictorWrapper
15     {
16     public:
17         PredictorWrapper(const std::string& module="predictor", const std::string& pydir = "./python");
18         ~PredictorWrapper(){}
19         void dump();
20         double predict(int index, const std::vector<double>& f);
21         bool load(const std::string& fname); // load pkl file
22
23     private:
24         boost::python::object m_module;
25     };
26
27 }
28
29 #endif // _PREDICTOR_H_