tesseract
5.0.0-alpha-619-ge9db
|
#include <recodebeam.h>
Public Member Functions | |
RecodeBeamSearch (const UnicharCompress &recoder, int null_char, bool simple_text, Dict *dict) | |
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 (GenericVector< int > *labels, GenericVector< int > *xcoords) const |
void | ExtractBestPathAsUnicharIds (bool debug, const UNICHARSET *unicharset, GenericVector< int > *unichar_ids, GenericVector< float > *certs, GenericVector< float > *ratings, GenericVector< 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 180 of file recodebeam.h.
tesseract::RecodeBeamSearch::RecodeBeamSearch | ( | const UnicharCompress & | recoder, |
int | null_char, | ||
bool | simple_text, | ||
Dict * | dict | ||
) |
Definition at line 63 of file recodebeam.cpp.
|
inlinestatic |
Definition at line 267 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 166 of file recodebeam.cpp.
|
inlinestatic |
Definition at line 260 of file recodebeam.h.
void tesseract::RecodeBeamSearch::DebugBeams | ( | const UNICHARSET & | unicharset | ) | const |
Definition at line 495 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 93 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 78 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 105 of file recodebeam.cpp.
void tesseract::RecodeBeamSearch::ExtractBestPathAsLabels | ( | GenericVector< int > * | labels, |
GenericVector< int > * | xcoords | ||
) | const |
Definition at line 192 of file recodebeam.cpp.
void tesseract::RecodeBeamSearch::ExtractBestPathAsUnicharIds | ( | bool | debug, |
const UNICHARSET * | unicharset, | ||
GenericVector< int > * | unichar_ids, | ||
GenericVector< float > * | certs, | ||
GenericVector< float > * | ratings, | ||
GenericVector< int > * | xcoords | ||
) | const |
Definition at line 215 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 230 of file recodebeam.cpp.
void tesseract::RecodeBeamSearch::extractSymbolChoices | ( | const UNICHARSET * | unicharset | ) |
Definition at line 395 of file recodebeam.cpp.
|
inlinestatic |
Definition at line 263 of file recodebeam.h.
|
inlinestatic |
Definition at line 259 of file recodebeam.h.
void tesseract::RecodeBeamSearch::PrintBeam2 | ( | bool | uids, |
int | num_outputs, | ||
const UNICHARSET * | charset, | ||
bool | secondary | ||
) | const |
Definition at line 315 of file recodebeam.cpp.
void tesseract::RecodeBeamSearch::segmentTimestepsByCharacters | ( | ) |
Definition at line 156 of file recodebeam.cpp.
std::vector<int> tesseract::RecodeBeamSearch::character_boundaries_ |
Definition at line 247 of file recodebeam.h.
std::vector<std::vector<std::pair<const char*, float> > > tesseract::RecodeBeamSearch::ctc_choices |
Definition at line 243 of file recodebeam.h.
std::vector<std::unordered_set<int> > tesseract::RecodeBeamSearch::excludedUnichars |
Definition at line 245 of file recodebeam.h.
|
staticconstexpr |
Definition at line 252 of file recodebeam.h.
|
static |
Definition at line 257 of file recodebeam.h.
|
static |
Definition at line 254 of file recodebeam.h.
std::vector<std::vector<std::vector<std::pair<const char*, float> > > > tesseract::RecodeBeamSearch::segmentedTimesteps |
Definition at line 241 of file recodebeam.h.
std::vector< std::vector<std::pair<const char*, float> > > tesseract::RecodeBeamSearch::timesteps |
Definition at line 239 of file recodebeam.h.