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:
@@ -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 ¶ms)
|
||||
{
|
||||
String codeTypeString = params.get<String>("code_type").toLowerCase();
|
||||
String codeTypeString = toLowerCase(params.get<String>("code_type"));
|
||||
if (codeTypeString == "center_size")
|
||||
_codeType = "CENTER_SIZE";
|
||||
else
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user