Skip to content

Commit

Permalink
[Fix] fix some Chinese display problems. (#1922)
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinNuNu authored Jun 23, 2023
1 parent 0cd2878 commit 6b3f6f5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions mmocr/apis/inferencers/mmocr_inferencer.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@ def __init__(self,
type='TextSpottingLocalVisualizer',
name=f'inferencer{ts}',
font_families=self.textrec_inferencer.visualizer.
font_families))
font_families,
font_properties=self.textrec_inferencer.visualizer.
font_properties))
else:
self.mode = 'rec'
if kie is not None:
Expand Down Expand Up @@ -398,7 +400,7 @@ def postprocess(self,
pred_name = osp.splitext(osp.basename(img_path))[0]
pred_name = f'{pred_name}.json'
pred_out_file = osp.join(pred_out_dir, pred_name)
mmengine.dump(pred_result, pred_out_file)
mmengine.dump(pred_result, pred_out_file, ensure_ascii=False)

result_dict['predictions'] = pred_results
if print_result:
Expand Down
2 changes: 1 addition & 1 deletion mmocr/datasets/preparers/dumpers/json_dumper.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ def dump(self, data: Dict) -> None:

filename = f'{self.task}_{self.split}.json'
dst_file = osp.join(self.data_root, filename)
mmengine.dump(data, dst_file)
mmengine.dump(data, dst_file, ensure_ascii=False)

0 comments on commit 6b3f6f5

Please sign in to comment.