コード例 #1
0
ファイル: train.py プロジェクト: testanull/DeepLearning-OCR
def pred(model, X, char_set, label_set, post_correction):
	pred_res = model.predict(X)
	pred_res = [one_hot_decoder(i, char_set) for i in pred_res]
	pred_res = [list2str(i) for i in pred_res]
	# post correction
	if post_correction:
		pred_res = correction(pred_res, label_set)
	return pred_res
コード例 #2
0
def pred(model, X, char_set, label_set, post_correction):
    pred_res = model.predict(X)
    pred_res = [one_hot_decoder(i, char_set) for i in pred_res]
    pred_res = [list2str(i) for i in pred_res]
    # post correction
    if post_correction:
        pred_res = correction(pred_res, label_set)
    return pred_res
コード例 #3
0
ファイル: models.py プロジェクト: testanull/DeepLearning-OCR
 def pred(self, X):
     pred_res = self.model.predict(X, batch_size=256)
     self.pred_probs = pred_res
     pred_res = [one_hot_decoder(i, self.char_set) for i in pred_res]
     pred_res = [list2str(i) for i in pred_res]
     # post correction
     if self.post_correction:
         pred_res = correction(pred_res, self.label_set)
     return pred_res
コード例 #4
0
ファイル: models.py プロジェクト: zhangfaen/DeepLearning-OCR
 def pred(self, X):
     pred_res = self.model.predict(X, batch_size=256)
     self.pred_probs = pred_res
     pred_res = [one_hot_decoder(i, self.char_set) for i in pred_res]
     pred_res = [list2str(i) for i in pred_res]
     # post correction
     if self.post_correction:
         pred_res = correction(pred_res, self.label_set)
     return pred_res