File tree Expand file tree Collapse file tree 1 file changed +3
-10
lines changed Expand file tree Collapse file tree 1 file changed +3
-10
lines changed Original file line number Diff line number Diff line change 29
29
from pathlib import Path
30
30
import base64
31
31
from io import BytesIO
32
+ import pprint
32
33
from PIL import Image
33
34
from tools .infer import predict_system
34
35
@@ -889,17 +890,10 @@ def main():
889
890
)
890
891
if result is not None :
891
892
lines = []
892
- for idx in range (len (result )):
893
- res = result [idx ]
893
+ for res in result :
894
894
for line in res :
895
895
logger .info (line )
896
- val = "["
897
- for box in line [0 ]:
898
- val += str (box [0 ]) + "," + str (box [1 ]) + ","
899
-
900
- val = val [:- 1 ]
901
- val += "]," + line [1 ][0 ] + "," + str (line [1 ][1 ]) + "\n "
902
- lines .append (val )
896
+ lines .append (pprint .pformat (line ) + "\n " )
903
897
if args .savefile :
904
898
if os .path .exists (args .output ) is False :
905
899
os .mkdir (args .output )
@@ -941,7 +935,6 @@ def main():
941
935
all_res = []
942
936
for index , (new_img_path , img ) in enumerate (img_paths ):
943
937
logger .info ("processing {}/{} page:" .format (index + 1 , len (img_paths )))
944
- new_img_name = os .path .basename (new_img_path ).split ("." )[0 ]
945
938
result = engine (img , img_idx = index )
946
939
save_structure_res (result , args .output , img_name , index )
947
940
You can’t perform that action at this time.
0 commit comments