1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 07:13:02 +04:00

fix model diagnostic tool

This commit is contained in:
rogday
2022-01-18 00:03:43 +03:00
parent a55950865e
commit 0fe7420638
6 changed files with 113 additions and 69 deletions
+4 -7
View File
@@ -37,11 +37,8 @@ void skipModelImport(bool skip)
void detail::LayerHandler::addMissing(const std::string& name, const std::string& type)
{
cv::AutoLock lock(getLayerFactoryMutex());
auto& registeredLayers = getLayerFactoryImpl();
// If we didn't add it, but can create it, it's custom and not missing.
if (layers.find(type) == layers.end() && registeredLayers.find(type) != registeredLayers.end())
if (!contains(type) && LayerFactory::isLayerRegistered(type))
{
return;
}
@@ -51,17 +48,17 @@ void detail::LayerHandler::addMissing(const std::string& name, const std::string
bool detail::LayerHandler::contains(const std::string& type) const
{
return layers.find(type) != layers.end();
return layers.count(type) != 0;
}
void detail::LayerHandler::printMissing()
void detail::LayerHandler::printMissing() const
{
if (layers.empty())
{
return;
}
std::stringstream ss;
std::ostringstream ss;
ss << "DNN: Not supported types:\n";
for (const auto& type_names : layers)
{