Add boost python, and predictor wrapper
[trackerpp.git] / src / Engine.cpp
index be5ceda..6d44f3c 100644 (file)
@@ -2,6 +2,7 @@
 #include <thread>
 #include "Engine.h"
 #include "Logger.h"
+#include "PredictorWrapper.h"
 
 using namespace suanzi;
 
@@ -42,17 +43,25 @@ void Engine::destroy()
 
 void Engine::setVideoSrc(VideoSrcType type, const std::string& url)
 {
-    videoSrc = url;
-    reader = VideoReaderFactory::createVideoReader(type, url);
+    PredictorWrapperPtr pp = PredictorWrapper::create("./python/model.pkl");
+
+    pp->dump();
+
+//    videoSrc = url;
+    //reader = VideoReaderFactory::createVideoReader(type, url);
+
 }
 
 void Engine::run()
 {
     LOG_DEBUG(TAG, "run");
     cv::Mat frame;
+    Detection detections[128];
     while (reader->read(frame)){
         LOG_DEBUG(TAG, "Size: " << frame.cols  <<  "x" << frame.rows);
-        detector->detect(frame);
+        // TODO
+        int total = detector->detect(frame, detections);
+        multiTracker->update(total, detections, frame);
     }
 }