tesseract  v4.0.0-17-g361f3264
Open Source OCR Engine
tesseract::LSTMRecognizer Class Reference

#include <lstmrecognizer.h>

Inheritance diagram for tesseract::LSTMRecognizer:
Collaboration diagram for tesseract::LSTMRecognizer:

Public Member Functions

 LSTMRecognizer ()
 
 ~LSTMRecognizer ()
 
int NumOutputs () const
 
int training_iteration () const
 
int sample_iteration () const
 
double learning_rate () const
 
LossType OutputLossType () const
 
bool SimpleTextOutput () const
 
bool IsIntMode () const
 
bool IsRecoding () const
 
bool IsTensorFlow () const
 
GenericVector< STRINGEnumerateLayers () const
 
NetworkGetLayer (const STRING &id) const
 
float GetLayerLearningRate (const STRING &id) const
 
void ScaleLearningRate (double factor)
 
void ScaleLayerLearningRate (const STRING &id, double factor)
 
void ConvertToInt ()
 
const UNICHARSETGetUnicharset () const
 
const UnicharCompressGetRecoder () const
 
const DictGetDict () const
 
void SetIteration (int iteration)
 
int NumInputs () const
 
int null_char () const
 
bool Load (const char *lang, TessdataManager *mgr)
 
bool Serialize (const TessdataManager *mgr, TFile *fp) const
 
bool DeSerialize (const TessdataManager *mgr, TFile *fp)
 
bool LoadCharsets (const TessdataManager *mgr)
 
bool LoadRecoder (TFile *fp)
 
bool LoadDictionary (const char *lang, TessdataManager *mgr)
 
void RecognizeLine (const ImageData &image_data, bool invert, bool debug, double worst_dict_cert, const TBOX &line_box, PointerVector< WERD_RES > *words, int lstm_choice_mode=0)
 
void OutputStats (const NetworkIO &outputs, float *min_output, float *mean_output, float *sd)
 
bool RecognizeLine (const ImageData &image_data, bool invert, bool debug, bool re_invert, bool upside_down, float *scale_factor, NetworkIO *inputs, NetworkIO *outputs)
 
STRING DecodeLabels (const GenericVector< int > &labels)
 
void DisplayForward (const NetworkIO &inputs, const GenericVector< int > &labels, const GenericVector< int > &label_coords, const char *window_name, ScrollView **window)
 
void LabelsFromOutputs (const NetworkIO &outputs, GenericVector< int > *labels, GenericVector< int > *xcoords)
 

Protected Member Functions

void SetRandomSeed ()
 
void DisplayLSTMOutput (const GenericVector< int > &labels, const GenericVector< int > &xcoords, int height, ScrollView *window)
 
void DebugActivationPath (const NetworkIO &outputs, const GenericVector< int > &labels, const GenericVector< int > &xcoords)
 
void DebugActivationRange (const NetworkIO &outputs, const char *label, int best_choice, int x_start, int x_end)
 
void LabelsViaReEncode (const NetworkIO &output, GenericVector< int > *labels, GenericVector< int > *xcoords)
 
void LabelsViaSimpleText (const NetworkIO &output, GenericVector< int > *labels, GenericVector< int > *xcoords)
 
const char * DecodeLabel (const GenericVector< int > &labels, int start, int *end, int *decoded)
 
const char * DecodeSingleLabel (int label)
 

Protected Attributes

Networknetwork_
 
CCUtil ccutil_
 
UnicharCompress recoder_
 
STRING network_str_
 
int32_t training_flags_
 
int32_t training_iteration_
 
int32_t sample_iteration_
 
int32_t null_char_
 
float learning_rate_
 
float momentum_
 
float adam_beta_
 
TRand randomizer_
 
NetworkScratch scratch_space_
 
Dictdict_
 
RecodeBeamSearchsearch_
 
ScrollViewdebug_win_
 

Constructor & Destructor Documentation

◆ LSTMRecognizer()

tesseract::LSTMRecognizer::LSTMRecognizer ( )

◆ ~LSTMRecognizer()

tesseract::LSTMRecognizer::~LSTMRecognizer ( )

Member Function Documentation

◆ ConvertToInt()

void tesseract::LSTMRecognizer::ConvertToInt ( )
inline

◆ DebugActivationPath()

void tesseract::LSTMRecognizer::DebugActivationPath ( const NetworkIO outputs,
const GenericVector< int > &  labels,
const GenericVector< int > &  xcoords 
)
protected

◆ DebugActivationRange()

void tesseract::LSTMRecognizer::DebugActivationRange ( const NetworkIO outputs,
const char *  label,
int  best_choice,
int  x_start,
int  x_end 
)
protected

◆ DecodeLabel()

const char * tesseract::LSTMRecognizer::DecodeLabel ( const GenericVector< int > &  labels,
int  start,
int *  end,
int *  decoded 
)
protected

◆ DecodeLabels()

STRING tesseract::LSTMRecognizer::DecodeLabels ( const GenericVector< int > &  labels)

◆ DecodeSingleLabel()

const char * tesseract::LSTMRecognizer::DecodeSingleLabel ( int  label)
protected

◆ DeSerialize()

bool tesseract::LSTMRecognizer::DeSerialize ( const TessdataManager mgr,
TFile fp 
)

◆ DisplayForward()

void tesseract::LSTMRecognizer::DisplayForward ( const NetworkIO inputs,
const GenericVector< int > &  labels,
const GenericVector< int > &  label_coords,
const char *  window_name,
ScrollView **  window 
)

◆ DisplayLSTMOutput()

void tesseract::LSTMRecognizer::DisplayLSTMOutput ( const GenericVector< int > &  labels,
const GenericVector< int > &  xcoords,
int  height,
ScrollView window 
)
protected

◆ EnumerateLayers()

GenericVector<STRING> tesseract::LSTMRecognizer::EnumerateLayers ( ) const
inline

◆ GetDict()

const Dict* tesseract::LSTMRecognizer::GetDict ( ) const
inline

◆ GetLayer()

Network* tesseract::LSTMRecognizer::GetLayer ( const STRING id) const
inline

◆ GetLayerLearningRate()

float tesseract::LSTMRecognizer::GetLayerLearningRate ( const STRING id) const
inline

◆ GetRecoder()

const UnicharCompress& tesseract::LSTMRecognizer::GetRecoder ( ) const
inline

◆ GetUnicharset()

const UNICHARSET& tesseract::LSTMRecognizer::GetUnicharset ( ) const
inline

◆ IsIntMode()

bool tesseract::LSTMRecognizer::IsIntMode ( ) const
inline

◆ IsRecoding()

bool tesseract::LSTMRecognizer::IsRecoding ( ) const
inline

◆ IsTensorFlow()

bool tesseract::LSTMRecognizer::IsTensorFlow ( ) const
inline

◆ LabelsFromOutputs()

void tesseract::LSTMRecognizer::LabelsFromOutputs ( const NetworkIO outputs,
GenericVector< int > *  labels,
GenericVector< int > *  xcoords 
)

◆ LabelsViaReEncode()

void tesseract::LSTMRecognizer::LabelsViaReEncode ( const NetworkIO output,
GenericVector< int > *  labels,
GenericVector< int > *  xcoords 
)
protected

◆ LabelsViaSimpleText()

void tesseract::LSTMRecognizer::LabelsViaSimpleText ( const NetworkIO output,
GenericVector< int > *  labels,
GenericVector< int > *  xcoords 
)
protected

◆ learning_rate()

double tesseract::LSTMRecognizer::learning_rate ( ) const
inline

◆ Load()

bool tesseract::LSTMRecognizer::Load ( const char *  lang,
TessdataManager mgr 
)

◆ LoadCharsets()

bool tesseract::LSTMRecognizer::LoadCharsets ( const TessdataManager mgr)

◆ LoadDictionary()

bool tesseract::LSTMRecognizer::LoadDictionary ( const char *  lang,
TessdataManager mgr 
)

◆ LoadRecoder()

bool tesseract::LSTMRecognizer::LoadRecoder ( TFile fp)

◆ null_char()

int tesseract::LSTMRecognizer::null_char ( ) const
inline

◆ NumInputs()

int tesseract::LSTMRecognizer::NumInputs ( ) const
inline

◆ NumOutputs()

int tesseract::LSTMRecognizer::NumOutputs ( ) const
inline

◆ OutputLossType()

LossType tesseract::LSTMRecognizer::OutputLossType ( ) const
inline

◆ OutputStats()

void tesseract::LSTMRecognizer::OutputStats ( const NetworkIO outputs,
float *  min_output,
float *  mean_output,
float *  sd 
)

◆ RecognizeLine() [1/2]

void tesseract::LSTMRecognizer::RecognizeLine ( const ImageData image_data,
bool  invert,
bool  debug,
double  worst_dict_cert,
const TBOX line_box,
PointerVector< WERD_RES > *  words,
int  lstm_choice_mode = 0 
)

◆ RecognizeLine() [2/2]

bool tesseract::LSTMRecognizer::RecognizeLine ( const ImageData image_data,
bool  invert,
bool  debug,
bool  re_invert,
bool  upside_down,
float *  scale_factor,
NetworkIO inputs,
NetworkIO outputs 
)

◆ sample_iteration()

int tesseract::LSTMRecognizer::sample_iteration ( ) const
inline

◆ ScaleLayerLearningRate()

void tesseract::LSTMRecognizer::ScaleLayerLearningRate ( const STRING id,
double  factor 
)
inline

◆ ScaleLearningRate()

void tesseract::LSTMRecognizer::ScaleLearningRate ( double  factor)
inline

◆ Serialize()

bool tesseract::LSTMRecognizer::Serialize ( const TessdataManager mgr,
TFile fp 
) const

◆ SetIteration()

void tesseract::LSTMRecognizer::SetIteration ( int  iteration)
inline

◆ SetRandomSeed()

void tesseract::LSTMRecognizer::SetRandomSeed ( )
inlineprotected

◆ SimpleTextOutput()

bool tesseract::LSTMRecognizer::SimpleTextOutput ( ) const
inline

◆ training_iteration()

int tesseract::LSTMRecognizer::training_iteration ( ) const
inline

Member Data Documentation

◆ adam_beta_

float tesseract::LSTMRecognizer::adam_beta_
protected

◆ ccutil_

CCUtil tesseract::LSTMRecognizer::ccutil_
protected

◆ debug_win_

ScrollView* tesseract::LSTMRecognizer::debug_win_
protected

◆ dict_

Dict* tesseract::LSTMRecognizer::dict_
protected

◆ learning_rate_

float tesseract::LSTMRecognizer::learning_rate_
protected

◆ momentum_

float tesseract::LSTMRecognizer::momentum_
protected

◆ network_

Network* tesseract::LSTMRecognizer::network_
protected

◆ network_str_

STRING tesseract::LSTMRecognizer::network_str_
protected

◆ null_char_

int32_t tesseract::LSTMRecognizer::null_char_
protected

◆ randomizer_

TRand tesseract::LSTMRecognizer::randomizer_
protected

◆ recoder_

UnicharCompress tesseract::LSTMRecognizer::recoder_
protected

◆ sample_iteration_

int32_t tesseract::LSTMRecognizer::sample_iteration_
protected

◆ scratch_space_

NetworkScratch tesseract::LSTMRecognizer::scratch_space_
protected

◆ search_

RecodeBeamSearch* tesseract::LSTMRecognizer::search_
protected

◆ training_flags_

int32_t tesseract::LSTMRecognizer::training_flags_
protected

◆ training_iteration_

int32_t tesseract::LSTMRecognizer::training_iteration_
protected

The documentation for this class was generated from the following files: