1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-30 15:53:03 +04:00

Merge pull request #12293 from alalek:cleanup_stl_string_replacement

This commit is contained in:
Alexander Alekhin
2018-08-30 15:43:57 +00:00
19 changed files with 48 additions and 720 deletions
+5 -5
View File
@@ -3328,7 +3328,7 @@ void LayerFactory::registerLayer(const String &type, Constructor constructor)
CV_TRACE_ARG_VALUE(type, "type", type.c_str());
cv::AutoLock lock(getLayerFactoryMutex());
String type_ = type.toLowerCase();
String type_ = toLowerCase(type);
LayerFactory_Impl::iterator it = getLayerFactoryImpl().find(type_);
if (it != getLayerFactoryImpl().end())
@@ -3346,7 +3346,7 @@ void LayerFactory::unregisterLayer(const String &type)
CV_TRACE_ARG_VALUE(type, "type", type.c_str());
cv::AutoLock lock(getLayerFactoryMutex());
String type_ = type.toLowerCase();
String type_ = toLowerCase(type);
LayerFactory_Impl::iterator it = getLayerFactoryImpl().find(type_);
if (it != getLayerFactoryImpl().end())
@@ -3364,7 +3364,7 @@ Ptr<Layer> LayerFactory::createLayerInstance(const String &type, LayerParams& pa
CV_TRACE_ARG_VALUE(type, "type", type.c_str());
cv::AutoLock lock(getLayerFactoryMutex());
String type_ = type.toLowerCase();
String type_ = toLowerCase(type);
LayerFactory_Impl::const_iterator it = getLayerFactoryImpl().find(type_);
if (it != getLayerFactoryImpl().end())
@@ -3401,7 +3401,7 @@ BackendWrapper::~BackendWrapper() {}
Net readNet(const String& _model, const String& _config, const String& _framework)
{
String framework = _framework.toLowerCase();
String framework = toLowerCase(_framework);
String model = _model;
String config = _config;
const std::string modelExt = model.substr(model.rfind('.') + 1);
@@ -3446,7 +3446,7 @@ Net readNet(const String& _model, const String& _config, const String& _framewor
Net readNet(const String& _framework, const std::vector<uchar>& bufferModel,
const std::vector<uchar>& bufferConfig)
{
String framework = _framework.toLowerCase();
String framework = toLowerCase(_framework);
if (framework == "caffe")
return readNetFromCaffe(bufferConfig, bufferModel);
else if (framework == "tensorflow")
@@ -164,7 +164,7 @@ public:
void getCodeType(const LayerParams &params)
{
String codeTypeString = params.get<String>("code_type").toLowerCase();
String codeTypeString = toLowerCase(params.get<String>("code_type"));
if (codeTypeString == "center_size")
_codeType = "CENTER_SIZE";
else
+1 -1
View File
@@ -71,7 +71,7 @@ public:
op = SUM;
if (params.has("operation"))
{
String operation = params.get<String>("operation").toLowerCase();
String operation = toLowerCase(params.get<String>("operation"));
if (operation == "prod")
op = PROD;
else if (operation == "sum")
+1 -1
View File
@@ -76,7 +76,7 @@ public:
if (params.has("pool") || params.has("kernel_size") ||
params.has("kernel_w") || params.has("kernel_h"))
{
String pool = params.get<String>("pool", "max").toLowerCase();
String pool = toLowerCase(params.get<String>("pool", "max"));
if (pool == "max")
type = MAX;
else if (pool == "ave")
+3 -3
View File
@@ -349,16 +349,16 @@ Ptr<LSTMLayer> LSTMLayer::create(const LayerParams& params)
int LSTMLayer::inputNameToIndex(String inputName)
{
if (inputName.toLowerCase() == "x")
if (toLowerCase(inputName) == "x")
return 0;
return -1;
}
int LSTMLayer::outputNameToIndex(const String& outputName)
{
if (outputName.toLowerCase() == "h")
if (toLowerCase(outputName) == "h")
return 0;
else if (outputName.toLowerCase() == "c")
else if (toLowerCase(outputName) == "c")
return 1;
return -1;
}