|
@@ -23,6 +23,8 @@ void YoloFeatureExtractor::loadClassNames(const std::string & file)
|
|
|
|
|
|
|
|
std::vector<float> YoloFeatureExtractor::extractFeatures(const std::string & imagePath)
|
|
std::vector<float> YoloFeatureExtractor::extractFeatures(const std::string & imagePath)
|
|
|
{
|
|
{
|
|
|
|
|
+ auto start_time = std::chrono::high_resolution_clock::now();
|
|
|
|
|
+
|
|
|
cv::Mat image = cv::imread(imagePath);
|
|
cv::Mat image = cv::imread(imagePath);
|
|
|
if (image.empty())
|
|
if (image.empty())
|
|
|
{
|
|
{
|
|
@@ -47,6 +49,11 @@ std::vector<float> YoloFeatureExtractor::extractFeatures(const std::string & ima
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ auto end_time = std::chrono::high_resolution_clock::now();
|
|
|
|
|
+ auto duration = std::chrono::duration_cast<std::chrono::milliseconds>(end_time - start_time);
|
|
|
|
|
+
|
|
|
|
|
+ int time = duration.count();
|
|
|
|
|
+
|
|
|
return features;
|
|
return features;
|
|
|
}
|
|
}
|
|
|
|
|
|