Skip to content

Commit

Permalink
Fix ppocr_v4 compilation errors
Browse files Browse the repository at this point in the history
  • Loading branch information
CVHub520 committed Oct 25, 2023
1 parent 7faabb1 commit 170a294
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 14 deletions.
5 changes: 2 additions & 3 deletions anylabeling-linux-cpu.spec
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ a = Analysis(
('anylabeling/configs/auto_labeling/*.yaml', 'anylabeling/configs/auto_labeling'),
('anylabeling/configs/*.yaml', 'anylabeling/configs'),
('anylabeling/views/labeling/widgets/auto_labeling/auto_labeling.ui', 'anylabeling/views/labeling/widgets/auto_labeling'),
('anylabeling/services/auto_labeling/configs/bert_base_uncased_tokenizer.json', 'anylabeling/services/auto_labeling/configs'),
('anylabeling/services/auto_labeling/configs/ram_tag_list_chinese.txt', 'anylabeling/services/auto_labeling/configs'),
('anylabeling/services/auto_labeling/configs/ram_tag_list.txt', 'anylabeling/services/auto_labeling/configs')
('anylabeling/services/auto_labeling/configs/*.json', 'anylabeling/services/auto_labeling/configs'),
('anylabeling/services/auto_labeling/configs/*.txt', 'anylabeling/services/auto_labeling/configs')
],
hiddenimports=[],
hookspath=[],
Expand Down
5 changes: 2 additions & 3 deletions anylabeling-linux-gpu.spec
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ a = Analysis(
('anylabeling/configs/auto_labeling/*.yaml', 'anylabeling/configs/auto_labeling'),
('anylabeling/configs/*.yaml', 'anylabeling/configs'),
('anylabeling/views/labeling/widgets/auto_labeling/auto_labeling.ui', 'anylabeling/views/labeling/widgets/auto_labeling'),
('anylabeling/services/auto_labeling/configs/bert_base_uncased_tokenizer.json', 'anylabeling/services/auto_labeling/configs'),
('anylabeling/services/auto_labeling/configs/ram_tag_list_chinese.txt', 'anylabeling/services/auto_labeling/configs'),
('anylabeling/services/auto_labeling/configs/ram_tag_list.txt', 'anylabeling/services/auto_labeling/configs'),
('anylabeling/services/auto_labeling/configs/*.json', 'anylabeling/services/auto_labeling/configs'),
('anylabeling/services/auto_labeling/configs/*.txt', 'anylabeling/services/auto_labeling/configs'),
('/home/cvhub/miniconda3/envs/x-anylabeling-gpu/lib/python3.8/site-packages/onnxruntime/capi/libonnxruntime_providers_cuda.so', 'onnxruntime/capi'),
('/home/cvhub/miniconda3/envs/x-anylabeling-gpu/lib/python3.8/site-packages/onnxruntime/capi/libonnxruntime_providers_shared.so', 'onnxruntime/capi'),
],
Expand Down
5 changes: 2 additions & 3 deletions anylabeling-win-cpu.spec
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@ a = Analysis(
datas=[
('anylabeling/configs/auto_labeling/*.yaml', 'anylabeling/configs/auto_labeling'),
('anylabeling/configs/*.yaml', 'anylabeling/configs'),
('anylabeling/services/auto_labeling/configs/ram_tag_list_chinese.txt', 'anylabeling/services/auto_labeling/configs'),
('anylabeling/services/auto_labeling/configs/ram_tag_list.txt', 'anylabeling/services/auto_labeling/configs'),
('anylabeling/views/labeling/widgets/auto_labeling/auto_labeling.ui', 'anylabeling/views/labeling/widgets/auto_labeling'),
('anylabeling/services/auto_labeling/configs/bert_base_uncased_tokenizer.json', 'anylabeling/services/auto_labeling/configs')
('anylabeling/services/auto_labeling/configs/*.json', 'anylabeling/services/auto_labeling/configs'),
('anylabeling/services/auto_labeling/configs/*.txt', 'anylabeling/services/auto_labeling/configs')
],
hiddenimports=[],
hookspath=[],
Expand Down
5 changes: 2 additions & 3 deletions anylabeling-win-gpu.spec
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ a = Analysis(
('anylabeling/configs/auto_labeling/*.yaml', 'anylabeling/configs/auto_labeling'),
('anylabeling/configs/*.yaml', 'anylabeling/configs'),
('anylabeling/views/labeling/widgets/auto_labeling/auto_labeling.ui', 'anylabeling/views/labeling/widgets/auto_labeling'),
('anylabeling/services/auto_labeling/configs/bert_base_uncased_tokenizer.json', 'anylabeling/services/auto_labeling/configs'),
('anylabeling/services/auto_labeling/configs/ram_tag_list_chinese.txt', 'anylabeling/services/auto_labeling/configs'),
('anylabeling/services/auto_labeling/configs/ram_tag_list.txt', 'anylabeling/services/auto_labeling/configs'),
('anylabeling/services/auto_labeling/configs/*.json', 'anylabeling/services/auto_labeling/configs'),
('anylabeling/services/auto_labeling/configs/*.txt', 'anylabeling/services/auto_labeling/configs'),
('C:/Users/18102/.conda/envs/x-anylabeling-gpu/Lib/site-packages/onnxruntime/capi/onnxruntime_providers_cuda.dll', 'onnxruntime/capi'),
('C:/Users/18102/.conda/envs/x-anylabeling-gpu/Lib/site-packages/onnxruntime/capi/onnxruntime_providers_shared.dll', 'onnxruntime/capi')
],
Expand Down
5 changes: 3 additions & 2 deletions anylabeling/services/auto_labeling/ppocr_v4.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ def __init__(self, model_config, on_message) -> None:
self.rec_net = self.load_model('rec_model_path')
self.cls_net = self.load_model('cls_model_path')
self.use_angle_cls = self.config["use_angle_cls"]
self.current_dir = os.path.dirname(__file__)

def parse_args(self):
args = Args(
Expand Down Expand Up @@ -121,7 +122,7 @@ def parse_args(self):
rec_image_shape="3, 48, 320",
rec_batch_num=6,
max_text_length=25,
rec_char_dict_path='anylabeling/services/auto_labeling/utils/ppocr_utils/ppocr_keys_v1.txt',
rec_char_dict_path=os.path.join(self.current_dir, "configs", "ppocr_keys_v1.txt"),
use_space_char=True,
drop_score=0.5,
# params for e2e
Expand All @@ -131,7 +132,7 @@ def parse_args(self):
e2e_limit_type='max',
# PGNet parmas
e2e_pgnet_score_thresh=0.5,
e2e_char_dict_path='ic15_dict.txt',
e2e_char_dict_path=os.path.join(self.current_dir, "configs", "ppocr_ic15_dict.txt"),
e2e_pgnet_valid_set='totaltext',
e2e_pgnet_mode='fast',
# params for text classifier
Expand Down

0 comments on commit 170a294

Please sign in to comment.