tesseract v5.3.3.20231005
|
#include <recodebeam.h>
Public Member Functions | |
RecodeBeamSearch (const UnicharCompress &recoder, int null_char, bool simple_text, Dict *dict) | |
~RecodeBeamSearch () | |
void | Decode (const NetworkIO &output, double dict_ratio, double cert_offset, double worst_dict_cert, const UNICHARSET *charset, int lstm_choice_mode=0) |
void | Decode (const GENERIC_2D_ARRAY< float > &output, double dict_ratio, double cert_offset, double worst_dict_cert, const UNICHARSET *charset) |
void | DecodeSecondaryBeams (const NetworkIO &output, double dict_ratio, double cert_offset, double worst_dict_cert, const UNICHARSET *charset, int lstm_choice_mode=0) |
void | ExtractBestPathAsLabels (std::vector< int > *labels, std::vector< int > *xcoords) const |
void | ExtractBestPathAsUnicharIds (bool debug, const UNICHARSET *unicharset, std::vector< int > *unichar_ids, std::vector< float > *certs, std::vector< float > *ratings, std::vector< int > *xcoords) const |
void | ExtractBestPathAsWords (const TBOX &line_box, float scale_factor, bool debug, const UNICHARSET *unicharset, PointerVector< WERD_RES > *words, int lstm_choice_mode=0) |
void | DebugBeams (const UNICHARSET &unicharset) const |
void | extractSymbolChoices (const UNICHARSET *unicharset) |
void | PrintBeam2 (bool uids, int num_outputs, const UNICHARSET *charset, bool secondary) const |
void | segmentTimestepsByCharacters () |
std::vector< std::vector< std::pair< const char *, float > > > | combineSegmentedTimesteps (std::vector< std::vector< std::vector< std::pair< const char *, float > > > > *segmentedTimesteps) |
Static Public Member Functions | |
static int | LengthFromBeamsIndex (int index) |
static NodeContinuation | ContinuationFromBeamsIndex (int index) |
static bool | IsDawgFromBeamsIndex (int index) |
static int | BeamIndex (bool is_dawg, NodeContinuation cont, int length) |
Public Attributes | |
std::vector< std::vector< std::pair< const char *, float > > > | timesteps |
std::vector< std::vector< std::vector< std::pair< const char *, float > > > > | segmentedTimesteps |
std::vector< std::vector< std::pair< const char *, float > > > | ctc_choices |
std::vector< std::unordered_set< int > > | excludedUnichars |
std::vector< int > | character_boundaries_ |
Static Public Attributes | |
static constexpr float | kMinCertainty = -20.0f |
static const int | kNumLengths = RecodedCharID::kMaxCodeLen + 1 |
static const int | kNumBeams = 2 * NC_COUNT * kNumLengths |
Definition at line 181 of file recodebeam.h.
tesseract::RecodeBeamSearch::RecodeBeamSearch | ( | const UnicharCompress & | recoder, |
int | null_char, | ||
bool | simple_text, | ||
Dict * | dict | ||
) |
Definition at line 58 of file recodebeam.cpp.
tesseract::RecodeBeamSearch::~RecodeBeamSearch | ( | ) |
Definition at line 73 of file recodebeam.cpp.
|
inlinestatic |
Definition at line 260 of file recodebeam.h.
std::vector< std::vector< std::pair< const char *, float > > > tesseract::RecodeBeamSearch::combineSegmentedTimesteps | ( | std::vector< std::vector< std::vector< std::pair< const char *, float > > > > * | segmentedTimesteps | ) |
Definition at line 175 of file recodebeam.cpp.
|
inlinestatic |
Definition at line 253 of file recodebeam.h.
void tesseract::RecodeBeamSearch::DebugBeams | ( | const UNICHARSET & | unicharset | ) | const |
Definition at line 516 of file recodebeam.cpp.
void tesseract::RecodeBeamSearch::Decode | ( | const GENERIC_2D_ARRAY< float > & | output, |
double | dict_ratio, | ||
double | cert_offset, | ||
double | worst_dict_cert, | ||
const UNICHARSET * | charset | ||
) |
Definition at line 100 of file recodebeam.cpp.
void tesseract::RecodeBeamSearch::Decode | ( | const NetworkIO & | output, |
double | dict_ratio, | ||
double | cert_offset, | ||
double | worst_dict_cert, | ||
const UNICHARSET * | charset, | ||
int | lstm_choice_mode = 0 |
||
) |
Definition at line 83 of file recodebeam.cpp.
void tesseract::RecodeBeamSearch::DecodeSecondaryBeams | ( | const NetworkIO & | output, |
double | dict_ratio, | ||
double | cert_offset, | ||
double | worst_dict_cert, | ||
const UNICHARSET * | charset, | ||
int | lstm_choice_mode = 0 |
||
) |
Definition at line 112 of file recodebeam.cpp.
void tesseract::RecodeBeamSearch::ExtractBestPathAsLabels | ( | std::vector< int > * | labels, |
std::vector< int > * | xcoords | ||
) | const |
Definition at line 201 of file recodebeam.cpp.
void tesseract::RecodeBeamSearch::ExtractBestPathAsUnicharIds | ( | bool | debug, |
const UNICHARSET * | unicharset, | ||
std::vector< int > * | unichar_ids, | ||
std::vector< float > * | certs, | ||
std::vector< float > * | ratings, | ||
std::vector< int > * | xcoords | ||
) | const |
Definition at line 224 of file recodebeam.cpp.
void tesseract::RecodeBeamSearch::ExtractBestPathAsWords | ( | const TBOX & | line_box, |
float | scale_factor, | ||
bool | debug, | ||
const UNICHARSET * | unicharset, | ||
PointerVector< WERD_RES > * | words, | ||
int | lstm_choice_mode = 0 |
||
) |
Definition at line 239 of file recodebeam.cpp.
void tesseract::RecodeBeamSearch::extractSymbolChoices | ( | const UNICHARSET * | unicharset | ) |
Definition at line 409 of file recodebeam.cpp.
|
inlinestatic |
Definition at line 256 of file recodebeam.h.
|
inlinestatic |
Definition at line 250 of file recodebeam.h.
void tesseract::RecodeBeamSearch::PrintBeam2 | ( | bool | uids, |
int | num_outputs, | ||
const UNICHARSET * | charset, | ||
bool | secondary | ||
) | const |
Definition at line 330 of file recodebeam.cpp.
void tesseract::RecodeBeamSearch::segmentTimestepsByCharacters | ( | ) |
Definition at line 164 of file recodebeam.cpp.
std::vector<int> tesseract::RecodeBeamSearch::character_boundaries_ |
Definition at line 238 of file recodebeam.h.
std::vector<std::vector<std::pair<const char *, float> > > tesseract::RecodeBeamSearch::ctc_choices |
Definition at line 234 of file recodebeam.h.
std::vector<std::unordered_set<int> > tesseract::RecodeBeamSearch::excludedUnichars |
Definition at line 236 of file recodebeam.h.
|
staticconstexpr |
Definition at line 243 of file recodebeam.h.
|
static |
Definition at line 248 of file recodebeam.h.
|
static |
Definition at line 245 of file recodebeam.h.
std::vector<std::vector<std::vector<std::pair<const char *, float> > > > tesseract::RecodeBeamSearch::segmentedTimesteps |
Definition at line 232 of file recodebeam.h.
std::vector<std::vector<std::pair<const char *, float> > > tesseract::RecodeBeamSearch::timesteps |
Definition at line 231 of file recodebeam.h.