Merge pull request #1985 from WenmuZhou/fix_doc
fix rare export error and support rare infer
This commit is contained in:
commit
95a1c6176d
|
@ -146,6 +146,9 @@ class AttentionLSTM(nn.Layer):
|
|||
else:
|
||||
targets = paddle.zeros(shape=[batch_size], dtype="int32")
|
||||
probs = None
|
||||
char_onehots = None
|
||||
outputs = None
|
||||
alpha = None
|
||||
|
||||
for i in range(num_steps):
|
||||
char_onehots = self._char_to_onehot(
|
||||
|
|
|
@ -54,6 +54,13 @@ class TextRecognizer(object):
|
|||
"character_dict_path": args.rec_char_dict_path,
|
||||
"use_space_char": args.use_space_char
|
||||
}
|
||||
elif self.rec_algorithm == "RARE":
|
||||
postprocess_params = {
|
||||
'name': 'AttnLabelDecode',
|
||||
"character_type": args.rec_char_type,
|
||||
"character_dict_path": args.rec_char_dict_path,
|
||||
"use_space_char": args.use_space_char
|
||||
}
|
||||
self.postprocess_op = build_post_process(postprocess_params)
|
||||
self.predictor, self.input_tensor, self.output_tensors = \
|
||||
utility.create_predictor(args, 'rec', logger)
|
||||
|
|
Loading…
Reference in New Issue