[Fix] fix some Chinese display problems. (#1922)

pull/1944/head
Kevin Wang 2023-06-24 00:17:29 +08:00 committed by GitHub
parent 0cd2878b04
commit 6b3f6f5285
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View File

@ -80,7 +80,9 @@ class MMOCRInferencer(BaseMMOCRInferencer):
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:
@ -398,7 +400,7 @@ class MMOCRInferencer(BaseMMOCRInferencer):
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:

View File

@ -21,4 +21,4 @@ class JsonDumper(BaseDumper):
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)