MCPcopy Create free account
hub / github.com/creatale/node-dv / Classify

Method Classify

deps/tesseract/cube/conv_net_classifier.cpp:187–204  ·  view source on GitHub ↗

* classifies a charsamp and returns an alternate list * of chars sorted by char costs */

Source from the content-addressed store, hash-verified

185 * of chars sorted by char costs
186 */
187CharAltList *ConvNetCharClassifier::Classify(CharSamp *char_samp) {
188 // run the needed nets
189 if (RunNets(char_samp) == false) {
190 return NULL;
191 }
192
193 int class_cnt = char_set_->ClassCount();
194
195 // create an altlist
196 CharAltList *alt_list = new CharAltList(char_set_, class_cnt);
197
198 for (int out = 1; out < class_cnt; out++) {
199 int cost = CubeUtils::Prob2Cost(net_output_[out]);
200 alt_list->Insert(out, cost);
201 }
202
203 return alt_list;
204}
205
206/**
207 * Set an external net (for training purposes)

Callers 2

RecognizeSegmentMethod · 0.45
RecognizeCharMethod · 0.45

Calls 2

ClassCountMethod · 0.80
InsertMethod · 0.45

Tested by

no test coverage detected