Skip to content

Commit

Permalink
add inference
Browse files Browse the repository at this point in the history
  • Loading branch information
namtuanly committed Apr 9, 2023
1 parent 20a08d6 commit c0665ec
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
]


alphabet_file = './fintabnet_alphabet/structure_alphabet.txt'
alphabet_file = './configs/textrecog/master/fintabnet_alphabet/structure_alphabet.txt'
alphabet_len = len(open(alphabet_file, 'r').readlines())
max_seq_len = 601

cell_alphabet_file = './fintabnet_alphabet/textline_recognition_alphabet.txt'
cell_alphabet_file = './configs/textrecog/master/fintabnet_alphabet/textline_recognition_alphabet.txt'
cell_alphabet_len = len(open(cell_alphabet_file, 'r').readlines())
max_seq_len_cell = 150

Expand Down
3 changes: 1 addition & 2 deletions table_recognition/table_inference_VQAonBD2023_inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,6 @@ def predict_single_file(self, file_path):

img = cv2.resize(img, (w, h), interpolation=cv2.INTER_AREA)
cv2.imwrite(new_path, img)
print(file_path)
except:
print(file_path)
return
Expand All @@ -394,7 +393,7 @@ def predict_single_file(self, file_path):
file_name = os.path.basename(file_path)
result = model_inference(self.model, [img], batch_mode=True)
result = self.result_format(result, file_path)
result_dict = {file_name:result}
result_dict = (file_name, result)
return result, result_dict


Expand Down

0 comments on commit c0665ec

Please sign in to comment.