Commit ad865bfd authored by wanghailong's avatar wanghailong

修改yolo中命名,减少命名冲突

parent f772ebb4
...@@ -9,10 +9,10 @@ ...@@ -9,10 +9,10 @@
#include <unistd.h> #include <unistd.h>
#include <sys/time.h> #include <sys/time.h>
Detector* detector; ObjectDetector* detector;
void InitCnrt(bool useConfig,Config& models_config) { void InitCnrt(bool useConfig,Config& models_config) {
detector = new Detector; detector = new ObjectDetector();
Config config_v3; Config config_v3;
config_v3.net_type = YOLOV3; config_v3.net_type = YOLOV3;
...@@ -154,6 +154,6 @@ void inference(std::map<int,Results*>* results_map,vector<cv::Mat>* input_mats) ...@@ -154,6 +154,6 @@ void inference(std::map<int,Results*>* results_map,vector<cv::Mat>* input_mats)
gettimeofday(&end, NULL); gettimeofday(&end, NULL);
time = (1000000 * (end.tv_sec - start.tv_sec) + end.tv_usec - start.tv_usec) / time = (1000000 * (end.tv_sec - start.tv_sec) + end.tv_usec - start.tv_usec) /
(1000.0); (1000.0);
cout << "total time = " << time << "ms" << endl; //cout << "total time = " << time << "ms" << endl;
} }
#include "class_detector.h" #include "class_detector.h"
#include "class_yolo_detector.hpp" #include "class_yolo_detector.hpp"
class Detector::Impl class ObjectDetector::Impl
{ {
public: public:
Impl() {} Impl() {}
...@@ -11,12 +11,12 @@ public: ...@@ -11,12 +11,12 @@ public:
YoloDectector _detector; YoloDectector _detector;
}; };
Detector::Detector() ObjectDetector::ObjectDetector()
{ {
_impl = new Impl(); _impl = new Impl();
} }
Detector::~Detector() ObjectDetector::~ObjectDetector()
{ {
if (_impl) if (_impl)
{ {
...@@ -25,12 +25,12 @@ Detector::~Detector() ...@@ -25,12 +25,12 @@ Detector::~Detector()
} }
} }
void Detector::init(const Config &config) void ObjectDetector::init(const Config &config)
{ {
_impl->_detector.init(config); _impl->_detector.init(config);
} }
void Detector::detect(const std::vector<cv::Mat> &mat_image, std::vector<BatchResult> &vec_batch_result) void ObjectDetector::detect(const std::vector<cv::Mat> &mat_image, std::vector<BatchResult> &vec_batch_result)
{ {
_impl->_detector.detect(mat_image, vec_batch_result); _impl->_detector.detect(mat_image, vec_batch_result);
} }
...@@ -52,12 +52,12 @@ struct Config ...@@ -52,12 +52,12 @@ struct Config
}; };
class API Detector class API ObjectDetector
{ {
public: public:
explicit Detector(); explicit ObjectDetector();
~Detector(); ~ObjectDetector();
void init(const Config &config); void init(const Config &config);
...@@ -65,8 +65,8 @@ public: ...@@ -65,8 +65,8 @@ public:
private: private:
Detector(const Detector &); ObjectDetector(const ObjectDetector &);
const Detector &operator =(const Detector &); const ObjectDetector &operator =(const ObjectDetector &);
class Impl; class Impl;
Impl *_impl; Impl *_impl;
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment