mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2024-12-12 07:29:07 +08:00
Replace more STRING by std::string
Signed-off-by: Stefan Weil <sw@weilnetz.de>
This commit is contained in:
parent
9cf5b9870d
commit
a42c6c7dcd
@ -26,7 +26,6 @@
|
|||||||
#include "params.h"
|
#include "params.h"
|
||||||
#include "recodebeam.h"
|
#include "recodebeam.h"
|
||||||
#include "series.h"
|
#include "series.h"
|
||||||
#include "strngs.h"
|
|
||||||
#include "unicharcompress.h"
|
#include "unicharcompress.h"
|
||||||
|
|
||||||
class BLOB_CHOICE_IT;
|
class BLOB_CHOICE_IT;
|
||||||
@ -105,14 +104,14 @@ public:
|
|||||||
return layers;
|
return layers;
|
||||||
}
|
}
|
||||||
// Returns a specific layer from its id (from EnumerateLayers).
|
// Returns a specific layer from its id (from EnumerateLayers).
|
||||||
Network *GetLayer(const STRING &id) const {
|
Network *GetLayer(const std::string &id) const {
|
||||||
ASSERT_HOST(network_ != nullptr && network_->type() == NT_SERIES);
|
ASSERT_HOST(network_ != nullptr && network_->type() == NT_SERIES);
|
||||||
ASSERT_HOST(id.length() > 1 && id[0] == ':');
|
ASSERT_HOST(id.length() > 1 && id[0] == ':');
|
||||||
auto *series = static_cast<Series *>(network_);
|
auto *series = static_cast<Series *>(network_);
|
||||||
return series->GetLayer(&id[1]);
|
return series->GetLayer(&id[1]);
|
||||||
}
|
}
|
||||||
// Returns the learning rate of the layer from its id.
|
// Returns the learning rate of the layer from its id.
|
||||||
float GetLayerLearningRate(const STRING &id) const {
|
float GetLayerLearningRate(const std::string &id) const {
|
||||||
ASSERT_HOST(network_ != nullptr && network_->type() == NT_SERIES);
|
ASSERT_HOST(network_ != nullptr && network_->type() == NT_SERIES);
|
||||||
if (network_->TestFlag(NF_LAYER_SPECIFIC_LR)) {
|
if (network_->TestFlag(NF_LAYER_SPECIFIC_LR)) {
|
||||||
ASSERT_HOST(id.length() > 1 && id[0] == ':');
|
ASSERT_HOST(id.length() > 1 && id[0] == ':');
|
||||||
@ -150,7 +149,7 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Multiplies the learning rate of the layer with id, by the given factor.
|
// Multiplies the learning rate of the layer with id, by the given factor.
|
||||||
void ScaleLayerLearningRate(const STRING &id, double factor) {
|
void ScaleLayerLearningRate(const std::string &id, double factor) {
|
||||||
ASSERT_HOST(network_ != nullptr && network_->type() == NT_SERIES);
|
ASSERT_HOST(network_ != nullptr && network_->type() == NT_SERIES);
|
||||||
ASSERT_HOST(id.length() > 1 && id[0] == ':');
|
ASSERT_HOST(id.length() > 1 && id[0] == ':');
|
||||||
auto *series = static_cast<Series *>(network_);
|
auto *series = static_cast<Series *>(network_);
|
||||||
|
Loading…
Reference in New Issue
Block a user