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

core: std::string more changes

This commit is contained in:
Alexander Alekhin
2018-08-23 18:17:04 +03:00
parent ae8dcdf40d
commit 7f73b105ca
11 changed files with 47 additions and 30 deletions
+5 -5
View File
@@ -3329,7 +3329,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())
@@ -3347,7 +3347,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())
@@ -3365,7 +3365,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())
@@ -3402,7 +3402,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);
@@ -3447,7 +3447,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")
@@ -163,7 +163,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;
}