|
|
@@ -17,10 +17,10 @@ private:
|
|
|
float NMS_THRESHOLD;
|
|
|
|
|
|
public:
|
|
|
- YoloFeatureManager(const std::string & modelPath, const std::string & classesPath);
|
|
|
+ YoloFeatureManager();
|
|
|
~YoloFeatureManager() = default;
|
|
|
|
|
|
-
|
|
|
+ void loadModel(const std::string & modelPath, const std::string & classesPath);
|
|
|
void loadClassNames(const std::string & file);
|
|
|
|
|
|
// 提取特征
|
|
|
@@ -33,6 +33,7 @@ public:
|
|
|
void YoloFeatureManager::drawDetection(cv::Mat& img, const std::vector<cv::Rect>& boxes, const std::vector<int>& classIds,
|
|
|
const std::vector<float>& confidences, const std::vector<std::string>& classNames);
|
|
|
|
|
|
+ //根据摄像头读取的帧,识别出对应类别的name(英文的)
|
|
|
std::string Class(cv::Mat& image);
|
|
|
|
|
|
private:
|
|
|
@@ -52,7 +53,7 @@ private:
|
|
|
}
|
|
|
|
|
|
// 获取类别名称
|
|
|
- std::string getClassName(int classId) const
|
|
|
+ std::string getClassName(std::size_t classId) const
|
|
|
{
|
|
|
if (classId >= 0 && classId < classNames.size())
|
|
|
{
|